
On Tuesday 14 March 2006 11:13, Pablo Aguilar wrote:
Wouldn't the following work?
if( t && *t == mT )
I guess if ( mT && t == *mT ) would, yes, but what's the point of using deep comparison in the first place, then? I could just use a pointer instead. Granted, optional<> is more efficient (no heap allocation), and I only need to check the incoming. Hmm, come to think of it, maybe the correct thing to do would be to have setT() take an optional<T> const&... Implicit conversion would kick in and the relational operators would be sufficient. So, it can most easily be arranged to work. Still, it would be nice if there was a sentence about this in the design rationale. Thanks, Marc -- Marc Mutz -- marc@klaralvdalens-datakonsult.se, mutz@kde.org Klarälvdalens Datakonsult AB, Platform-independent software solutions