assignment-operator
Does it make sense to use the move-and-swap idiom on a movable and non-copyable class
If I have a class such as class Foo{ public: Foo(){...} Foo(Foo && rhs){...} operator=(Foo rhs){ swap(*this, rhs);}[详细]
2023-03-22 17:06 分类:问答Using assignment as a condition expression?
Consider: if开发者_高级运维 (a=5) { /* do something */ } How does the assignment work as a condition?[详细]
2023-03-22 08:29 分类:问答polymorphism with =operator using pointer base class
So here is the deal, I think I need to go another route regarding the pattern I am using but I thought I would get some expert opinions first.[详细]
2023-03-22 07:37 分类:问答C++ Assignment Operator without Copy Constructor
The question: Can I define an assignment operator and not the copy constructor? For an internal class (not exposed in the API), is this still a bad design practice?[详细]
2023-03-22 06:10 分类:问答How to idiomatically define assignment operator for immutable classes?
In C开发者_运维知识库++ what is the idiomatic way to define operator= on a class that should be immutable. For example all its member variables are const.[详细]
2023-03-21 00:26 分类:问答Need of privatizing assignment operator in a Singleton class
Can someone justify the need of privatizing the assignment operato开发者_如何转开发r in a Singleton class implementation?[详细]
2023-03-19 23:25 分类:问答C++ vectors, sorting and custom class operators
I am puzzled because I cannot figure where my bug/problem is. I have a class Instruction, which uses two custom operators, one assignment and one comparison operator.[详细]
2023-03-16 18:47 分类:问答php: $a=$b OR $a=$c vs. ternary
I need to assign one of two variables to a third variable, using the value of the second variable if the first is (bool)false or undefined.[详细]
2023-03-13 08:02 分类:问答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 分类:问答PHP's =& operator
Are both these PHP statements doing the same thing?: $o =& $thing; $o = &a开发者_运维百科mp;$thing;[详细]
2023-03-03 23:40 分类:问答