Boost logo

Boost Users :

Subject: Re: [Boost-users] [function] equivalent of std::binary_function
From: OvermindDL1 (overminddl1_at_[hidden])
Date: 2009-08-15 17:30:17


On Sat, Aug 15, 2009 at 1:03 PM, alfC<alfredo.correa_at_[hidden]> wrote:
> Does Boost have the technology to define the equivalent of
> std::binary_function<double, double, double>
> eg something like
>
>  boost::nary_function<double(double, double)>
>
> Note that I am not interested in storing any function pointer, so
> using
>
> boost::function<double(double, double)>
> would be a waste.
>
> But I want to use the nice syntax "<double(double,double)>" that
> boost::function uses, instead of "<double, double, double>".
>
> The objective is to inherit from this class
>
> and instead of
> class op : std::binary_function<double, double, double>{
> ...
> }
>
> to have
> class op: nary_function<double(double, double)>{
>  ...
> }
> if possible.

The Boost.Function_Types (Function_Traits?) library lets you handle
syntax like double(double, double) easily.


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