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

Re: [sigc] Compile error: invalid initialization of non-const reference of type ‘some_slot&’ from a temporary of type ...



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]