Merged revisions 6293,6296-6306,6308 via svnmerge from
[ardour.git] / libs / sigc++2 / sigc++ / functors / mem_fun.h
index 2bd7cde67fc34ad1d6e0a2e44b3f9bef20dc7042..e652b7cf4b0d18615dbe11fb426a25be64a70494 100644 (file)
@@ -10,6 +10,7 @@
 #define _SIGC_FUNCTORS_MACROS_MEM_FUNHM4_
 #include <sigc++/type_traits.h>
 #include <sigc++/functors/functor_trait.h>
+#include <sigc++/limit_reference.h>
 
 namespace sigc {
 
@@ -1743,6 +1744,7 @@ protected:
   function_type func_ptr_;
 };
 
+
 /** bound_mem_functor0 encapsulates a  method with 0 arguments and an object instance.
  * Use the convenience function mem_fun() to create an instance of bound_mem_functor0.
  *
@@ -1765,26 +1767,32 @@ public:
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_mem_functor0( T_obj* _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(_A_obj) {}
+    : base_type_(_A_func),
+      obj_(*_A_obj)
+    {}
 
   /** Constructs a bound_mem_functor0 object that wraps the passed method.
    * @param _A_obj Reference to instance the method will operate on.
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_mem_functor0( T_obj& _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(&_A_obj) {}
+    : base_type_(_A_func),
+      obj_(_A_obj)
+    {}
 
   /** Execute the wrapped method operating on the stored instance.
    * @return The return value of the method invocation.
    */
   T_return operator()() const
-    { return (obj_ptr_->*(this->func_ptr_))(); }
+    { return (obj_.invoke().*(this->func_ptr_))(); }
 
 //protected:
-  /// Pointer to stored object instance.
-   T_obj *obj_ptr_;
+  // Reference to stored object instance.
+  // This is the handler object, such as TheObject in void TheObject::signal_handler().
+  limit_reference<T_obj> obj_;
 };
 
+//template specialization of visit_each<>(action, functor):
 /** Performs a functor on each of the targets of a functor.
  * The function overload for sigc::bound_mem_functor performs a functor
  * on the object instance stored in the sigc::bound_mem_functor object.
@@ -1795,9 +1803,10 @@ template <class T_action, class T_return, class T_obj>
 void visit_each(const T_action& _A_action,
                 const bound_mem_functor0<T_return, T_obj>& _A_target)
 {
-  visit_each(_A_action, *_A_target.obj_ptr_);
+  sigc::visit_each(_A_action, _A_target.obj_);
 }
 
+
 /** bound_mem_functor1 encapsulates a  method with 1 arguments and an object instance.
  * Use the convenience function mem_fun() to create an instance of bound_mem_functor1.
  *
@@ -1821,27 +1830,33 @@ public:
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_mem_functor1( T_obj* _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(_A_obj) {}
+    : base_type_(_A_func),
+      obj_(*_A_obj)
+    {}
 
   /** Constructs a bound_mem_functor1 object that wraps the passed method.
    * @param _A_obj Reference to instance the method will operate on.
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_mem_functor1( T_obj& _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(&_A_obj) {}
+    : base_type_(_A_func),
+      obj_(_A_obj)
+    {}
 
   /** Execute the wrapped method operating on the stored instance.
    * @param _A_a1 Argument to be passed on to the method.
    * @return The return value of the method invocation.
    */
   T_return operator()(typename type_trait<T_arg1>::take _A_a1) const
-    { return (obj_ptr_->*(this->func_ptr_))(_A_a1); }
+    { return (obj_.invoke().*(this->func_ptr_))(_A_a1); }
 
 //protected:
-  /// Pointer to stored object instance.
-   T_obj *obj_ptr_;
+  // Reference to stored object instance.
+  // This is the handler object, such as TheObject in void TheObject::signal_handler().
+  limit_reference<T_obj> obj_;
 };
 
+//template specialization of visit_each<>(action, functor):
 /** Performs a functor on each of the targets of a functor.
  * The function overload for sigc::bound_mem_functor performs a functor
  * on the object instance stored in the sigc::bound_mem_functor object.
@@ -1852,9 +1867,10 @@ template <class T_action, class T_return, class T_obj, class T_arg1>
 void visit_each(const T_action& _A_action,
                 const bound_mem_functor1<T_return, T_obj, T_arg1>& _A_target)
 {
-  visit_each(_A_action, *_A_target.obj_ptr_);
+  sigc::visit_each(_A_action, _A_target.obj_);
 }
 
+
 /** bound_mem_functor2 encapsulates a  method with 2 arguments and an object instance.
  * Use the convenience function mem_fun() to create an instance of bound_mem_functor2.
  *
@@ -1879,14 +1895,18 @@ public:
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_mem_functor2( T_obj* _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(_A_obj) {}
+    : base_type_(_A_func),
+      obj_(*_A_obj)
+    {}
 
   /** Constructs a bound_mem_functor2 object that wraps the passed method.
    * @param _A_obj Reference to instance the method will operate on.
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_mem_functor2( T_obj& _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(&_A_obj) {}
+    : base_type_(_A_func),
+      obj_(_A_obj)
+    {}
 
   /** Execute the wrapped method operating on the stored instance.
    * @param _A_a1 Argument to be passed on to the method.
@@ -1894,13 +1914,15 @@ public:
    * @return The return value of the method invocation.
    */
   T_return operator()(typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2) const
-    { return (obj_ptr_->*(this->func_ptr_))(_A_a1,_A_a2); }
+    { return (obj_.invoke().*(this->func_ptr_))(_A_a1,_A_a2); }
 
 //protected:
-  /// Pointer to stored object instance.
-   T_obj *obj_ptr_;
+  // Reference to stored object instance.
+  // This is the handler object, such as TheObject in void TheObject::signal_handler().
+  limit_reference<T_obj> obj_;
 };
 
+//template specialization of visit_each<>(action, functor):
 /** Performs a functor on each of the targets of a functor.
  * The function overload for sigc::bound_mem_functor performs a functor
  * on the object instance stored in the sigc::bound_mem_functor object.
@@ -1911,9 +1933,10 @@ template <class T_action, class T_return, class T_obj, class T_arg1,class T_arg2
 void visit_each(const T_action& _A_action,
                 const bound_mem_functor2<T_return, T_obj, T_arg1,T_arg2>& _A_target)
 {
-  visit_each(_A_action, *_A_target.obj_ptr_);
+  sigc::visit_each(_A_action, _A_target.obj_);
 }
 
+
 /** bound_mem_functor3 encapsulates a  method with 3 arguments and an object instance.
  * Use the convenience function mem_fun() to create an instance of bound_mem_functor3.
  *
@@ -1939,14 +1962,18 @@ public:
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_mem_functor3( T_obj* _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(_A_obj) {}
+    : base_type_(_A_func),
+      obj_(*_A_obj)
+    {}
 
   /** Constructs a bound_mem_functor3 object that wraps the passed method.
    * @param _A_obj Reference to instance the method will operate on.
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_mem_functor3( T_obj& _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(&_A_obj) {}
+    : base_type_(_A_func),
+      obj_(_A_obj)
+    {}
 
   /** Execute the wrapped method operating on the stored instance.
    * @param _A_a1 Argument to be passed on to the method.
@@ -1955,13 +1982,15 @@ public:
    * @return The return value of the method invocation.
    */
   T_return operator()(typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2,typename type_trait<T_arg3>::take _A_a3) const
-    { return (obj_ptr_->*(this->func_ptr_))(_A_a1,_A_a2,_A_a3); }
+    { return (obj_.invoke().*(this->func_ptr_))(_A_a1,_A_a2,_A_a3); }
 
 //protected:
-  /// Pointer to stored object instance.
-   T_obj *obj_ptr_;
+  // Reference to stored object instance.
+  // This is the handler object, such as TheObject in void TheObject::signal_handler().
+  limit_reference<T_obj> obj_;
 };
 
