Boost logo

Boost :

From: Karl Nelson (kenelson_at_[hidden])
Date: 2002-02-21 16:39:02


I haven't been following but this is really boost related C++
inhancement. Currently it is imposible to make a proxy to a
function through which both const references and references
are defined.

Ie.
  to proxy bar to foo requires....

  template <class T1,class T2,class T3,class T4>
  void bar(const T1& t1, const T2& t2, const T3& t3, const T4& t4)
   {foo(t1,t2,t3,t4);}

  template <class T1,class T2,class T3,class T4>
  void bar(T1& t1, const T2& t2, const T3& t3, const T4& t4)
   {foo(t1,t2,t3,t4);}

  template <class T1,class T2,class T3,class T4>
  void bar(const T1& t1, T2& t2, const T3& t3, const T4& t4)
   {foo(t1,t2,t3,t4);}

  template <class T1,class T2,class T3,class T4>
  void bar(const T1& t1, const T2& t2, T3& t3, const T4& t4)
   {foo(t1,t2,t3,t4);}

  template <class T1,class T2,class T3,class T4>
  void bar(const T1& t1, const T2& t2, const T3& t3, T4& t4)
   {foo(t1,t2,t3,t4);}

  template <class T1,class T2,class T3,class T4>
  void bar(T1& t1, T2& t2, const T3& t3, const T4& t4)
   {foo(t1,t2,t3,t4);}

....

which should have been able to be handled with a simple
statement like...

  template <class &T1,class &T2,class &T3,class &T4>
  void bar(T1 t1,T2 t2,T3 t3,T4 t4)
   {foo(t1,t2,t3,t4);}

Second, there needs to be the equivelent of gnu typeof
which finds the return type of a function, so that you can
use callof.

template <class T_functor,class T_arg1,class T_arg2>
struct callof <T_functor,T_arg1,T_arg2>
{
   typedef typeof(type_trait<T_functor>::instance().
                    T_functor::operator()(
                       type_trait<T_arg1>::instance(),
                       type_trait<T_arg2>::instance())) return_type;
};

Just my 2-cents on how to save hundreds of lines of repetitive
codes. Without those extensions building a C++ signal/slot framework
is a royal pain.
 
--Karl


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk