Boost logo

Boost Users :

Subject: Re: [Boost-users] [Proto] callable_context
From: Eric Niebler (eric_at_[hidden])
Date: 2011-01-04 10:02:42


On 1/4/2011 8:10 AM, Hossein Haeri wrote:
> Hi Erik,
>
>> struct add_one_ {
>> typedef int result_type;
>> int operator()(int i) const {
>> return i + 1;
>> }
>> };
>>
>> proto::terminal<add_one_>::type const add_one
>> = {};
>
> This needs me to wrap every function into a function object and then instantiate that function object using an aggregate syntax. This is awkward. I need something automatic for functions.
>
>> 1 >> add_one >> add_one
>
> I need something which can work with expressions like
>
> 1 >> &f >> &g >> &h
>
> where f, g, and h are ordinary functions. Is that also doable in Proto?

No. It's not doable in C++, period. There are no UDTs in the above
expression, so no operator overloads are considered. And there are no
built-in operators that make that well-formed.

-- 
Eric Niebler
BoostPro Computing
http://www.boostpro.com

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