+//template specialization of visit_each<>(action, functor):
 /** Performs a functor on each of the targets of a functor.
  * The function overload for sigc::bound_mem_functor performs a functor
  * on the object instance stored in the sigc::bound_mem_functor object.
@@ -1972,9 +2001,10 @@ template <class T_action, class T_return, class T_obj, class T_arg1,class T_arg2
 void visit_each(const T_action& _A_action,
                 const bound_mem_functor3<T_return, T_obj, T_arg1,T_arg2,T_arg3>& _A_target)
 {
-  visit_each(_A_action, *_A_target.obj_ptr_);
+  sigc::visit_each(_A_action, _A_target.obj_);
 }
 
+
 /** bound_mem_functor4 encapsulates a  method with 4 arguments and an object instance.
  * Use the convenience function mem_fun() to create an instance of bound_mem_functor4.
  *
@@ -2001,14 +2031,18 @@ public:
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_mem_functor4( T_obj* _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(_A_obj) {}
+    : base_type_(_A_func),
+      obj_(*_A_obj)
+    {}
 
   /** Constructs a bound_mem_functor4 object that wraps the passed method.
    * @param _A_obj Reference to instance the method will operate on.
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_mem_functor4( T_obj& _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(&_A_obj) {}
+    : base_type_(_A_func),
+      obj_(_A_obj)
+    {}
 
   /** Execute the wrapped method operating on the stored instance.
    * @param _A_a1 Argument to be passed on to the method.
@@ -2018,13 +2052,15 @@ public:
    * @return The return value of the method invocation.
    */
   T_return operator()(typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2,typename type_trait<T_arg3>::take _A_a3,typename type_trait<T_arg4>::take _A_a4) const
-    { return (obj_ptr_->*(this->func_ptr_))(_A_a1,_A_a2,_A_a3,_A_a4); }
+    { return (obj_.invoke().*(this->func_ptr_))(_A_a1,_A_a2,_A_a3,_A_a4); }
 
 //protected:
-  /// Pointer to stored object instance.
-   T_obj *obj_ptr_;
+  // Reference to stored object instance.
+  // This is the handler object, such as TheObject in void TheObject::signal_handler().
+  limit_reference<T_obj> obj_;
 };
 
+//template specialization of visit_each<>(action, functor):
 /** Performs a functor on each of the targets of a functor.
  * The function overload for sigc::bound_mem_functor performs a functor
  * on the object instance stored in the sigc::bound_mem_functor object.
@@ -2035,9 +2071,10 @@ template <class T_action, class T_return, class T_obj, class T_arg1,class T_arg2
 void visit_each(const T_action& _A_action,
                 const bound_mem_functor4<T_return, T_obj, T_arg1,T_arg2,T_arg3,T_arg4>& _A_target)
 {
-  visit_each(_A_action, *_A_target.obj_ptr_);
+  sigc::visit_each(_A_action, _A_target.obj_);
 }
 
+
 /** bound_mem_functor5 encapsulates a  method with 5 arguments and an object instance.
  * Use the convenience function mem_fun() to create an instance of bound_mem_functor5.
  *
@@ -2065,14 +2102,18 @@ public:
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_mem_functor5( T_obj* _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(_A_obj) {}
+    : base_type_(_A_func),
+      obj_(*_A_obj)
+    {}
 
   /** Constructs a bound_mem_functor5 object that wraps the passed method.
    * @param _A_obj Reference to instance the method will operate on.
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_mem_functor5( T_obj& _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(&_A_obj) {}
+    : base_type_(_A_func),
+      obj_(_A_obj)
+    {}
 
   /** Execute the wrapped method operating on the stored instance.
    * @param _A_a1 Argument to be passed on to the method.
@@ -2083,13 +2124,15 @@ public:
    * @return The return value of the method invocation.
    */
   T_return operator()(typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2,typename type_trait<T_arg3>::take _A_a3,typename type_trait<T_arg4>::take _A_a4,typename type_trait<T_arg5>::take _A_a5) const
-    { return (obj_ptr_->*(this->func_ptr_))(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5); }
+    { return (obj_.invoke().*(this->func_ptr_))(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5); }
 
 //protected:
-  /// Pointer to stored object instance.
-   T_obj *obj_ptr_;
+  // Reference to stored object instance.
+  // This is the handler object, such as TheObject in void TheObject::signal_handler().
+  limit_reference<T_obj> obj_;
 };
 
+//template specialization of visit_each<>(action, functor):
 /** Performs a functor on each of the targets of a functor.
  * The function overload for sigc::bound_mem_functor performs a functor
  * on the object instance stored in the sigc::bound_mem_functor object.
@@ -2100,9 +2143,10 @@ template <class T_action, class T_return, class T_obj, class T_arg1,class T_arg2
 void visit_each(const T_action& _A_action,
                 const bound_mem_functor5<T_return, T_obj, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5>& _A_target)
 {
-  visit_each(_A_action, *_A_target.obj_ptr_);
+  sigc::visit_each(_A_action, _A_target.obj_);
 }
 
+
 /** bound_mem_functor6 encapsulates a  method with 6 arguments and an object instance.
  * Use the convenience function mem_fun() to create an instance of bound_mem_functor6.
  *
@@ -2131,14 +2175,18 @@ public:
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_mem_functor6( T_obj* _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(_A_obj) {}
+    : base_type_(_A_func),
+      obj_(*_A_obj)
+    {}
 
   /** Constructs a bound_mem_functor6 object that wraps the passed method.
    * @param _A_obj Reference to instance the method will operate on.
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_mem_functor6( T_obj& _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(&_A_obj) {}
+    : base_type_(_A_func),
+      obj_(_A_obj)
+    {}
 
   /** Execute the wrapped method operating on the stored instance.
    * @param _A_a1 Argument to be passed on to the method.
@@ -2150,13 +2198,15 @@ public:
    * @return The return value of the method invocation.
    */
   T_return operator()(typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2,typename type_trait<T_arg3>::take _A_a3,typename type_trait<T_arg4>::take _A_a4,typename type_trait<T_arg5>::take _A_a5,typename type_trait<T_arg6>::take _A_a6) const
-    { return (obj_ptr_->*(this->func_ptr_))(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5,_A_a6); }
+    { return (obj_.invoke().*(this->func_ptr_))(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5,_A_a6); }
 
 //protected:
-  /// Pointer to stored object instance.
-   T_obj *obj_ptr_;
+  // Reference to stored object instance.
+  // This is the handler object, such as TheObject in void TheObject::signal_handler().
+  limit_reference<T_obj> obj_;
 };
 
+//template specialization of visit_each<>(action, functor):
 /** Performs a functor on each of the targets of a functor.
  * The function overload for sigc::bound_mem_functor performs a functor
  * on the object instance stored in the sigc::bound_mem_functor object.
@@ -2167,9 +2217,10 @@ template <class T_action, class T_return, class T_obj, class T_arg1,class T_arg2
 void visit_each(const T_action& _A_action,
                 const bound_mem_functor6<T_return, T_obj, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6>& _A_target)
 {
-  visit_each(_A_action, *_A_target.obj_ptr_);
+  sigc::visit_each(_A_action, _A_target.obj_);
 }
 
+
 /** bound_mem_functor7 encapsulates a  method with 7 arguments and an object instance.
  * Use the convenience function mem_fun() to create an instance of bound_mem_functor7.
  *
@@ -2199,14 +2250,18 @@ public:
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_mem_functor7( T_obj* _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(_A_obj) {}
+    : base_type_(_A_func),
+      obj_(*_A_obj)
+    {}
 
   /** Constructs a bound_mem_functor7 object that wraps the passed method.
    * @param _A_obj Reference to instance the method will operate on.
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_mem_functor7( T_obj& _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(&_A_obj) {}
+    : base_type_(_A_func),
+      obj_(_A_obj)
+    {}
 
   /** Execute the wrapped method operating on the stored instance.
    * @param _A_a1 Argument to be passed on to the method.
@@ -2219,13 +2274,15 @@ public:
    * @return The return value of the method invocation.
    */
   T_return operator()(typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2,typename type_trait<T_arg3>::take _A_a3,typename type_trait<T_arg4>::take _A_a4,typename type_trait<T_arg5>::take _A_a5,typename type_trait<T_arg6>::take _A_a6,typename type_trait<T_arg7>::take _A_a7) const
-    { return (obj_ptr_->*(this->func_ptr_))(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5,_A_a6,_A_a7); }
+    { return (obj_.invoke().*(this->func_ptr_))(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5,_A_a6,_A_a7); }
 
 //protected:
-  /// Pointer to stored object instance.
-   T_obj *obj_ptr_;
+  // Reference to stored object instance.
+  // This is the handler object, such as TheObject in void TheObject::signal_handler().
+  limit_reference<T_obj> obj_;
 };
 
