Friday, 25 November 2016
C++ operator== overloading
Answer
Possible Duplicate:
Operator overloading
What is the differences between the following ways to overload operator== ?
// stroustrup way
friend bool operator== (MyClass &lhs, MyClass &rhs);
and
// as taught in other places, including caltech
bool MyClass::operator== (MyClass &rhs);
Which way is better?
Subscribe to:
Post Comments (Atom)
c++ - Does curly brackets matter for empty constructor?
Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...
-
In K-PAX , there are two possible explanations: Prot is crazy. He is truly an alien. There are facts that indicate 1, but also 2. Examples: ...
-
Why this works? I mean, accessing the private variable. class Test { private $q = 0; public function __construct() { $this-...
-
I found this excellent tutorial on regular expressions and while I intuitively understand what "greedy", "reluctant" an...
No comments:
Post a Comment