+ template<
+ typename T1,
+ typename T2,
+ class Derived,
+ class Other,
+ class OtherRef
+ >
+ StyleSetter
+ addStyle( const std::string& name,
+ const std::string& type,
+ void (Other::*setter)(T2),
+ OtherRef Derived::*instance_ref )
+ {
+ return addStyle<T1>(name, type, bindOther(setter, instance_ref));
+ }
+
+ template<
+ typename T1,
+ typename T2,
+ class Derived,
+ class Other,
+ class OtherRef
+ >
+ StyleSetter
+ addStyle( const std::string& name,
+ const std::string& type,
+ const boost::function<void (Other&, T2)>& setter,
+ OtherRef Derived::*instance_ref )
+ {
+ return addStyle<T1>(name, type, bindOther(setter, instance_ref));
+ }
+
+ template<
+ class Derived,
+ class Other,
+ class OtherRef
+ >
+ StyleSetter
+ addStyle( const std::string& name,
+ const std::string& type,
+ void (Other::*setter)(const std::string&),
+ OtherRef Derived::*instance_ref )
+ {
+ return addStyle<const char*, const std::string&>
+ (
+ name,
+ type,
+ boost::function<void (Other&, const std::string&)>(setter),
+ instance_ref
+ );
+ }
+
+ template<typename T, class Derived, class Other, class OtherRef>
+ boost::function<void (Derived&, T)>
+ bindOther( void (Other::*setter)(T), OtherRef Derived::*instance_ref )
+ {
+ return boost::bind(setter, boost::bind(instance_ref, _1), _2);
+ }
+
+ template<typename T, class Derived, class Other, class OtherRef>
+ boost::function<void (Derived&, T)>
+ bindOther( const boost::function<void (Other&, T)>& setter,
+ OtherRef Derived::*instance_ref )
+ {
+ return boost::bind
+ (
+ setter,
+ boost::bind
+ (
+ &reference_from_pointer<Other, OtherRef>,
+ boost::bind(instance_ref, _1)
+ ),
+ _2
+ );
+ }
+
+ template<typename T1, typename T2, class Derived>
+ StyleSetterFuncUnchecked