Re: [sigc] =?windows-1252?q?Compile_error=3A_invalid_initialization_o?= =?windows-1252?q?f_non-const_reference_of_type_=91some=5Fslot=26=92_from_?= =?windows-1252?q?a_temporary_of_type_=2E=2E=2E?=



I am sorry for the previous empty message, I pressed the wrong button ...
-----------------------------------------------------------------------

James Lin wrote:
> C++ does not allow anonymous objects to be passed where non-const references are expected. Specifically, non-const references must be lvalues.
>
> http://groups.google.com/group/comp.lang.c++/browse_thread/thread/814a071947c5b675/be95a615245cdbdf?#be95a615245cdbdf

Well, I hope I see what you mean. I was not aware of this. After I corrected the definition of bar and added const:

int bar (const gslot & gs)

The code compiled without problems.

Thank you very much, James!


See all the ways you can stay connected to friends and family


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