Boost logo

Boost :

From: Daryle Walker (darylew_at_[hidden])
Date: 2003-11-24 01:55:07

Sorry if we discussed this before, but why wouldn't:

struct no_integers_except_bool
    // None of these are defined
    operator signed char() const;
    operator unsigned char() const;
    operator signed short() const;
    operator unsigned short() const;
    operator int() const;
    operator unsigned() const;
    operator signed long() const;
    operator unsigned long() const;

    operator signed long long() const;
    operator unsigned long long() const;

    operator char() const;
    operator wchar_t() const;

block the bad effects of having an "operator bool() const"? (Your class
would inherit from this one.) Wasn't there a problem with compilers trying
to match a Boolean context to all of these operators, leading to
inaccessibility and ambiguity, instead of using "bool" as an unique exact


Boost list run by bdawes at, gregod at, cpdaniel at, john at