Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2006-11-12 12:46:11


Matthias Troyer <troyer_at_[hidden]> writes:

> Hi Beman, hi all
>
> Due to recent changes to the filesystem library now, the header
> detail/identifier.hpp is now included in my projects and contains the
> dangerous code segment:

Is it just dangerous by definition, because it breaks
your code on your compiler, or is there something else about it that
I'm missing?

> template <class Ostream, class Id>
> typename enable_if< is_base_of< identifier< typename
> Id::value_type, Id >, Id >,
> Ostream & >::type operator<<( Ostream & os, const Id & id )
> {
> return os << id.value();
> }
>
> which breaks all of my codes, since I have a type Id, that has a type
> member Id::value_type which is an abstract base class. My compiler
> (Apple gcc-4.0) now tries to instantiate identifier< typename
> Id::value_type, Id >, which fails because Id::value_type is abstract,
> and the compiler aborts with an error message.

Is that a compiler bug?
Is your Id in namespace boost?

> This causes all of our codes to fail to compile with the current CVS
> head

That's a problem.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

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