Returning by reference would be better
Num& operator+=(const Num& rhs){
this->m_iNumber += rhs.m_iNumber;
return *this;
}
More Related Contents:
- expected ‘}’ at end of input [closed]
- Where and why do I have to put the “template” and “typename” keywords?
- “unpacking” a tuple to call a matching function pointer
- Example for boost shared_mutex (multiple reads/one write)?
- shared_ptr to an array : should it be used?
- When does a constexpr function get evaluated at compile time?
- How much is too much with C++11 auto keyword?
- Why do I get the same sequence for every run with std::random_device with mingw gcc4.8.1?
- How to concatenate a std::string and an int
- What does std::match_results::size return?
- How to disassemble a binary executable in Linux to get the assembly code?
- How do I define a template function within a template class outside of the class definition?
- Division by zero: Undefined Behavior or Implementation Defined in C and/or C++?
- Performance of dynamic_cast?
- Beyond Stack Sampling: C++ Profilers
- C++ cout printing slowly
- Convert char array to single int?
- Why can you add an integer to a string literal?
- Inconsistent strcmp() return value when passing strings as pointers or as literals
- How to find if a variable is allocated in stack or heap?
- forward declaration with vector of class type – pointer to incomplete class type not allowed
- In which access control context are concepts evaluated?
- Long Vs. Int C/C++ – What’s The Point?
- What C++ library should I use to implement a HTTP client? [closed]
- Calling derived class function from base class
- Should “delete this” be called from within a member method?
- Best way to for C++ types to self register in a list?
- Good C++ solutions to the “Bring all the zeros to the back of the array” interview challenge
- Do I get a finished slot if I start QProcess using startDetached
- compiler cannot recognize my class in c++ – cyclic dependency