struct WorkExample
{
WorkExample (const int &number ){}
};
WorkExample wOne(1); // ok
WorkExample wTwo=1; // ok
struct Example
{
Example ( const std::string &line ){}
};
Example one("line"); // ok
Example two="line"; // errorconst std::string &line на const char *const line, все работает. Example two=std::string("line");, то все заработает Example two=std::string("line"); -> Example two(std::string("line")); //подходит конструктор Example ( const std::string &line )Example two="line"; -> Example two("line"); //Нет конструктора, который принимает const char*