Boost logo

Boost :

Subject: Re: [boost] [BGL] [variant] problem (and perhaps solution?) with strong_components.hpp and variant
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2009-10-30 09:46:07


On Fri, 30 Oct 2009, Nil Geisweiller wrote:

> It is weird, I tried with 2 settings
>
> Ubuntu 9.04, gcc-4.3.3, boost 1.40
> Ubuntu 9.10, gcc-4.4.1, boost 1.40
>
> And I get the compiling errors:
>
> /usr/include/boost/property_map/property_map.hpp: In instantiation of
> ‘boost::property_traits<int>’:
> /usr/include/boost/graph/two_bit_color_map.hpp:46: instantiated from
> ‘boost::two_bit_color_map<int>’
> /home/a-lin/Sources/test/test.cpp:10: instantiated from here
> /usr/include/boost/property_map/property_map.hpp:31: error: ‘int’ is
> not a class, struct, or union type
> /usr/include/boost/property_map/property_map.hpp:32: error: ‘int’ is
> not a class, struct, or union type
> /usr/include/boost/property_map/property_map.hpp:33: error: ‘int’ is
> not a class, struct, or union type
> /usr/include/boost/property_map/property_map.hpp:34: error: ‘int’ is
> not a class, struct, or union type
>
> Has anyone experienced problem too?
>
> Thanks
> Nil

I'm surprised that this did not happen in earlier Boost versions. I think
the problem is that two components are using exactly the same function
name, and Boost.Graph's version (it's not in strong_components.hpp, just
included from there) does not accept the template argument you are giving
it. As it appears that there is no member or other function to get the
value out of a variant, it might be hard to avoid this error. The version
of get() in two_bit_color_map.hpp does not require any explicitly
specified template arguments, but that is not the version you want anyway.

-- Jeremiah Willcock


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