Boost logo

Boost :

From: Aleksey Gurtovoy (agurtovoy_at_[hidden])
Date: 2004-09-05 06:07:04


Hugo Duncan writes:
> The following does not compile, on bcc 564 with latest pserver CVS.
> The Variant definition is similar to the one Borland provides in
> their VCL headers (and the problem therefore exists with any
> code that uses the VCL).
>
> The error message is
> E2015 Ambiguity between 'operator !=(int,const Variant &)' and '!='
>
> Removing the mpl include gets rid of the compile error.
>
> Any ideas?

Nasty Borland bug:

    namespace aux {
    enum My {};
    bool operator!=(My, My);
    }

    struct Variant { Variant(int); };

    enum Abc { abcd, abcde };

    bool operator!=(int, const Variant&);

    int main()
    {
        return abcde != abcd; // ambiguity
    }

Workarounded in the CVS.

Thank you for the report,

--
Aleksey Gurtovoy
MetaCommunications Engineering

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