Boost logo

Boost :

From: Luis Pedro Coelho (deepblack9_at_[hidden])
Date: 2001-10-10 14:28:45


Em Quarta, 10 de Outubro de 2001 15:55, escreveste:
> Actually I don't think that this would be a good idea. A 'standard'
> safe_bool will enable comparisons between unrelated types.

Maybe a safe_bool class template.
This way common code is factored out and you still get different types.

Use:

struct X {
        typedef safe_bool<X> bool_type;
        operator bool_type() const;
        // ....
};

HTH

-- 
Luis Pedro Coelho.

Check out my game of Hearts, a card game, for KDE at:
http://hearts.sourceforge.net/


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