mercredi 24 avril 2019

Passing an initializer list to a vector based constructor

I currently have the following code

class test
{
   public:
   test(std::vector<std::string> str)
   {
   }
   test()
   {
   }
    const std::multimap<int,  std::multimap<int, test>> _var= {
                 {0x01,  {
                            {
                                0x0f, {"A", "B", "C", "D"}
                            }
                         }
                 }
        };   
};

I wanted to know why passing {"A", "B", "C", "D"} to std::vector<std::string> str) is failing ? Any suggestions on how I can resolve this issue ?

Aucun commentaire:

Enregistrer un commentaire