Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2005-08-17 05:16:07


Mat Marcus wrote:

> Here is a simplified version of the context in which the problem seems
> to crop up.
>
> //---- operator.hpp
>
> template <class T>
> struct is_foo {/*...*/}; // some appropriate compile time test
>
> template <class T>
> typename boost::enable_if<boost::is_foo<T>, T>::type
> operator| (T a, T b);
>
>
> //---- client.cpp
>
> #include "operator.hpp"
>
> So far things are ok. But now suppose that I am using gcc 4.0 the
> client later includes a new header system_header.hpp.
>
> //---system_header.hpp
>
> enum { kCaseInsenstiveMask = 1L << 1,
> kReverseOrderMask = 1L << 2,
> kOverrideMask = 1L << 3};
>
> enum { kTheWorks = kCaseInsenstiveMask | kReverseOrderMask |
> kOverrideMask };

This is very disturbing; it basically breaks all SFINAE'd operators. If this
is what the language currently mandates, it needs to be fixed.


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