+//template specialization of visit_each<>(action, functor):
 /** Performs a functor on each of the targets of a functor.
  * The function overload for sigc::bound_mem_functor performs a functor
  * on the object instance stored in the sigc::bound_mem_functor object.
@@ -2236,9 +2293,10 @@ template <class T_action, class T_return, class T_obj, class T_arg1,class T_arg2
 void visit_each(const T_action& _A_action,
                 const bound_mem_functor7<T_return, T_obj, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7>& _A_target)
 {
-  visit_each(_A_action, *_A_target.obj_ptr_);
+  sigc::visit_each(_A_action, _A_target.obj_);
 }
 
+
 /** bound_const_mem_functor0 encapsulates a const method with 0 arguments and an object instance.
  * Use the convenience function mem_fun() to create an instance of bound_const_mem_functor0.
  *
@@ -2261,26 +2319,32 @@ public:
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_const_mem_functor0(const T_obj* _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(_A_obj) {}
+    : base_type_(_A_func),
+      obj_(*_A_obj)
+    {}
 
   /** Constructs a bound_const_mem_functor0 object that wraps the passed method.
    * @param _A_obj Reference to instance the method will operate on.
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_const_mem_functor0(const T_obj& _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(&_A_obj) {}
+    : base_type_(_A_func),
+      obj_(_A_obj)
+    {}
 
   /** Execute the wrapped method operating on the stored instance.
    * @return The return value of the method invocation.
    */
   T_return operator()() const
-    { return (obj_ptr_->*(this->func_ptr_))(); }
+    { return (obj_.invoke().*(this->func_ptr_))(); }
 
 //protected:
-  /// Pointer to stored object instance.
-  const T_obj *obj_ptr_;
+  // Reference to stored object instance.
+  // This is the handler object, such as TheObject in void TheObject::signal_handler().
+  const_limit_reference<T_obj> obj_;
 };
 
+//template specialization of visit_each<>(action, functor):
 /** Performs a functor on each of the targets of a functor.
  * The function overload for sigc::bound_const_mem_functor performs a functor
  * on the object instance stored in the sigc::bound_const_mem_functor object.
@@ -2291,9 +2355,10 @@ template <class T_action, class T_return, class T_obj>
 void visit_each(const T_action& _A_action,
                 const bound_const_mem_functor0<T_return, T_obj>& _A_target)
 {
-  visit_each(_A_action, *_A_target.obj_ptr_);
+  sigc::visit_each(_A_action, _A_target.obj_);
 }
 
+
 /** bound_const_mem_functor1 encapsulates a const method with 1 arguments and an object instance.
  * Use the convenience function mem_fun() to create an instance of bound_const_mem_functor1.
  *
@@ -2317,27 +2382,33 @@ public:
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_const_mem_functor1(const T_obj* _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(_A_obj) {}
+    : base_type_(_A_func),
+      obj_(*_A_obj)
+    {}
 
   /** Constructs a bound_const_mem_functor1 object that wraps the passed method.
    * @param _A_obj Reference to instance the method will operate on.
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_const_mem_functor1(const T_obj& _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(&_A_obj) {}
+    : base_type_(_A_func),
+      obj_(_A_obj)
+    {}
 
   /** Execute the wrapped method operating on the stored instance.
    * @param _A_a1 Argument to be passed on to the method.
    * @return The return value of the method invocation.
    */
   T_return operator()(typename type_trait<T_arg1>::take _A_a1) const
-    { return (obj_ptr_->*(this->func_ptr_))(_A_a1); }
+    { return (obj_.invoke().*(this->func_ptr_))(_A_a1); }
 
 //protected:
-  /// Pointer to stored object instance.
-  const T_obj *obj_ptr_;
+  // Reference to stored object instance.
+  // This is the handler object, such as TheObject in void TheObject::signal_handler().
+  const_limit_reference<T_obj> obj_;
 };
 
+//template specialization of visit_each<>(action, functor):
 /** Performs a functor on each of the targets of a functor.
  * The function overload for sigc::bound_const_mem_functor performs a functor
  * on the object instance stored in the sigc::bound_const_mem_functor object.
@@ -2348,9 +2419,10 @@ template <class T_action, class T_return, class T_obj, class T_arg1>
 void visit_each(const T_action& _A_action,
                 const bound_const_mem_functor1<T_return, T_obj, T_arg1>& _A_target)
 {
-  visit_each(_A_action, *_A_target.obj_ptr_);
+  sigc::visit_each(_A_action, _A_target.obj_);
 }
 
+
 /** bound_const_mem_functor2 encapsulates a const method with 2 arguments and an object instance.
  * Use the convenience function mem_fun() to create an instance of bound_const_mem_functor2.
  *
@@ -2375,14 +2447,18 @@ public:
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_const_mem_functor2(const T_obj* _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(_A_obj) {}
+    : base_type_(_A_func),
+      obj_(*_A_obj)
+    {}
 
   /** Constructs a bound_const_mem_functor2 object that wraps the passed method.
    * @param _A_obj Reference to instance the method will operate on.
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_const_mem_functor2(const T_obj& _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(&_A_obj) {}
+    : base_type_(_A_func),
+      obj_(_A_obj)
+    {}
 
   /** Execute the wrapped method operating on the stored instance.
    * @param _A_a1 Argument to be passed on to the method.
@@ -2390,13 +2466,15 @@ public:
    * @return The return value of the method invocation.
    */
   T_return operator()(typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2) const
-    { return (obj_ptr_->*(this->func_ptr_))(_A_a1,_A_a2); }
+    { return (obj_.invoke().*(this->func_ptr_))(_A_a1,_A_a2); }
 
 //protected:
-  /// Pointer to stored object instance.
-  const T_obj *obj_ptr_;
+  // Reference to stored object instance.
+  // This is the handler object, such as TheObject in void TheObject::signal_handler().
+  const_limit_reference<T_obj> obj_;
 };
 
+//template specialization of visit_each<>(action, functor):
 /** Performs a functor on each of the targets of a functor.
  * The function overload for sigc::bound_const_mem_functor performs a functor
  * on the object instance stored in the sigc::bound_const_mem_functor object.
@@ -2407,9 +2485,10 @@ template <class T_action, class T_return, class T_obj, class T_arg1,class T_arg2
 void visit_each(const T_action& _A_action,
                 const bound_const_mem_functor2<T_return, T_obj, T_arg1,T_arg2>& _A_target)
 {
-  visit_each(_A_action, *_A_target.obj_ptr_);
+  sigc::visit_each(_A_action, _A_target.obj_);
 }
 
+
 /** bound_const_mem_functor3 encapsulates a const method with 3 arguments and an object instance.
  * Use the convenience function mem_fun() to create an instance of bound_const_mem_functor3.
  *
@@ -2435,14 +2514,18 @@ public:
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_const_mem_functor3(const T_obj* _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(_A_obj) {}
+    : base_type_(_A_func),
+      obj_(*_A_obj)
+    {}
 
   /** Constructs a bound_const_mem_functor3 object that wraps the passed method.
    * @param _A_obj Reference to instance the method will operate on.
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_const_mem_functor3(const T_obj& _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(&_A_obj) {}
+    : base_type_(_A_func),
+      obj_(_A_obj)
+    {}
 
   /** Execute the wrapped method operating on the stored instance.
    * @param _A_a1 Argument to be passed on to the method.
@@ -2451,13 +2534,15 @@ public:
    * @return The return value of the method invocation.
    */
   T_return operator()(typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2,typename type_trait<T_arg3>::take _A_a3) const
-    { return (obj_ptr_->*(this->func_ptr_))(_A_a1,_A_a2,_A_a3); }
+    { return (obj_.invoke().*(this->func_ptr_))(_A_a1,_A_a2,_A_a3); }
 
 //protected:
-  /// Pointer to stored object instance.
-  const T_obj *obj_ptr_;
+  // Reference to stored object instance.
+  // This is the handler object, such as TheObject in void TheObject::signal_handler().
+  const_limit_reference<T_obj> obj_;
 };
 
+//template specialization of visit_each<>(action, functor):
 /** Performs a functor on each of the targets of a functor.
  * The function overload for sigc::bound_const_mem_functor performs a functor
  * on the object instance stored in the sigc::bound_const_mem_functor object.
@@ -2468,9 +2553,10 @@ template <class T_action, class T_return, class T_obj, class T_arg1,class T_arg2
 void visit_each(const T_action& _A_action,
                 const bound_const_mem_functor3<T_return, T_obj, T_arg1,T_arg2,T_arg3>& _A_target)
 {
-  visit_each(_A_action, *_A_target.obj_ptr_);
+  sigc::visit_each(_A_action, _A_target.obj_);
 }
 
+
 /** bound_const_mem_functor4 encapsulates a const method with 4 arguments and an object instance.
  * Use the convenience function mem_fun() to create an instance of bound_const_mem_functor4.
  *
@@ -2497,14 +2583,18 @@ public:
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_const_mem_functor4(const T_obj* _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(_A_obj) {}
+    : base_type_(_A_func),
+      obj_(*_A_obj)
+    {}
 
   /** Constructs a bound_const_mem_functor4 object that wraps the passed method.
    * @param _A_obj Reference to instance the method will operate on.
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_const_mem_functor4(const T_obj& _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(&_A_obj) {}
+    : base_type_(_A_func),
+      obj_(_A_obj)
+    {}
 
   /** Execute the wrapped method operating on the stored instance.
    * @param _A_a1 Argument to be passed on to the method.
@@ -2514,13 +2604,15 @@ public:
    * @return The return value of the method invocation.
    */
   T_return operator()(typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2,typename type_trait<T_arg3>::take _A_a3,typename type_trait<T_arg4>::take _A_a4) const
