
19 Apr
2004
19 Apr
'04
12:56 p.m.
David Abrahams wrote: [snip]
On the other hand, with technique 2 I think you can't write the generic function at all, because template arguments have to match exactly:
template <class T> void f(const_lvalue<Y<T> > x); // can never match a Y<T> argument
Isn't this true for technique 1 as well (and everything that isn't &&)? template<class T> void f(move_from<T> x); Granted, you can detect lvalues in a generic function, but that isn't of much use if you can't detect temporaries, no? -- Daniel Wallin