Boost logo

Boost Users :

Subject: Re: [Boost-users] [lamda] smart self binding of a function object
From: alfC (alfredo.correa_at_[hidden])
Date: 2010-05-11 19:47:46


>> 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


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