main.cpp:
Код: Выделить всё
int main()
{
//Mystring no_name;
Mystring larry ("LARRY");
Mystring larry1 {larry}; // deep copy ctor is called
Mystring larry2 = "some larry"; // move ctor should be called but still calling parameterized ctor
}
Код: Выделить всё
Mystring::Mystring()
:str{nullptr} {
cout
Подробнее здесь: [url]https://stackoverflow.com/questions/79197754/can-someone-help-me-understand-why-move-constructor-is-not-being-called-in-my-co[/url]
Мобильная версия