-    { return (obj_ptr_->*(this->func_ptr_))(_A_a1,_A_a2,_A_a3,_A_a4); }
+    { return (obj_.invoke().*(this->func_ptr_))(_A_a1,_A_a2,_A_a3,_A_a4); }
 
 //protected:
-  /// Pointer to stored object instance.
-  const T_obj *obj_ptr_;
+  // Reference to stored object instance.
+  // This is the handler object, such as TheObject in void TheObject::signal_handler().
+  const_limit_reference<T_obj> obj_;
 };
 
+//template specialization of visit_each<>(action, functor):
 /** Performs a functor on each of the targets of a functor.
  * The function overload for sigc::bound_const_mem_functor performs a functor
  * on the object instance stored in the sigc::bound_const_mem_functor object.
@@ -2531,9 +2623,10 @@ template <class T_action, class T_return, class T_obj, class T_arg1,class T_arg2
 void visit_each(const T_action& _A_action,
                 const bound_const_mem_functor4<T_return, T_obj, T_arg1,T_arg2,T_arg3,T_arg4>& _A_target)
 {
-  visit_each(_A_action, *_A_target.obj_ptr_);
+  sigc::visit_each(_A_action, _A_target.obj_);
 }
 
+
 /** bound_const_mem_functor5 encapsulates a const method with 5 arguments and an object instance.
  * Use the convenience function mem_fun() to create an instance of bound_const_mem_functor5.
  *
@@ -2561,14 +2654,18 @@ public:
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_const_mem_functor5(const T_obj* _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(_A_obj) {}
+    : base_type_(_A_func),
+      obj_(*_A_obj)
+    {}
 
   /** Constructs a bound_const_mem_functor5 object that wraps the passed method.
    * @param _A_obj Reference to instance the method will operate on.
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_const_mem_functor5(const T_obj& _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(&_A_obj) {}
+    : base_type_(_A_func),
+      obj_(_A_obj)
+    {}
 
   /** Execute the wrapped method operating on the stored instance.
    * @param _A_a1 Argument to be passed on to the method.
@@ -2579,13 +2676,15 @@ public:
    * @return The return value of the method invocation.
    */
   T_return operator()(typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2,typename type_trait<T_arg3>::take _A_a3,typename type_trait<T_arg4>::take _A_a4,typename type_trait<T_arg5>::take _A_a5) const
-    { return (obj_ptr_->*(this->func_ptr_))(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5); }
+    { return (obj_.invoke().*(this->func_ptr_))(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5); }
 
 //protected:
-  /// Pointer to stored object instance.
-  const T_obj *obj_ptr_;
+  // Reference to stored object instance.
+  // This is the handler object, such as TheObject in void TheObject::signal_handler().
+  const_limit_reference<T_obj> obj_;
 };
 
+//template specialization of visit_each<>(action, functor):
 /** Performs a functor on each of the targets of a functor.
  * The function overload for sigc::bound_const_mem_functor performs a functor
  * on the object instance stored in the sigc::bound_const_mem_functor object.
@@ -2596,9 +2695,10 @@ template <class T_action, class T_return, class T_obj, class T_arg1,class T_arg2
 void visit_each(const T_action& _A_action,
                 const bound_const_mem_functor5<T_return, T_obj, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5>& _A_target)
 {
-  visit_each(_A_action, *_A_target.obj_ptr_);
+  sigc::visit_each(_A_action, _A_target.obj_);
 }
 
+
 /** bound_const_mem_functor6 encapsulates a const method with 6 arguments and an object instance.
  * Use the convenience function mem_fun() to create an instance of bound_const_mem_functor6.
  *
@@ -2627,14 +2727,18 @@ public:
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_const_mem_functor6(const T_obj* _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(_A_obj) {}
+    : base_type_(_A_func),
+      obj_(*_A_obj)
+    {}
 
   /** Constructs a bound_const_mem_functor6 object that wraps the passed method.
    * @param _A_obj Reference to instance the method will operate on.
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_const_mem_functor6(const T_obj& _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(&_A_obj) {}
+    : base_type_(_A_func),
+      obj_(_A_obj)
+    {}
 
   /** Execute the wrapped method operating on the stored instance.
    * @param _A_a1 Argument to be passed on to the method.
@@ -2646,13 +2750,15 @@ public:
    * @return The return value of the method invocation.
    */
   T_return operator()(typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2,typename type_trait<T_arg3>::take _A_a3,typename type_trait<T_arg4>::take _A_a4,typename type_trait<T_arg5>::take _A_a5,typename type_trait<T_arg6>::take _A_a6) const
-    { return (obj_ptr_->*(this->func_ptr_))(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5,_A_a6); }
+    { return (obj_.invoke().*(this->func_ptr_))(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5,_A_a6); }
 
 //protected:
-  /// Pointer to stored object instance.
-  const T_obj *obj_ptr_;
+  // Reference to stored object instance.
+  // This is the handler object, such as TheObject in void TheObject::signal_handler().
+  const_limit_reference<T_obj> obj_;
 };
 
+//template specialization of visit_each<>(action, functor):
 /** Performs a functor on each of the targets of a functor.
  * The function overload for sigc::bound_const_mem_functor performs a functor
  * on the object instance stored in the sigc::bound_const_mem_functor object.
@@ -2663,9 +2769,10 @@ template <class T_action, class T_return, class T_obj, class T_arg1,class T_arg2
 void visit_each(const T_action& _A_action,
                 const bound_const_mem_functor6<T_return, T_obj, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6>& _A_target)
 {
-  visit_each(_A_action, *_A_target.obj_ptr_);
+  sigc::visit_each(_A_action, _A_target.obj_);
 }
 
+
 /** bound_const_mem_functor7 encapsulates a const method with 7 arguments and an object instance.
  * Use the convenience function mem_fun() to create an instance of bound_const_mem_functor7.
  *
@@ -2695,14 +2802,18 @@ public:
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_const_mem_functor7(const T_obj* _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(_A_obj) {}
+    : base_type_(_A_func),
+      obj_(*_A_obj)
+    {}
 
   /** Constructs a bound_const_mem_functor7 object that wraps the passed method.
    * @param _A_obj Reference to instance the method will operate on.
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_const_mem_functor7(const T_obj& _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(&_A_obj) {}
+    : base_type_(_A_func),
+      obj_(_A_obj)
+    {}
 
   /** Execute the wrapped method operating on the stored instance.
    * @param _A_a1 Argument to be passed on to the method.
@@ -2715,13 +2826,15 @@ public:
    * @return The return value of the method invocation.
    */
   T_return operator()(typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2,typename type_trait<T_arg3>::take _A_a3,typename type_trait<T_arg4>::take _A_a4,typename type_trait<T_arg5>::take _A_a5,typename type_trait<T_arg6>::take _A_a6,typename type_trait<T_arg7>::take _A_a7) const
-    { return (obj_ptr_->*(this->func_ptr_))(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5,_A_a6,_A_a7); }
+    { return (obj_.invoke().*(this->func_ptr_))(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5,_A_a6,_A_a7); }
 
 //protected:
-  /// Pointer to stored object instance.
-  const T_obj *obj_ptr_;
+  // Reference to stored object instance.
+  // This is the handler object, such as TheObject in void TheObject::signal_handler().
+  const_limit_reference<T_obj> obj_;
 };
 
+//template specialization of visit_each<>(action, functor):
 /** Performs a functor on each of the targets of a functor.
  * The function overload for sigc::bound_const_mem_functor performs a functor
  * on the object instance stored in the sigc::bound_const_mem_functor object.
@@ -2732,9 +2845,10 @@ template <class T_action, class T_return, class T_obj, class T_arg1,class T_arg2
 void visit_each(const T_action& _A_action,
                 const bound_const_mem_functor7<T_return, T_obj, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7>& _A_target)
 {
-  visit_each(_A_action, *_A_target.obj_ptr_);
+  sigc::visit_each(_A_action, _A_target.obj_);
 }
 
+
 /** bound_volatile_mem_functor0 encapsulates a volatile method with 0 arguments and an object instance.
  * Use the convenience function mem_fun() to create an instance of bound_volatile_mem_functor0.
  *
@@ -2757,26 +2871,32 @@ public:
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_volatile_mem_functor0( T_obj* _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(_A_obj) {}
+    : base_type_(_A_func),
+      obj_(*_A_obj)
+    {}
 
   /** Constructs a bound_volatile_mem_functor0 object that wraps the passed method.
    * @param _A_obj Reference to instance the method will operate on.
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_volatile_mem_functor0( T_obj& _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(&_A_obj) {}
+    : base_type_(_A_func),
+      obj_(_A_obj)
+    {}
 
   /** Execute the wrapped method operating on the stored instance.
    * @return The return value of the method invocation.
    */
   T_return operator()() const
