
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