Boost logo

Boost Users :

Subject: Re: [Boost-users] template typedef?
From: Rutger ter Borg (rutger_at_[hidden])
Date: 2010-03-26 03:54:37


Roland Bock wrote:

> Hi,
>
> I wonder if there is some easy way to express the following incorrect
> code in a correct way?
>
> typedef template<class T> boost::function<void(const T&)> foo_function;
>
> template<> foo_function<int> my_foo = bind(example_function);
>

Something like

template< typename T >
struct my_function {
    typedef boost::function< void( constT& ) > type;
};

my_function<int>::type my_foo = bind( example_function );

?

Cheers,

Rutger


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