-    { return (obj_ptr_->*(this->func_ptr_))(); }
+    { return (obj_.invoke().*(this->func_ptr_))(); }
 
 //protected:
-  /// Pointer to stored object instance.
-   T_obj *obj_ptr_;
+  // Reference to stored object instance.
+  // This is the handler object, such as TheObject in void TheObject::signal_handler().
+  volatile_limit_reference<T_obj> obj_;
 };
 
+//template specialization of visit_each<>(action, functor):
 /** Performs a functor on each of the targets of a functor.
  * The function overload for sigc::bound_volatile_mem_functor performs a functor
  * on the object instance stored in the sigc::bound_volatile_mem_functor object.
@@ -2787,9 +2907,10 @@ template <class T_action, class T_return, class T_obj>
 void visit_each(const T_action& _A_action,
                 const bound_volatile_mem_functor0<T_return, T_obj>& _A_target)
 {
-  visit_each(_A_action, *_A_target.obj_ptr_);
+  sigc::visit_each(_A_action, _A_target.obj_);
 }
 
+
 /** bound_volatile_mem_functor1 encapsulates a volatile method with 1 arguments and an object instance.
  * Use the convenience function mem_fun() to create an instance of bound_volatile_mem_functor1.
  *
@@ -2813,27 +2934,33 @@ public:
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_volatile_mem_functor1( T_obj* _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(_A_obj) {}
+    : base_type_(_A_func),
+      obj_(*_A_obj)
+    {}
 
   /** Constructs a bound_volatile_mem_functor1 object that wraps the passed method.
    * @param _A_obj Reference to instance the method will operate on.
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_volatile_mem_functor1( T_obj& _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(&_A_obj) {}
+    : base_type_(_A_func),
+      obj_(_A_obj)
+    {}
 
   /** Execute the wrapped method operating on the stored instance.
    * @param _A_a1 Argument to be passed on to the method.
    * @return The return value of the method invocation.
    */
   T_return operator()(typename type_trait<T_arg1>::take _A_a1) const
-    { return (obj_ptr_->*(this->func_ptr_))(_A_a1); }
+    { return (obj_.invoke().*(this->func_ptr_))(_A_a1); }
 
 //protected:
-  /// Pointer to stored object instance.
-   T_obj *obj_ptr_;
+  // Reference to stored object instance.
+  // This is the handler object, such as TheObject in void TheObject::signal_handler().
+  volatile_limit_reference<T_obj> obj_;
 };
 
+//template specialization of visit_each<>(action, functor):
 /** Performs a functor on each of the targets of a functor.
  * The function overload for sigc::bound_volatile_mem_functor performs a functor
  * on the object instance stored in the sigc::bound_volatile_mem_functor object.
@@ -2844,9 +2971,10 @@ template <class T_action, class T_return, class T_obj, class T_arg1>
 void visit_each(const T_action& _A_action,
                 const bound_volatile_mem_functor1<T_return, T_obj, T_arg1>& _A_target)
 {
-  visit_each(_A_action, *_A_target.obj_ptr_);
+  sigc::visit_each(_A_action, _A_target.obj_);
 }
 
+
 /** bound_volatile_mem_functor2 encapsulates a volatile method with 2 arguments and an object instance.
  * Use the convenience function mem_fun() to create an instance of bound_volatile_mem_functor2.
  *
@@ -2871,14 +2999,18 @@ public:
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_volatile_mem_functor2( T_obj* _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(_A_obj) {}
+    : base_type_(_A_func),
+      obj_(*_A_obj)
+    {}
 
   /** Constructs a bound_volatile_mem_functor2 object that wraps the passed method.
    * @param _A_obj Reference to instance the method will operate on.
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_volatile_mem_functor2( T_obj& _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(&_A_obj) {}
+    : base_type_(_A_func),
+      obj_(_A_obj)
+    {}
 
   /** Execute the wrapped method operating on the stored instance.
    * @param _A_a1 Argument to be passed on to the method.
@@ -2886,13 +3018,15 @@ public:
    * @return The return value of the method invocation.
    */
   T_return operator()(typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2) const
-    { return (obj_ptr_->*(this->func_ptr_))(_A_a1,_A_a2); }
+    { return (obj_.invoke().*(this->func_ptr_))(_A_a1,_A_a2); }
 
 //protected:
-  /// Pointer to stored object instance.
-   T_obj *obj_ptr_;
+  // Reference to stored object instance.
+  // This is the handler object, such as TheObject in void TheObject::signal_handler().
+  volatile_limit_reference<T_obj> obj_;
 };
 
+//template specialization of visit_each<>(action, functor):
 /** Performs a functor on each of the targets of a functor.
  * The function overload for sigc::bound_volatile_mem_functor performs a functor
  * on the object instance stored in the sigc::bound_volatile_mem_functor object.
@@ -2903,9 +3037,10 @@ template <class T_action, class T_return, class T_obj, class T_arg1,class T_arg2
 void visit_each(const T_action& _A_action,
                 const bound_volatile_mem_functor2<T_return, T_obj, T_arg1,T_arg2>& _A_target)
 {
-  visit_each(_A_action, *_A_target.obj_ptr_);
+  sigc::visit_each(_A_action, _A_target.obj_);
 }
 
+
 /** bound_volatile_mem_functor3 encapsulates a volatile method with 3 arguments and an object instance.
  * Use the convenience function mem_fun() to create an instance of bound_volatile_mem_functor3.
  *
@@ -2931,14 +3066,18 @@ public:
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_volatile_mem_functor3( T_obj* _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(_A_obj) {}
+    : base_type_(_A_func),
+      obj_(*_A_obj)
+    {}
 
   /** Constructs a bound_volatile_mem_functor3 object that wraps the passed method.
    * @param _A_obj Reference to instance the method will operate on.
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_volatile_mem_functor3( T_obj& _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(&_A_obj) {}
+    : base_type_(_A_func),
+      obj_(_A_obj)
+    {}
 
   /** Execute the wrapped method operating on the stored instance.
    * @param _A_a1 Argument to be passed on to the method.
@@ -2947,13 +3086,15 @@ public:
    * @return The return value of the method invocation.
    */
   T_return operator()(typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2,typename type_trait<T_arg3>::take _A_a3) const
-    { return (obj_ptr_->*(this->func_ptr_))(_A_a1,_A_a2,_A_a3); }
+    { return (obj_.invoke().*(this->func_ptr_))(_A_a1,_A_a2,_A_a3); }
 
 //protected:
-  /// Pointer to stored object instance.
-   T_obj *obj_ptr_;
+  // Reference to stored object instance.
+  // This is the handler object, such as TheObject in void TheObject::signal_handler().
+  volatile_limit_reference<T_obj> obj_;
 };
 
+//template specialization of visit_each<>(action, functor):
 /** Performs a functor on each of the targets of a functor.
  * The function overload for sigc::bound_volatile_mem_functor performs a functor
  * on the object instance stored in the sigc::bound_volatile_mem_functor object.
@@ -2964,9 +3105,10 @@ template <class T_action, class T_return, class T_obj, class T_arg1,class T_arg2
 void visit_each(const T_action& _A_action,
                 const bound_volatile_mem_functor3<T_return, T_obj, T_arg1,T_arg2,T_arg3>& _A_target)
 {
-  visit_each(_A_action, *_A_target.obj_ptr_);
+  sigc::visit_each(_A_action, _A_target.obj_);
 }
 
+
 /** bound_volatile_mem_functor4 encapsulates a volatile method with 4 arguments and an object instance.
  * Use the convenience function mem_fun() to create an instance of bound_volatile_mem_functor4.
  *
@@ -2993,14 +3135,18 @@ public:
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_volatile_mem_functor4( T_obj* _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(_A_obj) {}
+    : base_type_(_A_func),
+      obj_(*_A_obj)
+    {}
 
   /** Constructs a bound_volatile_mem_functor4 object that wraps the passed method.
    * @param _A_obj Reference to instance the method will operate on.
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_volatile_mem_functor4( T_obj& _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(&_A_obj) {}
+    : base_type_(_A_func),
+      obj_(_A_obj)
+    {}
 
   /** Execute the wrapped method operating on the stored instance.
    * @param _A_a1 Argument to be passed on to the method.
@@ -3010,13 +3156,15 @@ public:
    * @return The return value of the method invocation.
    */
   T_return operator()(typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2,typename type_trait<T_arg3>::take _A_a3,typename type_trait<T_arg4>::take _A_a4) const
