Brian McNamara <[EMAIL PROTECTED]> wrote: > On Sun, Aug 31, 2003 at 09:12:59PM -0600, Dave Gomboc wrote: >>> The point is that optional<T> is not a T, and most notably, a template >>> function will never perform the coercion. Replace the lines like >>> B b = get<2>(args); >>> in your example with real calls to, e.g. >>> do_something( get<2>(args) ) >>> and do_something() is likely to fail if it's a template function >>> (expecting a T and not an optional<T>). >> >> Okay, you've demonstrated that it may not be possible to drop-in >> optional<T> for T with zero code changes when T is not a scalar type. >> (Usually, my Ts are! ;-) Nonetheless, it is at least still possible to >> write generic code that accepts either T or the wrapped T, which is >> definitely an improvement over writing a whack of special-casing code.
Darn! Can't we just overload operator.() <operator-dot> ????? <ahem><ahem><cough><cough><cough> ;-) I want my proxies! -- Joel de Guzman http://www.boost-consulting.com http://spirit.sf.net _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost