Boost logo

Boost :

Subject: Re: [boost] [Review] Boost.Type Traits Extension ending tomorrow
From: Brent Spillner (spillner_at_[hidden])
Date: 2011-03-19 15:01:04


On 3/19/2011 11:52 Joachim Faulhaber wrote:
>(1) We can think of the triple <T,U,R> of types that plus_assign *is*
>applicable on.
>(2) Each of those operations assigned to an operator can be decomposed

Maybe the set of functions should be something like

is_callable<plus, LeftOperandType, RightOperandType>

result_of<plus, LeftOperandType, RightOperandType, ReturnType>

retval_convertible_to<plus, LeftOperand, RightOperandType, EquivalentReturnType>

Similarly, we could have is_prefix_callable<plusplus, OperandType> and
is_postfix_callable<plusplus, OperandType>, which helps eliminate the
ambiguity that naming-by-syntax would introduce.

I favor making the operator name a template parameter because:
  - I suspect this will encourage a more maintainable code
decomposition within the library
  - It will likely permit simpler extension to free functions or
member functions (think is_callable<push_back, ContainerType,
ValueType>)
  - It will likely be easier to use for higher-level libraries such as
Phoenix, Proto, etc. that may pass around operator names for a while
before caring about the specific operator to which they refer


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