graph
graph copied to clipboard
bucket_sorter.cpp does not compile
1>bucket_sorter.cpp
1>d:\data\boost\boost\libs\graph\example\bucket_sorter.cpp(46): warning C4267: 'argument': conversion from 'size_t' to 'const int', possible loss of data
1>d:\data\boost\boost\libs\graph\example\bucket_sorter.cpp(65): warning C4267: 'argument': conversion from 'size_t' to 'const int', possible loss of data
1>d:\data\boost\boost\boost\pending\bucket_sorter.hpp(58): error C3861: 'get': identifier not found
1>d:\data\boost\boost\boost\pending\bucket_sorter.hpp(58): note: 'get': function was not declared in the template definition context and can be found only via argument-dependent lookup in the instantiation context
1>d:\data\boost\boost\boost\pending\bucket_sorter.hpp(57): note: while compiling class template member function 'void boost::bucket_sorter<size_t,int,std::_Vector_iterator<std::_Vector_val<std::_Simple_types<_Ty>>>,ID>::push(const int &)'
1> with
1> [
1> _Ty=size_t
1> ]
1>d:\data\boost\boost\libs\graph\example\bucket_sorter.cpp(46): note: see reference to function template instantiation 'void boost::bucket_sorter<size_t,int,std::_Vector_iterator<std::_Vector_val<std::_Simple_types<_Ty>>>,ID>::push(const int &)' being compiled
1> with
1> [
1> _Ty=size_t
1> ]
1>d:\data\boost\boost\libs\graph\example\bucket_sorter.cpp(43): note: see reference to class template instantiation 'boost::bucket_sorter<size_t,int,std::_Vector_iterator<std::_Vector_val<std::_Simple_types<_Ty>>>,ID>' being compiled
1> with
1> [
1> _Ty=size_t
1> ]
@anadon : I've just filed a bunch of bug reports against examples that appear broken, and that I don't have time to debug/fix. Would you be able to take a look at any of these? Hopefully not a "hospital pass"!
The problem here is that bucket_sorter expects a property map as the ValueIndexMap. The code compiles and seems to work if we change the line
typedef trivial_id ID;
to
typedef boost::identity_property_map ID;
and add an include for property_map.
I'm not sure exactly what the interface should be. Is there any documentation?
I'm not sure exactly what the interface should be. Is there any documentation?
Ugh, I suspect not - it's an example for boost/pending/bucket_sorter.hpp which is really an undocumented detail (albeit a possibly useful one).
So I guess we can either:
- Just remove it - seems a shame?
- Fix as you suggested above, and assuming it now builds and runs OK, just shrug and move on I guess.
Question: should it be boost/pending/bucket_sorter.hpp which adds that #include if a property map is a requirement of it's use?
Question: should it be boost/pending/bucket_sorter.hpp which adds that #include if a property map > is a requirement of it's use?
As property map is a concept, not a type per se, I don't know if this is necessary. Things should work smoothly with any type that . We could add a
BOOST_CONCEPT_ASSERT ((ReadablePropertyMap<ValueIndexMap, ValueType>));
line to bucket_sorter.hpp (or something similar, I'm not yet comfortable with the boost concept macros).
At a higher level this class is more of a bucket_vector than a bucket_sorter as no sorting is done at all. It maintains a vector of buckets, nothing more. I suspect that this was an abandoned attempt at what later became boost/graph/planar_detail/bucket_sort.hpp.
I would vote to just remove it unfinished. We could call it bucket list first :)
@deinst Thanks!
Why not close this issue? @deinst @anadon @jzmaddock