-    { return (obj_ptr_->*(this->func_ptr_))(_A_a1,_A_a2,_A_a3,_A_a4); }
+    { return (obj_.invoke().*(this->func_ptr_))(_A_a1,_A_a2,_A_a3,_A_a4); }
 
 //protected:
-  /// Pointer to stored object instance.
-   T_obj *obj_ptr_;
+  // Reference to stored object instance.
+  // This is the handler object, such as TheObject in void TheObject::signal_handler().
+  volatile_limit_reference<T_obj> obj_;
 };
 
+//template specialization of visit_each<>(action, functor):
 /** Performs a functor on each of the targets of a functor.
  * The function overload for sigc::bound_volatile_mem_functor performs a functor
  * on the object instance stored in the sigc::bound_volatile_mem_functor object.
@@ -3027,9 +3175,10 @@ template <class T_action, class T_return, class T_obj, class T_arg1,class T_arg2
 void visit_each(const T_action& _A_action,
                 const bound_volatile_mem_functor4<T_return, T_obj, T_arg1,T_arg2,T_arg3,T_arg4>& _A_target)
 {
-  visit_each(_A_action, *_A_target.obj_ptr_);
+  sigc::visit_each(_A_action, _A_target.obj_);
 }
 
+
 /** bound_volatile_mem_functor5 encapsulates a volatile method with 5 arguments and an object instance.
  * Use the convenience function mem_fun() to create an instance of bound_volatile_mem_functor5.
  *
@@ -3057,14 +3206,18 @@ public:
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_volatile_mem_functor5( T_obj* _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(_A_obj) {}
+    : base_type_(_A_func),
+      obj_(*_A_obj)
+    {}
 
   /** Constructs a bound_volatile_mem_functor5 object that wraps the passed method.
    * @param _A_obj Reference to instance the method will operate on.
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_volatile_mem_functor5( T_obj& _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(&_A_obj) {}
+    : base_type_(_A_func),
+      obj_(_A_obj)
+    {}
 
   /** Execute the wrapped method operating on the stored instance.
    * @param _A_a1 Argument to be passed on to the method.
@@ -3075,13 +3228,15 @@ public:
    * @return The return value of the method invocation.
    */
   T_return operator()(typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2,typename type_trait<T_arg3>::take _A_a3,typename type_trait<T_arg4>::take _A_a4,typename type_trait<T_arg5>::take _A_a5) const
-    { return (obj_ptr_->*(this->func_ptr_))(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5); }
+    { return (obj_.invoke().*(this->func_ptr_))(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5); }
 
 //protected:
-  /// Pointer to stored object instance.
-   T_obj *obj_ptr_;
+  // Reference to stored object instance.
+  // This is the handler object, such as TheObject in void TheObject::signal_handler().
+  volatile_limit_reference<T_obj> obj_;
 };
 
+//template specialization of visit_each<>(action, functor):
 /** Performs a functor on each of the targets of a functor.
  * The function overload for sigc::bound_volatile_mem_functor performs a functor
  * on the object instance stored in the sigc::bound_volatile_mem_functor object.
@@ -3092,9 +3247,10 @@ template <class T_action, class T_return, class T_obj, class T_arg1,class T_arg2
 void visit_each(const T_action& _A_action,
                 const bound_volatile_mem_functor5<T_return, T_obj, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5>& _A_target)
 {
-  visit_each(_A_action, *_A_target.obj_ptr_);
+  sigc::visit_each(_A_action, _A_target.obj_);
 }
 
+
 /** bound_volatile_mem_functor6 encapsulates a volatile method with 6 arguments and an object instance.
  * Use the convenience function mem_fun() to create an instance of bound_volatile_mem_functor6.
  *
@@ -3123,14 +3279,18 @@ public:
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_volatile_mem_functor6( T_obj* _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(_A_obj) {}
+    : base_type_(_A_func),
+      obj_(*_A_obj)
+    {}
 
   /** Constructs a bound_volatile_mem_functor6 object that wraps the passed method.
    * @param _A_obj Reference to instance the method will operate on.
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_volatile_mem_functor6( T_obj& _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(&_A_obj) {}
+    : base_type_(_A_func),
+      obj_(_A_obj)
+    {}
 
   /** Execute the wrapped method operating on the stored instance.
    * @param _A_a1 Argument to be passed on to the method.
@@ -3142,13 +3302,15 @@ public:
    * @return The return value of the method invocation.
    */
   T_return operator()(typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2,typename type_trait<T_arg3>::take _A_a3,typename type_trait<T_arg4>::take _A_a4,typename type_trait<T_arg5>::take _A_a5,typename type_trait<T_arg6>::take _A_a6) const
-    { return (obj_ptr_->*(this->func_ptr_))(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5,_A_a6); }
+    { return (obj_.invoke().*(this->func_ptr_))(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5,_A_a6); }
 
 //protected:
-  /// Pointer to stored object instance.
-   T_obj *obj_ptr_;
+  // Reference to stored object instance.
+  // This is the handler object, such as TheObject in void TheObject::signal_handler().
+  volatile_limit_reference<T_obj> obj_;
 };
 
+//template specialization of visit_each<>(action, functor):
 /** Performs a functor on each of the targets of a functor.
  * The function overload for sigc::bound_volatile_mem_functor performs a functor
  * on the object instance stored in the sigc::bound_volatile_mem_functor object.
@@ -3159,9 +3321,10 @@ template <class T_action, class T_return, class T_obj, class T_arg1,class T_arg2
 void visit_each(const T_action& _A_action,
                 const bound_volatile_mem_functor6<T_return, T_obj, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6>& _A_target)
 {
-  visit_each(_A_action, *_A_target.obj_ptr_);
+  sigc::visit_each(_A_action, _A_target.obj_);
 }
 
+
 /** bound_volatile_mem_functor7 encapsulates a volatile method with 7 arguments and an object instance.
  * Use the convenience function mem_fun() to create an instance of bound_volatile_mem_functor7.
  *
@@ -3191,14 +3354,18 @@ public:
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_volatile_mem_functor7( T_obj* _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(_A_obj) {}
+    : base_type_(_A_func),
+      obj_(*_A_obj)
+    {}
 
   /** Constructs a bound_volatile_mem_functor7 object that wraps the passed method.
    * @param _A_obj Reference to instance the method will operate on.
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_volatile_mem_functor7( T_obj& _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(&_A_obj) {}
+    : base_type_(_A_func),
+      obj_(_A_obj)
+    {}
 
   /** Execute the wrapped method operating on the stored instance.
    * @param _A_a1 Argument to be passed on to the method.
@@ -3211,13 +3378,15 @@ public:
    * @return The return value of the method invocation.
    */
   T_return operator()(typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2,typename type_trait<T_arg3>::take _A_a3,typename type_trait<T_arg4>::take _A_a4,typename type_trait<T_arg5>::take _A_a5,typename type_trait<T_arg6>::take _A_a6,typename type_trait<T_arg7>::take _A_a7) const
-    { return (obj_ptr_->*(this->func_ptr_))(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5,_A_a6,_A_a7); }
+    { return (obj_.invoke().*(this->func_ptr_))(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5,_A_a6,_A_a7); }
 
 //protected:
-  /// Pointer to stored object instance.
-   T_obj *obj_ptr_;
+  // Reference to stored object instance.
+  // This is the handler object, such as TheObject in void TheObject::signal_handler().
+  volatile_limit_reference<T_obj> obj_;
 };
 
+//template specialization of visit_each<>(action, functor):
 /** Performs a functor on each of the targets of a functor.
  * The function overload for sigc::bound_volatile_mem_functor performs a functor
  * on the object instance stored in the sigc::bound_volatile_mem_functor object.
@@ -3228,9 +3397,10 @@ template <class T_action, class T_return, class T_obj, class T_arg1,class T_arg2
 void visit_each(const T_action& _A_action,
                 const bound_volatile_mem_functor7<T_return, T_obj, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7>& _A_target)
 {
-  visit_each(_A_action, *_A_target.obj_ptr_);
+  sigc::visit_each(_A_action, _A_target.obj_);
 }
 
+
 /** bound_const_volatile_mem_functor0 encapsulates a const volatile method with 0 arguments and an object instance.
  * Use the convenience function mem_fun() to create an instance of bound_const_volatile_mem_functor0.
  *
@@ -3253,26 +3423,32 @@ public:
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_const_volatile_mem_functor0(const T_obj* _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(_A_obj) {}
+    : base_type_(_A_func),
+      obj_(*_A_obj)
+    {}
 
   /** Constructs a bound_const_volatile_mem_functor0 object that wraps the passed method.
    * @param _A_obj Reference to instance the method will operate on.
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_const_volatile_mem_functor0(const T_obj& _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(&_A_obj) {}
+    : base_type_(_A_func),
+      obj_(_A_obj)
+    {}
 
   /** Execute the wrapped method operating on the stored instance.
    * @return The return value of the method invocation.
    */
   T_return operator()() const
