Boost logo

Boost :

Subject: Re: [boost] [Review] Boost.Type Traits Extension ending tomorrow
From: Joachim Faulhaber (afojgo_at_[hidden])
Date: 2011-03-20 06:41:13


2011/3/20 Vicente Botet <vicente.botet_at_[hidden]>:
>
> Joachim Faulhaber wrote:
>>
>> 2011/3/19 Frédéric Bron <frederic.bron_at_[hidden]>:
>> >> Maybe the set of functions should be something like
>> >>
>> >> is_callable<plus, LeftOperandType, RightOperandType>
>> >
>> > This is interesting,
>>
>> yes, I like it
>>
>> > however it would have to be something like:
>> > ::boost::is_callable<::boost::type_traits::operators::plus, LHS,
>> RHS>
>>
>> ideally
>>
>> boost::is_callable<std::plus, Left, Right>
>>
>> but std::op_functors seem to be restricted to singly typed functors,
>> which I don't understand,
>>
>
> I don't see op_functors in the standard.

What I mean by "op_functors" are function objects that wrap operators.

20.8 Function objects [1]

e.g.
// 20.8.4, arithmetic operations:
template <class T> struct plus;

> What do you mean by "restricted to
> singly typed functors"?

And they are template structs parameterized with a single type T instead of e.g.

template <class T, class U=T, class R=T> struct plus;

all three types: Lhs argument type T, rhs argument type U and result type R.

Best,
Joachim

 [1] Document n3242=11-0012, Working Draft,
     Standard for Programming Language C++

-- 
Interval Container Library [Boost.Icl]
http://www.joachim-faulhaber.de

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk