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



klaus,

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.

I disagree with this statement: sigc++ provides a guarantee for that: if your variable is bound to a slot by ref, _and_ it inherits from sigc::trackable, then if the ref becomes invalid, the slot will be automatically invalidated.

The conclusion: it is efficient to bind vars by ref, but to guarantee that it is safe, your vars should inherit from sigc::trackable.

--
hpreg



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