-    { return (obj_ptr_->*(this->func_ptr_))(); }
+    { return (obj_.invoke().*(this->func_ptr_))(); }
 
 //protected:
-  /// Pointer to stored object instance.
-  const T_obj *obj_ptr_;
+  // Reference to stored object instance.
+  // This is the handler object, such as TheObject in void TheObject::signal_handler().
+  const_volatile_limit_reference<T_obj> obj_;
 };
 
+//template specialization of visit_each<>(action, functor):
 /** Performs a functor on each of the targets of a functor.
  * The function overload for sigc::bound_const_volatile_mem_functor performs a functor
  * on the object instance stored in the sigc::bound_const_volatile_mem_functor object.
@@ -3283,9 +3459,10 @@ template <class T_action, class T_return, class T_obj>
 void visit_each(const T_action& _A_action,
                 const bound_const_volatile_mem_functor0<T_return, T_obj>& _A_target)
 {
-  visit_each(_A_action, *_A_target.obj_ptr_);
+  sigc::visit_each(_A_action, _A_target.obj_);
 }
 
+
 /** bound_const_volatile_mem_functor1 encapsulates a const volatile method with 1 arguments and an object instance.
  * Use the convenience function mem_fun() to create an instance of bound_const_volatile_mem_functor1.
  *
@@ -3309,27 +3486,33 @@ public:
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_const_volatile_mem_functor1(const T_obj* _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(_A_obj) {}
+    : base_type_(_A_func),
+      obj_(*_A_obj)
+    {}
 
   /** Constructs a bound_const_volatile_mem_functor1 object that wraps the passed method.
    * @param _A_obj Reference to instance the method will operate on.
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_const_volatile_mem_functor1(const T_obj& _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(&_A_obj) {}
+    : base_type_(_A_func),
+      obj_(_A_obj)
+    {}
 
   /** Execute the wrapped method operating on the stored instance.
    * @param _A_a1 Argument to be passed on to the method.
    * @return The return value of the method invocation.
    */
   T_return operator()(typename type_trait<T_arg1>::take _A_a1) const
-    { return (obj_ptr_->*(this->func_ptr_))(_A_a1); }
+    { return (obj_.invoke().*(this->func_ptr_))(_A_a1); }
 
 //protected:
-  /// Pointer to stored object instance.
-  const T_obj *obj_ptr_;
+  // Reference to stored object instance.
+  // This is the handler object, such as TheObject in void TheObject::signal_handler().
+  const_volatile_limit_reference<T_obj> obj_;
 };
 
+//template specialization of visit_each<>(action, functor):
 /** Performs a functor on each of the targets of a functor.
  * The function overload for sigc::bound_const_volatile_mem_functor performs a functor
  * on the object instance stored in the sigc::bound_const_volatile_mem_functor object.
@@ -3340,9 +3523,10 @@ template <class T_action, class T_return, class T_obj, class T_arg1>
 void visit_each(const T_action& _A_action,
                 const bound_const_volatile_mem_functor1<T_return, T_obj, T_arg1>& _A_target)
 {
-  visit_each(_A_action, *_A_target.obj_ptr_);
+  sigc::visit_each(_A_action, _A_target.obj_);
 }
 
+
 /** bound_const_volatile_mem_functor2 encapsulates a const volatile method with 2 arguments and an object instance.
  * Use the convenience function mem_fun() to create an instance of bound_const_volatile_mem_functor2.
  *
@@ -3367,14 +3551,18 @@ public:
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_const_volatile_mem_functor2(const T_obj* _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(_A_obj) {}
+    : base_type_(_A_func),
+      obj_(*_A_obj)
+    {}
 
   /** Constructs a bound_const_volatile_mem_functor2 object that wraps the passed method.
    * @param _A_obj Reference to instance the method will operate on.
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_const_volatile_mem_functor2(const T_obj& _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(&_A_obj) {}
+    : base_type_(_A_func),
+      obj_(_A_obj)
+    {}
 
   /** Execute the wrapped method operating on the stored instance.
    * @param _A_a1 Argument to be passed on to the method.
@@ -3382,13 +3570,15 @@ public:
    * @return The return value of the method invocation.
    */
   T_return operator()(typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2) const
-    { return (obj_ptr_->*(this->func_ptr_))(_A_a1,_A_a2); }
+    { return (obj_.invoke().*(this->func_ptr_))(_A_a1,_A_a2); }
 
 //protected:
-  /// Pointer to stored object instance.
-  const T_obj *obj_ptr_;
+  // Reference to stored object instance.
+  // This is the handler object, such as TheObject in void TheObject::signal_handler().
+  const_volatile_limit_reference<T_obj> obj_;
 };
 
+//template specialization of visit_each<>(action, functor):
 /** Performs a functor on each of the targets of a functor.
  * The function overload for sigc::bound_const_volatile_mem_functor performs a functor
  * on the object instance stored in the sigc::bound_const_volatile_mem_functor object.
@@ -3399,9 +3589,10 @@ template <class T_action, class T_return, class T_obj, class T_arg1,class T_arg2
 void visit_each(const T_action& _A_action,
                 const bound_const_volatile_mem_functor2<T_return, T_obj, T_arg1,T_arg2>& _A_target)
 {
-  visit_each(_A_action, *_A_target.obj_ptr_);
+  sigc::visit_each(_A_action, _A_target.obj_);
 }
 
+
 /** bound_const_volatile_mem_functor3 encapsulates a const volatile method with 3 arguments and an object instance.
  * Use the convenience function mem_fun() to create an instance of bound_const_volatile_mem_functor3.
  *
@@ -3427,14 +3618,18 @@ public:
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_const_volatile_mem_functor3(const T_obj* _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(_A_obj) {}
+    : base_type_(_A_func),
+      obj_(*_A_obj)
+    {}
 
   /** Constructs a bound_const_volatile_mem_functor3 object that wraps the passed method.
    * @param _A_obj Reference to instance the method will operate on.
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_const_volatile_mem_functor3(const T_obj& _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(&_A_obj) {}
+    : base_type_(_A_func),
+      obj_(_A_obj)
+    {}
 
   /** Execute the wrapped method operating on the stored instance.
    * @param _A_a1 Argument to be passed on to the method.
@@ -3443,13 +3638,15 @@ public:
    * @return The return value of the method invocation.
    */
   T_return operator()(typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2,typename type_trait<T_arg3>::take _A_a3) const
-    { return (obj_ptr_->*(this->func_ptr_))(_A_a1,_A_a2,_A_a3); }
+    { return (obj_.invoke().*(this->func_ptr_))(_A_a1,_A_a2,_A_a3); }
 
 //protected:
-  /// Pointer to stored object instance.
-  const T_obj *obj_ptr_;
+  // Reference to stored object instance.
+  // This is the handler object, such as TheObject in void TheObject::signal_handler().
+  const_volatile_limit_reference<T_obj> obj_;
 };
 
+//template specialization of visit_each<>(action, functor):
 /** Performs a functor on each of the targets of a functor.
  * The function overload for sigc::bound_const_volatile_mem_functor performs a functor
  * on the object instance stored in the sigc::bound_const_volatile_mem_functor object.
@@ -3460,9 +3657,10 @@ template <class T_action, class T_return, class T_obj, class T_arg1,class T_arg2
 void visit_each(const T_action& _A_action,
                 const bound_const_volatile_mem_functor3<T_return, T_obj, T_arg1,T_arg2,T_arg3>& _A_target)
 {
-  visit_each(_A_action, *_A_target.obj_ptr_);
+  sigc::visit_each(_A_action, _A_target.obj_);
 }
 
+
 /** bound_const_volatile_mem_functor4 encapsulates a const volatile method with 4 arguments and an object instance.
  * Use the convenience function mem_fun() to create an instance of bound_const_volatile_mem_functor4.
  *
@@ -3489,14 +3687,18 @@ public:
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_const_volatile_mem_functor4(const T_obj* _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(_A_obj) {}
+    : base_type_(_A_func),
+      obj_(*_A_obj)
+    {}
 
   /** Constructs a bound_const_volatile_mem_functor4 object that wraps the passed method.
    * @param _A_obj Reference to instance the method will operate on.
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_const_volatile_mem_functor4(const T_obj& _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(&_A_obj) {}
+    : base_type_(_A_func),
+      obj_(_A_obj)
+    {}
 
   /** Execute the wrapped method operating on the stored instance.
    * @param _A_a1 Argument to be passed on to the method.
@@ -3506,13 +3708,15 @@ public:
    * @return The return value of the method invocation.
    */
   T_return operator()(typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2,typename type_trait<T_arg3>::take _A_a3,typename type_trait<T_arg4>::take _A_a4) const
