Итак, я попробовал протестировать это с помощью следующей программы:
Код: Выделить всё
#include
#include
using namespace std;
class Text {
public:
//default constructor
Text() : m_Data(nullptr) {
};
//constructor
Text(const char* text) {
cout
Подробнее здесь: [url]https://stackoverflow.com/questions/78564263/creation-of-temporary-objects-when-passing-by-value-in-c[/url]
Мобильная версия