Re: [sigc] where is error? reference binding is impossible?



----- Original von:  Paul Pogonyshev <pogonyshev gmx net>:

> > Régis Duchesne wrote:
> > To bind a reference, you must use sigc::ref() around the reference in 
> > the sigc::bind() statement. Works perfectly. We use it all the time.

> OK, I'll assume there is no way to use it automatically (sigc++ code is
> way to difficult to unerstand [quickly].)  I wish it was documented,
> at least in 2.0.10 in Debian Sarge it seems to be undocumented...


How would you do this automatically? It is better to bind a variable by value because there is no garanty that your bound variable is still valid if it would be bound by reference.
The compiler can't deduce whether you want to bind the variable by reference or by value.
Only you know and you have to make that specific in a way; the way in sigc++ (and also boost) is to use ref().

But with the documentation I agree :)


--
Klaus Triendl


-------------------------------------------
Versendet durch aonWebmail (webmail.aon.at)



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