-    { return (obj_ptr_->*(this->func_ptr_))(_A_a1,_A_a2,_A_a3,_A_a4); }
+    { return (obj_.invoke().*(this->func_ptr_))(_A_a1,_A_a2,_A_a3,_A_a4); }
 
 //protected:
-  /// Pointer to stored object instance.
-  const T_obj *obj_ptr_;
+  // Reference to stored object instance.
+  // This is the handler object, such as TheObject in void TheObject::signal_handler().
+  const_volatile_limit_reference<T_obj> obj_;
 };
 
+//template specialization of visit_each<>(action, functor):
 /** Performs a functor on each of the targets of a functor.
  * The function overload for sigc::bound_const_volatile_mem_functor performs a functor
  * on the object instance stored in the sigc::bound_const_volatile_mem_functor object.
@@ -3523,9 +3727,10 @@ template <class T_action, class T_return, class T_obj, class T_arg1,class T_arg2
 void visit_each(const T_action& _A_action,
                 const bound_const_volatile_mem_functor4<T_return, T_obj, T_arg1,T_arg2,T_arg3,T_arg4>& _A_target)
 {
-  visit_each(_A_action, *_A_target.obj_ptr_);
+  sigc::visit_each(_A_action, _A_target.obj_);
 }
 
+
 /** bound_const_volatile_mem_functor5 encapsulates a const volatile method with 5 arguments and an object instance.
  * Use the convenience function mem_fun() to create an instance of bound_const_volatile_mem_functor5.
  *
@@ -3553,14 +3758,18 @@ public:
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_const_volatile_mem_functor5(const T_obj* _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(_A_obj) {}
+    : base_type_(_A_func),
+      obj_(*_A_obj)
+    {}
 
   /** Constructs a bound_const_volatile_mem_functor5 object that wraps the passed method.
    * @param _A_obj Reference to instance the method will operate on.
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_const_volatile_mem_functor5(const T_obj& _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(&_A_obj) {}
+    : base_type_(_A_func),
+      obj_(_A_obj)
+    {}
 
   /** Execute the wrapped method operating on the stored instance.
    * @param _A_a1 Argument to be passed on to the method.
@@ -3571,13 +3780,15 @@ public:
    * @return The return value of the method invocation.
    */
   T_return operator()(typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2,typename type_trait<T_arg3>::take _A_a3,typename type_trait<T_arg4>::take _A_a4,typename type_trait<T_arg5>::take _A_a5) const
-    { return (obj_ptr_->*(this->func_ptr_))(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5); }
+    { return (obj_.invoke().*(this->func_ptr_))(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5); }
 
 //protected:
-  /// Pointer to stored object instance.
-  const T_obj *obj_ptr_;
+  // Reference to stored object instance.
+  // This is the handler object, such as TheObject in void TheObject::signal_handler().
+  const_volatile_limit_reference<T_obj> obj_;
 };
 
+//template specialization of visit_each<>(action, functor):
 /** Performs a functor on each of the targets of a functor.
  * The function overload for sigc::bound_const_volatile_mem_functor performs a functor
  * on the object instance stored in the sigc::bound_const_volatile_mem_functor object.
@@ -3588,9 +3799,10 @@ template <class T_action, class T_return, class T_obj, class T_arg1,class T_arg2
 void visit_each(const T_action& _A_action,
                 const bound_const_volatile_mem_functor5<T_return, T_obj, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5>& _A_target)
 {
-  visit_each(_A_action, *_A_target.obj_ptr_);
+  sigc::visit_each(_A_action, _A_target.obj_);
 }
 
+
 /** bound_const_volatile_mem_functor6 encapsulates a const volatile method with 6 arguments and an object instance.
  * Use the convenience function mem_fun() to create an instance of bound_const_volatile_mem_functor6.
  *
@@ -3619,14 +3831,18 @@ public:
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_const_volatile_mem_functor6(const T_obj* _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(_A_obj) {}
+    : base_type_(_A_func),
+      obj_(*_A_obj)
+    {}
 
   /** Constructs a bound_const_volatile_mem_functor6 object that wraps the passed method.
    * @param _A_obj Reference to instance the method will operate on.
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_const_volatile_mem_functor6(const T_obj& _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(&_A_obj) {}
+    : base_type_(_A_func),
+      obj_(_A_obj)
+    {}
 
   /** Execute the wrapped method operating on the stored instance.
    * @param _A_a1 Argument to be passed on to the method.
@@ -3638,13 +3854,15 @@ public:
    * @return The return value of the method invocation.
    */
   T_return operator()(typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2,typename type_trait<T_arg3>::take _A_a3,typename type_trait<T_arg4>::take _A_a4,typename type_trait<T_arg5>::take _A_a5,typename type_trait<T_arg6>::take _A_a6) const
-    { return (obj_ptr_->*(this->func_ptr_))(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5,_A_a6); }
+    { return (obj_.invoke().*(this->func_ptr_))(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5,_A_a6); }
 
 //protected:
-  /// Pointer to stored object instance.
-  const T_obj *obj_ptr_;
+  // Reference to stored object instance.
+  // This is the handler object, such as TheObject in void TheObject::signal_handler().
+  const_volatile_limit_reference<T_obj> obj_;
 };
 
+//template specialization of visit_each<>(action, functor):
 /** Performs a functor on each of the targets of a functor.
  * The function overload for sigc::bound_const_volatile_mem_functor performs a functor
  * on the object instance stored in the sigc::bound_const_volatile_mem_functor object.
@@ -3655,9 +3873,10 @@ template <class T_action, class T_return, class T_obj, class T_arg1,class T_arg2
 void visit_each(const T_action& _A_action,
                 const bound_const_volatile_mem_functor6<T_return, T_obj, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6>& _A_target)
 {
-  visit_each(_A_action, *_A_target.obj_ptr_);
+  sigc::visit_each(_A_action, _A_target.obj_);
 }
 
+
 /** bound_const_volatile_mem_functor7 encapsulates a const volatile method with 7 arguments and an object instance.
  * Use the convenience function mem_fun() to create an instance of bound_const_volatile_mem_functor7.
  *
@@ -3687,14 +3906,18 @@ public:
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_const_volatile_mem_functor7(const T_obj* _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(_A_obj) {}
+    : base_type_(_A_func),
+      obj_(*_A_obj)
+    {}
 
   /** Constructs a bound_const_volatile_mem_functor7 object that wraps the passed method.
    * @param _A_obj Reference to instance the method will operate on.
    * @param _A_func Pointer to method will be invoked from operator()().
    */
   bound_const_volatile_mem_functor7(const T_obj& _A_obj, function_type _A_func)
-    : base_type_(_A_func), obj_ptr_(&_A_obj) {}
+    : base_type_(_A_func),
+      obj_(_A_obj)
+    {}
 
   /** Execute the wrapped method operating on the stored instance.
    * @param _A_a1 Argument to be passed on to the method.
@@ -3707,13 +3930,15 @@ public:
    * @return The return value of the method invocation.
    */
   T_return operator()(typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2,typename type_trait<T_arg3>::take _A_a3,typename type_trait<T_arg4>::take _A_a4,typename type_trait<T_arg5>::take _A_a5,typename type_trait<T_arg6>::take _A_a6,typename type_trait<T_arg7>::take _A_a7) const
-    { return (obj_ptr_->*(this->func_ptr_))(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5,_A_a6,_A_a7); }
+    { return (obj_.invoke().*(this->func_ptr_))(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5,_A_a6,_A_a7); }
 
 //protected:
-  /// Pointer to stored object instance.
-  const T_obj *obj_ptr_;
+  // Reference to stored object instance.
+  // This is the handler object, such as TheObject in void TheObject::signal_handler().
+  const_volatile_limit_reference<T_obj> obj_;
 };
 
+//template specialization of visit_each<>(action, functor):
 /** Performs a functor on each of the targets of a functor.
  * The function overload for sigc::bound_const_volatile_mem_functor performs a functor
  * on the object instance stored in the sigc::bound_const_volatile_mem_functor object.
@@ -3724,7 +3949,7 @@ template <class T_action, class T_return, class T_obj, class T_arg1,class T_arg2
 void visit_each(const T_action& _A_action,
                 const bound_const_volatile_mem_functor7<T_return, T_obj, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7>& _A_target)
 {
-  visit_each(_A_action, *_A_target.obj_ptr_);
+  sigc::visit_each(_A_action, _A_target.obj_);
 }