A limit_reference<Foo> object stores a reference (Foo&), but makes sure that, if Foo inherits from sigc::trackable, then visit_each<>() will "limit" itself to the sigc::trackable reference instead of the derived reference.
More...
template<typename T_type, bool I_derives_trackable = std::is_base_of<trackable, std::decay_t<T_type>>::value>
class sigc::limit_reference< T_type, I_derives_trackable >
A limit_reference<Foo> object stores a reference (Foo&), but makes sure that, if Foo inherits from sigc::trackable, then visit_each<>() will "limit" itself to the sigc::trackable reference instead of the derived reference.
This avoids use of a reference to the derived type when the derived destructor has run. That can be a problem when using virtual inheritance.
If Foo inherits from trackable then both the derived reference and the sigc::trackable reference are stored, so we can later retrieve the sigc::trackable reference without doing an implicit conversion. To retrieve the derived reference (so that you invoke methods or members of it), use invoke(). To retrieve the trackable reference (so that you can call visit_each() on it), you use visit().
If Foo does not inherit from sigc::trackable then invoke() and visit() just return the derived reference.
This is used for bound (sigc::bind) slot parameters (via bound_argument), bound return values, and, with mem_fun(), the reference to the handling object.
- T_type The type of the reference.