Boost logo

Boost :

From: Howard Hinnant (hinnant_at_[hidden])
Date: 2000-06-11 12:18:20


That is, if it doesn't matter that it doesn't work! :-)

Never mind!

-Howard

Howard Hinnant wrote on 6/11/2000 12:25 PM
>I'm not positive the following workaround doesn't have a gotcha, but I
>think it is worth exploring:
>
>template <class T, class U, class D = boost::detail::empty_base>
>struct addable2 : D
>{
> friend T operator+<>( T x, const U& y );
> friend T operator+<>( const U& y, T x );
>};
>
>template <class T, class U>
>inline
>T
>operator+( T x, const U& y )
>{
> return x += y;
>}
>
>template <class T, class U>
>inline
>T
>operator+( const U& y, T x )
>{
> return x += y;
>}


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