copy-constructor
What is the difference between overloading operator= and overloading the copy constructor?
What is the d开发者_StackOverflowifference between overloading the operator = in a class and the copy constructor?[详细]
2023-03-14 10:33 分类:问答Is the copy CTOR required even if never called?
consider the following: class X { public: X(int i) { cout << \"X(int i)\" << endl; } X(const X& x) { cout << \"X(const X& x)\" << endl; }[详细]
2023-03-12 06:11 分类:问答Is is possible to use std::map in C++ with a class without any copy operator?
I\'m using a Class (Object) that doesn\'t have any copy operator : it basically cannot be copied right now. I have a[详细]
2023-03-10 02:09 分类:问答c++: Excessive copying of large objects
While there is quite a few questions about copy constructors/assignment operators on SO already, I did not find an answer that fit my problem.[详细]
2023-03-05 09:19 分类:问答Safe assignment and copy-and-swap idiom [closed]
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question开发者_如何转开发? Update the question so it focuses on one problem only[详细]
2023-03-03 13:07 分类:问答Copy Constructor for Simple Single Linked List including Nodes C++
I\'m not very good at this, and I am a bit stuck making the copy constructor for a single linked list and the nodes 开发者_StackOverflow社区that go with it.[详细]
2023-03-01 18:24 分类:问答What's the most reliable way to prohibit a copy constructor in C++?
Sometimes it\'s necessary to prohibit a copy constructor in a C++ class so that class becomes \"non-copyable\". Of course, operator= should be prohibited at the same time.[详细]
2023-02-27 06:13 分类:问答s copy constructor
The idea of copy constructor really confuses me.I don\'t understand 开发者_开发技巧why they use references and why constant references in copy constructor?Why you use a reference: if you didn\'t, you\[详细]
2023-02-27 01:10 分类:问答Dereferencing syntax in copy constructor for class that contains other objects
Suppose the class MyClass has constructor: MyClass::MyClass( ... ) { var = new OtherClass( ... ); } and suppose the class OtherClass has copy constructor:[详细]
2023-02-25 19:23 分类:问答C++: Is default copy constructor affected by presence of other constructors and destructor?
As we know, if any constructor is declared (copy constructor included), default constructor (the one that takes no arguments) is not implicitly created. Does the same hap开发者_如何学编程pen with a de[详细]
2023-02-24 06:34 分类:问答