Boost logo

Boost Users :

Subject: Re: [Boost-users] [lamda] smart self binding of a function object
From: Geoff Hilton (geoff.hilton_at_[hidden])
Date: 2010-05-12 11:03:41


On 11/05/2010 7:47 PM, alfC wrote:
>>> You'll have to make operator() a template:
>
>>> template<class T>
>>> function<double(double)> operator()(const T& x_arg, double y_arg);
>
>>> What if I want to restrict T to lambda expressions?
>>
>> What about forcing T to be or be derived from an expression template
>> base class?
>
> How can I do that? Can you point me to the right documentation if
> any.
>
> In the context of Boost.Lambda there is no common base class for all
> expression templates (is there?), for example the placeholders do not
> inherit from anything. The only thing I found was the subclass 'sig'
> that seems to be defined for all expression types. But I am still
> scratching my head on how to expoit this 'sig' subclass.
>
> Now that I think one obvious way to restrict T is to be an expression
> template that 'returns' a double (or convertible to 'double'), this
> information is contained in the sig subclass. But I am confused now to
> do any progress.
>
> Alfredo

I'd also like to add that I'd be very interested to hear about what
you've come up with as a solution. Thanks!

Geoff


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