![]() |
|
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Unknown
Join Date: Apr 2008
Location: unknown
Posts: 79
Rep Power: 1
![]() |
copy constructors explanation and o.overloading
I just need some little explanation about this snippet, i did some little experiment in the class "value" and when i compiled the source file, error pops out, even though in my own logic, there is nothing wrong with it, i came with this book and im trying to learn copy constructors and operator overloading and i did some experimenting on the code:
This is the original code: c++ Syntax (Toggle Plain Text)
now what I did is that on line 50 i replaced it to inline Value operator+ (Value const& v1,Value const& v2)then the error is "must take zero to one argument" and i also replaced line 50 to Value& operator+ (Value const& v1,Value const& v2)and still same error.... im wondering what's the explanation behind this, i just copied line 34... Thanks
__________________
------------------------------------------------------------------------- I thought what I'd Do was, I'd pretend to be one of those deaf mutes ------------------------------------------------------------------------ |
|
|
|
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|