Boost logo

Boost Users :

Subject: Re: [Boost-users] Why does gcc require explicit template arguments with my boost::bind
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2012-12-06 12:21:08


On 06/12/12 06:34, Chris Stankevitz wrote:

> template <typename TAFunc1, typename TAFunc2>
> void Chain(const TAFunc1& Func1, TAFunc2& Func2)
> {
> Func1();
> Func2();
> }

Replace that by

struct Chain_impl
{
   typedef void result_type;

   template<typename TAFunc1, typename TAFunc2>
   result_type operator()(const TAFunc1& Func1, TAFunc2& Func2) const
   {
     Func1();
     Func2();
   }
};
Chain_impl const Chain = {};


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net