Re: error: no matching function for call to `Anton::Anton(Anton)`

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Eric,

As per section 5.5 of Stroustrup's C++PL (3rd ed or special ed), a temporary object cannot be bound to a non-const reference.

What you are trying to do is to bind a temporary object to a non-const reference.  That's not allowed by C++.

(For the reasons that it's not allowed, see C++PL.)

Change your pass-by-reference to a pass-by-value, then your program will compile.

Or make an explicit variable instead of using a temporary.
HTH,
--Eljay



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux