[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 ...
- From: James Lin <jameslin vmware com>
- To: 'Peter Basista' <pbasista hotmail com>, "libsigc-list gnome org" <libsigc-list gnome org>
- Subject: Re: [sigc] Compile error: invalid initialization of non-const reference of type ‘some_slot&’ from a temporary of type ...
- Date: Mon, 18 May 2009 06:41:14 -0700
Peter Basista wrote:
>
> int bar (gslot & gs) { // The argument is a reference
> std::cout << "Executing bar." << std::endl;
> gs(0, 1.0, 'c', "hello");
> return (0);
> }
>
> [...]
>
> bar(sigc::hide(sigc::mem_fun(ec, &ExampleClass::f)));
> // <-- COMPILE ERROR
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
- James
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]