CLass_A ob1 = CLass_A();
//so **the temporary object** will call the empty constructor
// i expected that it will also call the Copy constructor to pass
// the temporary object into the ob1
//like this pattern
CLass_A ob0;
CLass_A ob1 =ob0;
here wil call the copy
Кроме того, это также не вызовет конструктор копирования, почему?
#include
class A {
public:
A(){std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/79054667/temporary-object-and-copy-constructor[/url]
У меня есть 3 связанных вопроса [b]Вопрос 1:[/b] [code] CLass_A ob1 = CLass_A(); //so **the temporary object** will call the empty constructor // i expected that it will also call the Copy constructor to pass // the temporary object into the ob1
//like this pattern CLass_A ob0; CLass_A ob1 =ob0; here wil call the copy
[/code] Кроме того, это также не вызовет конструктор копирования, почему? [code]#include class A { public: A(){std::cout
Я нашел миллион примеров того, как это должно работать, но не могу понять, почему он не распознает класс должным образом, как если бы он не был помечен как «частичный». Вот мой частичный класс, позволяющий мне определить строку подключения к БД в...