|
Boost : |
Subject: [boost] [BGL] [variant] problem (and perhaps solution?) with strong_components.hpp and variant
From: Nil Geisweiller (ngeiswei_at_[hidden])
Date: 2009-10-29 06:56:59
Hi,
it seems the problem is indeed a conflict between the get function of
variant.hpp and the get function of two_bit_color_map. After renaming
get by getTEST in
1) two_bit_color_map.hpp line 61
2) breadth_first_search.hpp line 78
3) property_map.hpp line 164
the compiling error has disappeared.
Of course it is certainly not the right way to fix that bug, maybe
wrapping two_bit_color_map get (and alike) function name under some
namespace... but I'm not confident enough to take such decision. Maybe
there is a better way.
Please if someone is more knowledgeable could help me fix that bug.
Thanks for your help
Nil
On Tue, Oct 27, 2009 at 7:31 AM, Nil Geisweiller
<ngeiswei_at_[hidden]> wrote:
> Hi,
>
> I resend that email with the right title header.
>
> ---------- Forwarded message ----------
> From: Nil Geisweiller <ngeiswei_at_[hidden]>
> Date: Sun, Oct 25, 2009 at 6:11 PM
> Subject: [Graph] problem with strong_components.hpp and variant
> To: boost_at_[hidden]
>
>
> Hi,
>
> it seems there is a conflict between strong_components.hpp and
> variant, maybe the method boost::get is wrongly overloaded.
>
> The problem occurs with 1.40 but not with 1.37, and it is still occurs
> with the last svn.
>
> I attach a minimal code to reproduce the bug + compile error
>
> ######
> test.cpp
> ######
>
> //uncomment the line below to get the bug
> #include <boost/graph/strong_components.hpp>
> #include <boost/variant.hpp>
>
> typedef boost::variant < int, float > intorfloat;
>
> int main() {
> int i(2);
> intorfloat iof(i);
> return boost::get<int>(iof); //problem is here
> }
>
> ###########
> compile error
> ###########
>
> a-lin_at_a-lin-desktop:~/OpenCog/test/bin$ make
> [100%] Building CXX object CMakeFiles/test.dir/test.cpp.o
> In file included from /usr/include/boost/graph/graph_concepts.hpp:17,
> from /usr/include/boost/graph/depth_first_search.hpp:18,
> from /usr/include/boost/graph/strong_components.hpp:17,
> from /home/a-lin/OpenCog/test/test.cpp:2:
> /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/OpenCog/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
> make[2]: *** [CMakeFiles/test.dir/test.cpp.o] Error 1
> make[1]: *** [CMakeFiles/test.dir/all] Error 2
> make: *** [all] Error 2
>
> Is it a bug? Thanks a lot!
> Nil
>
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk