
23 Mar
2009
23 Mar
'09
6:59 p.m.
At 11:54 AM 3/23/2009, V S P wrote:
for example, the doc says subtractable<T>
produces T operator-(const T&, const T&)
It requires: " T temp(t); temp -= t1. " so does this mean T& operator -= (const T& ) ?
It means that T must have 1) A public (possibly explicit) copy constructor ("T temp(t)") 2) A public operator -= that takes an argument convertible from T. ("temp -= t1"). T& T::operator -= (T const&) would satisfy this criteria, but it is not the only way. I ignored your other question because of your request to do so.