Boost Graph Library: Verification of ReadWritePropertyMapConcept for std::map fails - c++

For some reason, verification of ReadWritePropertyMapConcept for std::map of vertex descriptors and colors fails:
Live on godbolt
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/graph_traits.hpp>
#include <boost/graph/properties.hpp>
#include <boost/property_map/property_map.hpp>
#include <map>
struct Vertex {};
using graph_type = boost::adjacency_list<boost::vecS, boost::vecS,
boost::bidirectionalS, Vertex>;
using vertex_descriptor = boost::graph_traits<graph_type>::vertex_descriptor;
using map_type = std::map<vertex_descriptor, boost::default_color_type>;
BOOST_CONCEPT_ASSERT(
(boost::ReadWritePropertyMapConcept<map_type, vertex_descriptor>));
with errors:
In file included from /opt/compiler-explorer/libs/boost_1_78_0/boost/graph/adjacency_list.hpp:27,
from <source>:1:
/opt/compiler-explorer/libs/boost_1_78_0/boost/property_map/property_map.hpp: In instantiation of 'struct boost::ReadWritePropertyMapConcept<std::map<long unsigned int, boost::default_color_type>, long unsigned int>':
/opt/compiler-explorer/libs/boost_1_78_0/boost/concept/detail/has_constraints.hpp:32:62: required by substitution of 'template<class Model> boost::concepts::detail::yes boost::concepts::detail::has_constraints_(Model*, boost::concepts::detail::wrap_constraints<Model, (& Model::constraints)>*) [with Model = boost::ReadWritePropertyMapConcept<std::map<long unsigned int, boost::default_color_type>, long unsigned int>]'
/opt/compiler-explorer/libs/boost_1_78_0/boost/concept/detail/has_constraints.hpp:42:5: required from 'const bool boost::concepts::not_satisfied<boost::ReadWritePropertyMapConcept<std::map<long unsigned int, boost::default_color_type>, long unsigned int> >::value'
/opt/compiler-explorer/libs/boost_1_78_0/boost/concept/detail/has_constraints.hpp:45:51: required from 'struct boost::concepts::not_satisfied<boost::ReadWritePropertyMapConcept<std::map<long unsigned int, boost::default_color_type>, long unsigned int> >'
/opt/compiler-explorer/libs/boost_1_78_0/boost/concept/detail/general.hpp:72:8: required from 'struct boost::concepts::requirement_<void (*)(boost::ReadWritePropertyMapConcept<std::map<long unsigned int, boost::default_color_type>, long unsigned int>)>'
<source>:13:1: required from here
/opt/compiler-explorer/libs/boost_1_78_0/boost/property_map/property_map.hpp:203:54: error: no type named 'category' in 'struct boost::property_traits<std::map<long unsigned int, boost::default_color_type> >'
203 | typedef typename property_traits<PMap>::category Category;
| ^~~~~~~~
/opt/compiler-explorer/libs/boost_1_78_0/boost/property_map/property_map.hpp: In instantiation of 'struct boost::ReadablePropertyMapConcept<std::map<long unsigned int, boost::default_color_type>, long unsigned int>':
/opt/compiler-explorer/libs/boost_1_78_0/boost/concept/detail/has_constraints.hpp:32:62: required by substitution of 'template<class Model> boost::concepts::detail::yes boost::concepts::detail::has_constraints_(Model*, boost::concepts::detail::wrap_constraints<Model, (& Model::constraints)>*) [with Model = boost::ReadablePropertyMapConcept<std::map<long unsigned int, boost::default_color_type>, long unsigned int>]'
/opt/compiler-explorer/libs/boost_1_78_0/boost/concept/detail/has_constraints.hpp:42:5: required from 'const bool boost::concepts::not_satisfied<boost::ReadablePropertyMapConcept<std::map<long unsigned int, boost::default_color_type>, long unsigned int> >::value'
/opt/compiler-explorer/libs/boost_1_78_0/boost/concept/detail/has_constraints.hpp:45:51: required from 'struct boost::concepts::not_satisfied<boost::ReadablePropertyMapConcept<std::map<long unsigned int, boost::default_color_type>, long unsigned int> >'
/opt/compiler-explorer/libs/boost_1_78_0/boost/concept/detail/general.hpp:72:8: required from 'struct boost::concepts::requirement_<void (*)(boost::ReadablePropertyMapConcept<std::map<long unsigned int, boost::default_color_type>, long unsigned int>)>'
/opt/compiler-explorer/libs/boost_1_78_0/boost/property_map/property_map.hpp:206:7: required from 'void boost::ReadWritePropertyMapConcept<PMap, Key>::constraints() [with PMap = std::map<long unsigned int, boost::default_color_type>; Key = long unsigned int]'
/opt/compiler-explorer/libs/boost_1_78_0/boost/concept/detail/has_constraints.hpp:32:62: required by substitution of 'template<class Model> boost::concepts::detail::yes boost::concepts::detail::has_constraints_(Model*, boost::concepts::detail::wrap_constraints<Model, (& Model::constraints)>*) [with Model = boost::ReadWritePropertyMapConcept<std::map<long unsigned int, boost::default_color_type>, long unsigned int>]'
/opt/compiler-explorer/libs/boost_1_78_0/boost/concept/detail/has_constraints.hpp:42:5: required from 'const bool boost::concepts::not_satisfied<boost::ReadWritePropertyMapConcept<std::map<long unsigned int, boost::default_color_type>, long unsigned int> >::value'
/opt/compiler-explorer/libs/boost_1_78_0/boost/concept/detail/has_constraints.hpp:45:51: required from 'struct boost::concepts::not_satisfied<boost::ReadWritePropertyMapConcept<std::map<long unsigned int, boost::default_color_type>, long unsigned int> >'
/opt/compiler-explorer/libs/boost_1_78_0/boost/concept/detail/general.hpp:72:8: required from 'struct boost::concepts::requirement_<void (*)(boost::ReadWritePropertyMapConcept<std::map<long unsigned int, boost::default_color_type>, long unsigned int>)>'
<source>:13:1: required from here
/opt/compiler-explorer/libs/boost_1_78_0/boost/property_map/property_map.hpp:143:54: error: no type named 'key_type' in 'struct boost::property_traits<std::map<long unsigned int, boost::default_color_type> >'
143 | typedef typename property_traits<PMap>::key_type key_type;
| ^~~~~~~~
/opt/compiler-explorer/libs/boost_1_78_0/boost/property_map/property_map.hpp:144:55: error: no type named 'reference' in 'struct boost::property_traits<std::map<long unsigned int, boost::default_color_type> >'
144 | typedef typename property_traits<PMap>::reference reference;
| ^~~~~~~~~
/opt/compiler-explorer/libs/boost_1_78_0/boost/property_map/property_map.hpp:145:54: error: no type named 'category' in 'struct boost::property_traits<std::map<long unsigned int, boost::default_color_type> >'
145 | typedef typename property_traits<PMap>::category Category;
| ^~~~~~~~
/opt/compiler-explorer/libs/boost_1_78_0/boost/property_map/property_map.hpp:154:48: error: no type named 'value_type' in 'struct boost::property_traits<std::map<long unsigned int, boost::default_color_type> >'
154 | typename property_traits<PMap>::value_type val;
| ^~~
/opt/compiler-explorer/libs/boost_1_78_0/boost/property_map/property_map.hpp: In instantiation of 'struct boost::WritablePropertyMapConcept<std::map<long unsigned int, boost::default_color_type>, long unsigned int>':
/opt/compiler-explorer/libs/boost_1_78_0/boost/concept/detail/has_constraints.hpp:32:62: required by substitution of 'template<class Model> boost::concepts::detail::yes boost::concepts::detail::has_constraints_(Model*, boost::concepts::detail::wrap_constraints<Model, (& Model::constraints)>*) [with Model = boost::WritablePropertyMapConcept<std::map<long unsigned int, boost::default_color_type>, long unsigned int>]'
/opt/compiler-explorer/libs/boost_1_78_0/boost/concept/detail/has_constraints.hpp:42:5: required from 'const bool boost::concepts::not_satisfied<boost::WritablePropertyMapConcept<std::map<long unsigned int, boost::default_color_type>, long unsigned int> >::value'
/opt/compiler-explorer/libs/boost_1_78_0/boost/concept/detail/has_constraints.hpp:45:51: required from 'struct boost::concepts::not_satisfied<boost::WritablePropertyMapConcept<std::map<long unsigned int, boost::default_color_type>, long unsigned int> >'
/opt/compiler-explorer/libs/boost_1_78_0/boost/concept/detail/general.hpp:72:8: required from 'struct boost::concepts::requirement_<void (*)(boost::WritablePropertyMapConcept<std::map<long unsigned int, boost::default_color_type>, long unsigned int>)>'
/opt/compiler-explorer/libs/boost_1_78_0/boost/property_map/property_map.hpp:207:7: required from 'void boost::ReadWritePropertyMapConcept<PMap, Key>::constraints() [with PMap = std::map<long unsigned int, boost::default_color_type>; Key = long unsigned int]'
/opt/compiler-explorer/libs/boost_1_78_0/boost/concept/detail/has_constraints.hpp:32:62: required by substitution of 'template<class Model> boost::concepts::detail::yes boost::concepts::detail::has_constraints_(Model*, boost::concepts::detail::wrap_constraints<Model, (& Model::constraints)>*) [with Model = boost::ReadWritePropertyMapConcept<std::map<long unsigned int, boost::default_color_type>, long unsigned int>]'
/opt/compiler-explorer/libs/boost_1_78_0/boost/concept/detail/has_constraints.hpp:42:5: required from 'const bool boost::concepts::not_satisfied<boost::ReadWritePropertyMapConcept<std::map<long unsigned int, boost::default_color_type>, long unsigned int> >::value'
/opt/compiler-explorer/libs/boost_1_78_0/boost/concept/detail/has_constraints.hpp:45:51: required from 'struct boost::concepts::not_satisfied<boost::ReadWritePropertyMapConcept<std::map<long unsigned int, boost::default_color_type>, long unsigned int> >'
/opt/compiler-explorer/libs/boost_1_78_0/boost/concept/detail/general.hpp:72:8: required from 'struct boost::concepts::requirement_<void (*)(boost::ReadWritePropertyMapConcept<std::map<long unsigned int, boost::default_color_type>, long unsigned int>)>'
<source>:13:1: required from here
/opt/compiler-explorer/libs/boost_1_78_0/boost/property_map/property_map.hpp:176:54: error: no type named 'key_type' in 'struct boost::property_traits<std::map<long unsigned int, boost::default_color_type> >'
176 | typedef typename property_traits<PMap>::key_type key_type;
| ^~~~~~~~
/opt/compiler-explorer/libs/boost_1_78_0/boost/property_map/property_map.hpp:177:54: error: no type named 'category' in 'struct boost::property_traits<std::map<long unsigned int, boost::default_color_type> >'
177 | typedef typename property_traits<PMap>::category Category;
| ^~~~~~~~
/opt/compiler-explorer/libs/boost_1_78_0/boost/property_map/property_map.hpp:185:48: error: no type named 'value_type' in 'struct boost::property_traits<std::map<long unsigned int, boost::default_color_type> >'
185 | typename property_traits<PMap>::value_type val;
| ^~~
In file included from /opt/compiler-explorer/libs/boost_1_78_0/boost/concept/assert.hpp:35,
from /opt/compiler-explorer/libs/boost_1_78_0/boost/property_map/property_map.hpp:19,
from /opt/compiler-explorer/libs/boost_1_78_0/boost/graph/adjacency_list.hpp:27,
from <source>:1:
/opt/compiler-explorer/libs/boost_1_78_0/boost/property_map/property_map.hpp: In instantiation of 'void boost::ReadWritePropertyMapConcept<PMap, Key>::constraints() [with PMap = std::map<long unsigned int, boost::default_color_type>; Key = long unsigned int]':
/opt/compiler-explorer/libs/boost_1_78_0/boost/concept/detail/has_constraints.hpp:32:62: required by substitution of 'template<class Model> boost::concepts::detail::yes boost::concepts::detail::has_constraints_(Model*, boost::concepts::detail::wrap_constraints<Model, (& Model::constraints)>*) [with Model = boost::ReadWritePropertyMapConcept<std::map<long unsigned int, boost::default_color_type>, long unsigned int>]'
/opt/compiler-explorer/libs/boost_1_78_0/boost/concept/detail/has_constraints.hpp:42:5: required from 'const bool boost::concepts::not_satisfied<boost::ReadWritePropertyMapConcept<std::map<long unsigned int, boost::default_color_type>, long unsigned int> >::value'
/opt/compiler-explorer/libs/boost_1_78_0/boost/concept/detail/has_constraints.hpp:45:51: required from 'struct boost::concepts::not_satisfied<boost::ReadWritePropertyMapConcept<std::map<long unsigned int, boost::default_color_type>, long unsigned int> >'
/opt/compiler-explorer/libs/boost_1_78_0/boost/concept/detail/general.hpp:72:8: required from 'struct boost::concepts::requirement_<void (*)(boost::ReadWritePropertyMapConcept<std::map<long unsigned int, boost::default_color_type>, long unsigned int>)>'
<source>:13:1: required from here
/opt/compiler-explorer/libs/boost_1_78_0/boost/property_map/property_map.hpp:208:7: error: no type named 'category' in 'struct boost::property_traits<std::map<long unsigned int, boost::default_color_type> >'
208 | BOOST_CONCEPT_ASSERT((ConvertibleConcept<Category, ReadWriteTag>));
| ^~~~~~~~~~~~~~~~~~~~
Compiler returned: 1
However, std::map surely has key_type, value_type etc. I have also used it in boost::depth_first_search() as color_map as in this question, and it seemed to work.
On the contrary, when the property map is constructed from adapter, the check passes:
int main() {
graph_type g;
std::vector<boost::default_color_type> colors(num_vertices(g));
auto color_map = boost::make_iterator_property_map(
colors.begin(), get(boost::vertex_index, g));
BOOST_CONCEPT_ASSERT(
(boost::ReadWritePropertyMapConcept<decltype(color_map),
boost::default_color_type>));
}
Why is the concept check failing?

A container doesn't usually satisfy the concept requirements for property maps. Put simply: the map is not a property map. At all.
In principle you need to adapt it. Certainly in the case of this associative property map:
std::map<V, C> colors;
auto color_map = make_assoc_property_map(colors);
Live On Compiler Explorer
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/breadth_first_search.hpp>
#include <fmt/ranges.h>
using C = boost::default_color_type;
template <> struct fmt::formatter<C> {
auto format(C c, auto& ctx) const { return format_to(ctx.out(), "{}", std::array{"white", "gray", "green", "red", "black"}.at(c)); }
};
struct Vertex {};
using G = boost::adjacency_list<boost::vecS, boost::vecS, boost::bidirectionalS,
Vertex>;
int main() {
using V = G::vertex_descriptor;
std::map<V, C> colors;
auto color_map = make_assoc_property_map(colors);
G g(10);
add_edge(0, 1, g);
add_edge(1, 3, g);
add_edge(1, 4, g);
add_edge(3, 2, g);
add_edge(2, 7, g);
breadth_first_search(g, vertex(0, g), boost::color_map(color_map));
fmt::print("{}\n", fmt::join(colors, "\n"));
}
Prints
(0, black)
(1, black)
(2, black)
(3, black)
(4, black)
(5, white)
(6, white)
(7, black)
(8, white)
(9, white)

Related

C++ Map with key and value data type as uint32_t gives error

On using uint32_t data type for the key and value in a map. I am getting an error no known conversion for argument.
Here is what I tried
int main() {
uint32_t a = 5;
uint32_t b = 9;
map <uint32_t, uint32_t> Mapper;
Mapper.insert({9,8});
auto imageFoundIt = Mapper.find(make_pair(a, b));
return 0;
}
Here is the error stack trace
g++ /tmp/cpzeeEDm4C.cpp
/tmp/cpzeeEDm4C.cpp: In function 'int main()':
/tmp/cpzeeEDm4C.cpp:10:52: error: no matching function for call to 'std::map<unsigned int, unsigned int>::find(std::pair<unsigned int, unsigned int>)'
10 | auto imageFoundIt = Mapper.find(make_pair(a, b));
| ^
In file included from /usr/include/c++/9/map:61,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:81,
from /tmp/cpzeeEDm4C.cpp:3:
/usr/include/c++/9/bits/stl_map.h:1168:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::iterator std::map<_Key, _Tp, _Compare, _Alloc>::find(const key_type&) [with _Key = unsigned int; _Tp = unsigned int; _Compare = std::less<unsigned int>; _Alloc = std::allocator<std::pair<const unsigned int, unsigned int> >; std::map<_Key, _Tp, _Compare, _Alloc>::iterator = std::_Rb_tree_iterator<std::pair<const unsigned int, unsigned int> >; std::map<_Key, _Tp, _Compare, _Alloc>::key_type = unsigned int]'
1168 | find(const key_type& __x)
| ^~~~
/usr/include/c++/9/bits/stl_map.h:1168:28: note: no known conversion for argument 1 from 'std::pair<unsigned int, unsigned int>' to 'const key_type&' {aka 'const unsigned int&'}
1168 | find(const key_type& __x)
| ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/9/bits/stl_map.h:1174:2: note: candidate: 'template<class _Kt> decltype (((std::map<_Key, _Tp, _Compare, _Alloc>*)this)->std::map<_Key, _Tp, _Compare, _Alloc>::_M_t._M_find_tr(__x)) std::map<_Key, _Tp, _Compare, _Alloc>::find(const _Kt&) [with _Kt = _Kt; _Key = unsigned int; _Tp = unsigned int; _Compare = std::less<unsigned int>; _Alloc = std::allocator<std::pair<const unsigned int, unsigned int> >]'
1174 | find(const _Kt& __x) -> decltype(_M_t._M_find_tr(__x))
| ^~~~
/usr/include/c++/9/bits/stl_map.h:1174:2: note: template argument deduction/substitution failed:
/usr/include/c++/9/bits/stl_map.h: In substitution of 'template<class _Kt> decltype (((std::map<unsigned int, unsigned int>*)this)->std::map<unsigned int, unsigned int>::_M_t.std::_Rb_tree<unsigned int, std::pair<const unsigned int, unsigned int>, std::_Select1st<std::pair<const unsigned int, unsigned int> >, std::less<unsigned int>, std::allocator<std::pair<const unsigned int, unsigned int> > >::_M_find_tr(__x)) std::map<unsigned int, unsigned int>::find<_Kt>(const _Kt&) [with _Kt = std::pair<unsigned int, unsigned int>]':
/tmp/cpzeeEDm4C.cpp:10:52: required from here
/usr/include/c++/9/bits/stl_map.h:1174:2: error: no matching function for call to 'std::_Rb_tree<unsigned int, std::pair<const unsigned int, unsigned int>, std::_Select1st<std::pair<const unsigned int, unsigned int> >, std::less<unsigned int>, std::allocator<std::pair<const unsigned int, unsigned int> > >::_M_find_tr(const std::pair<unsigned int, unsigned int>&)'
In file included from /usr/include/c++/9/map:60,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:81,
from /tmp/cpzeeEDm4C.cpp:3:
/usr/include/c++/9/bits/stl_tree.h:1306:2: note: candidate: 'template<class _Kt, class _Req> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_find_tr(const _Kt&) [with _Kt = _Kt; _Req = _Req; _Key = unsigned int; _Val = std::pair<const unsigned int, unsigned int>; _KeyOfValue = std::_Select1st<std::pair<const unsigned int, unsigned int> >; _Compare = std::less<unsigned int>; _Alloc = std::allocator<std::pair<const unsigned int, unsigned int> >]'
1306 | _M_find_tr(const _Kt& __k)
| ^~~~~~~~~~
/usr/include/c++/9/bits/stl_tree.h:1306:2: note: template argument deduction/substitution failed:
/usr/include/c++/9/bits/stl_tree.h: In substitution of 'template<class _Cmp, class _SfinaeType> using __has_is_transparent_t = typename std::__has_is_transparent<_Cmp, _SfinaeType>::type [with _Cmp = std::less<unsigned int>; _SfinaeType = std::pair<unsigned int, unsigned int>]':
/usr/include/c++/9/bits/stl_tree.h:1304:9: required by substitution of 'template<class _Kt> decltype (((std::map<unsigned int, unsigned int>*)this)->std::map<unsigned int, unsigned int>::_M_t.std::_Rb_tree<unsigned int, std::pair<const unsigned int, unsigned int>, std::_Select1st<std::pair<const unsigned int, unsigned int> >, std::less<unsigned int>, std::allocator<std::pair<const unsigned int, unsigned int> > >::_M_find_tr(__x)) std::map<unsigned int, unsigned int>::find<_Kt>(const _Kt&) [with _Kt = std::pair<unsigned int, unsigned int>]'
/tmp/cpzeeEDm4C.cpp:10:52: required from here
/usr/include/c++/9/bits/stl_tree.h:425:11: error: no type named 'type' in 'struct std::__has_is_transparent<std::less<unsigned int>, std::pair<unsigned int, unsigned int>, void>'
425 | using __has_is_transparent_t
| ^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/9/bits/stl_map.h: In substitution of 'template<class _Kt> decltype (((std::map<unsigned int, unsigned int>*)this)->std::map<unsigned int, unsigned int>::_M_t.std::_Rb_tree<unsigned int, std::pair<const unsigned int, unsigned int>, std::_Select1st<std::pair<const unsigned int, unsigned int> >, std::less<unsigned int>, std::allocator<std::pair<const unsigned int, unsigned int> > >::_M_find_tr(__x)) std::map<unsigned int, unsigned int>::find<_Kt>(const _Kt&) [with _Kt = std::pair<unsigned int, unsigned int>]':
/tmp/cpzeeEDm4C.cpp:10:52: required from here
/usr/include/c++/9/bits/stl_tree.h:1315:2: note: candidate: 'template<class _Kt, class _Req> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::const_iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_find_tr(const _Kt&) const [with _Kt = _Kt; _Req = _Req; _Key = unsigned int; _Val = std::pair<const unsigned int, unsigned int>; _KeyOfValue = std::_Select1st<std::pair<const unsigned int, unsigned int> >; _Compare = std::less<unsigned int>; _Alloc = std::allocator<std::pair<const unsigned int, unsigned int> >]'
1315 | _M_find_tr(const _Kt& __k) const
| ^~~~~~~~~~
/usr/include/c++/9/bits/stl_tree.h:1315:2: note: template argument deduction/substitution failed:
In file included from /usr/include/c++/9/map:61,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:81,
from /tmp/cpzeeEDm4C.cpp:3:
/usr/include/c++/9/bits/stl_map.h:1193:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::const_iterator std::map<_Key, _Tp, _Compare, _Alloc>::find(const key_type&) const [with _Key = unsigned int; _Tp = unsigned int; _Compare = std::less<unsigned int>; _Alloc = std::allocator<std::pair<const unsigned int, unsigned int> >; std::map<_Key, _Tp, _Compare, _Alloc>::const_iterator = std::_Rb_tree_const_iterator<std::pair<const unsigned int, unsigned int> >; std::map<_Key, _Tp, _Compare, _Alloc>::key_type = unsigned int]'
1193 | find(const key_type& __x) const
| ^~~~
/usr/include/c++/9/bits/stl_map.h:1193:28: note: no known conversion for argument 1 from 'std::pair<unsigned int, unsigned int>' to 'const key_type&' {aka 'const unsigned int&'}
1193 | find(const key_type& __x) const
| ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/9/bits/stl_map.h:1199:2: note: candidate: 'template<class _Kt> decltype (((const std::map<_Key, _Tp, _Compare, _Alloc>*)this)->std::map<_Key, _Tp, _Compare, _Alloc>::_M_t._M_find_tr(__x)) std::map<_Key, _Tp, _Compare, _Alloc>::find(const _Kt&) const [with _Kt = _Kt; _Key = unsigned int; _Tp = unsigned int; _Compare = std::less<unsigned int>; _Alloc = std::allocator<std::pair<const unsigned int, unsigned int> >]'
1199 | find(const _Kt& __x) const -> decltype(_M_t._M_find_tr(__x))
| ^~~~
/usr/include/c++/9/bits/stl_map.h:1199:2: note: template argument deduction/substitution failed:
/usr/include/c++/9/bits/stl_map.h: In substitution of 'template<class _Kt> decltype (((const std::map<unsigned int, unsigned int>*)this)->std::map<unsigned int, unsigned int>::_M_t.std::_Rb_tree<unsigned int, std::pair<const unsigned int, unsigned int>, std::_Select1st<std::pair<const unsigned int, unsigned int> >, std::less<unsigned int>, std::allocator<std::pair<const unsigned int, unsigned int> > >::_M_find_tr(__x)) std::map<unsigned int, unsigned int>::find<_Kt>(const _Kt&) const [with _Kt = std::pair<unsigned int, unsigned int>]':
/tmp/cpzeeEDm4C.cpp:10:52: required from here
/usr/include/c++/9/bits/stl_map.h:1199:2: error: no matching function for call to 'std::_Rb_tree<unsigned int, std::pair<const unsigned int, unsigned int>, std::_Select1st<std::pair<const unsigned int, unsigned int> >, std::less<unsigned int>, std::allocator<std::pair<const unsigned int, unsigned int> > >::_M_find_tr(const std::pair<unsigned int, unsigned int>&) const'
In file included from /usr/include/c++/9/map:60,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:81,
from /tmp/cpzeeEDm4C.cpp:3:
/usr/include/c++/9/bits/stl_tree.h:1306:2: note: candidate: 'template<class _Kt, class _Req> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_find_tr(const _Kt&) [with _Kt = _Kt; _Req = _Req; _Key = unsigned int; _Val = std::pair<const unsigned int, unsigned int>; _KeyOfValue = std::_Select1st<std::pair<const unsigned int, unsigned int> >; _Compare = std::less<unsigned int>; _Alloc = std::allocator<std::pair<const unsigned int, unsigned int> >]'
1306 | _M_find_tr(const _Kt& __k)
| ^~~~~~~~~~
/usr/include/c++/9/bits/stl_tree.h:1306:2: note: template argument deduction/substitution failed:
/usr/include/c++/9/bits/stl_tree.h:1315:2: note: candidate: 'template<class _Kt, class _Req> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::const_iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_find_tr(const _Kt&) const [with _Kt = _Kt; _Req = _Req; _Key = unsigned int; _Val = std::pair<const unsigned int, unsigned int>; _KeyOfValue = std::_Select1st<std::pair<const unsigned int, unsigned int> >; _Compare = std::less<unsigned int>; _Alloc = std::allocator<std::pair<const unsigned int, unsigned int> >]'
1315 | _M_find_tr(const _Kt& __k) const
| ^~~~~~~~~~
/usr/include/c++/9/bits/stl_tree.h:1315:2: note: template argument deduction/substitution failed:
How can I use uint32_t as key and value here?
The problem is that std::map::find takes the key(which is of type Key) value of the element to search for as argument but you're providing a std::pair and hence the error.
So solve this just replace the call to find with:
//------------------------------v--->pass the key value
auto imageFoundIt = Mapper.find(a)
which will give return an iterator to an element with key equivalent to key. And if no such element is found, past-the-end iterator will be returned.

`error: void value not ignored as it ought to be` using `std::max_element`

I was trying to get the element with largest size from a vector of elements, as succinct as possible. The original code looks like,
std::cout << ((*std::max_element(rooms.begin(), rooms.end(),
[](auto a, auto b){a.size() < b.size();})).size()) << std::endl;
which g++ complains,
wall3.cpp: In function ‘int main()’:
wall3.cpp:150:47: error: ‘class __gnu_cxx::__normal_iterator<std::set<std::pair<long unsigned int, long unsigned int> >*, std::vector<std::set<std::pair<long unsigned int, long unsigned int> > > >’ has no member named ‘size’
150 | [](auto a, auto b){a.size() < b.size();}).size() << std::endl;
| ^~~~
In file included from /usr/include/c++/9/bits/stl_algobase.h:71,
from /usr/include/c++/9/bits/char_traits.h:39,
from /usr/include/c++/9/string:40,
from /usr/include/c++/9/bitset:47,
from wall3.cpp:1:
/usr/include/c++/9/bits/predefined_ops.h: In instantiation of ‘constexpr bool __gnu_cxx::__ops::_Iter_comp_iter<_Compare>::operator()(_Iterator1, _Iterator2) [with _Iterator1 = __gnu_cxx::__normal_iterator<std::set<std::pair<long unsigned int, long unsigned int> >*, std::vector<std::set<std::pair<long unsigned int, long unsigned int> > > >; _Iterator2 = __gnu_cxx::__normal_iterator<std::set<std::pair<long unsigned int, long unsigned int> >*, std::vector<std::set<std::pair<long unsigned int, long unsigned int> > > >; _Compare = main()::<lambda(auto:1, auto:2)>]’:
/usr/include/c++/9/bits/stl_algo.h:5692:12: required from ‘constexpr _ForwardIterator std::__max_element(_ForwardIterator, _ForwardIterator, _Compare) [with _ForwardIterator = __gnu_cxx::__normal_iterator<std::set<std::pair<long unsigned int, long unsigned int> >*, std::vector<std::set<std::pair<long unsigned int, long unsigned int> > > >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<main()::<lambda(auto:1, auto:2)> >]’
/usr/include/c++/9/bits/stl_algo.h:5743:43: required from ‘constexpr _FIter std::max_element(_FIter, _FIter, _Compare) [with _FIter = __gnu_cxx::__normal_iterator<std::set<std::pair<long unsigned int, long unsigned int> >*, std::vector<std::set<std::pair<long unsigned int, long unsigned int> > > >; _Compare = main()::<lambda(auto:1, auto:2)>]’
wall3.cpp:150:45: required from here
/usr/include/c++/9/bits/predefined_ops.h:143:18: error: void value not ignored as it ought to be
143 | { return bool(_M_comp(*__it1, *__it2)); }
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
It turns out that I forgot to use return in the lambda expression. Adding return solved the problem.
Lesson: use a different compiler and turn on the strictest warning configurations to reveal the problem faster. The output from clang++ is far more explicit,
wall3.cpp:150:33: warning: relational comparison result unused [-Wunused-comparison]
[](auto a, auto b){a.size() < b.size();})).size()) << std::endl;
~~~~~~~~~^~~~~~~~~~

How to use unordered_map in base class with curiously recurring template pattern?

I'm using curiously recurring template pattern:
#include <unordered_map>
using namespace std;
template<class S>
struct State {
unordered_map<int, S> children; // <-- problem!
};
struct TicTacToeState : public State<TicTacToeState> {
// implementation
};
int main() {
return 0;
}
Basically, I want to have an unordered_map of children states in a (base) State.
Compile with g++ file.cpp -std=c++11:
In file included from /usr/include/c++/4.8/utility:70:0,
from /usr/include/boost/config/no_tr1/utility.hpp:21,
from /usr/include/boost/config/select_stdlib_config.hpp:37,
from /usr/include/boost/config.hpp:40,
from /usr/include/boost/functional/hash/hash_fwd.hpp:17,
from /usr/include/boost/functional/hash/hash.hpp:13,
from /usr/include/boost/functional/hash.hpp:6,
from tests/../examples/tic_tac_toe.cpp:1,
from tests/test_tic_tac_toe.cpp:3:
/usr/include/c++/4.8/bits/stl_pair.h: In instantiation of ‘struct std::pair<const long unsigned int, TicTacToeState>’:
/usr/include/c++/4.8/type_traits:615:28: required from ‘struct std::__is_destructible_impl<std::pair<const long unsigned int, TicTacToeState> >’
/usr/include/c++/4.8/type_traits:637:12: required from ‘struct std::__is_destructible_safe<std::pair<const long unsigned int, TicTacToeState>, false, false>’
/usr/include/c++/4.8/type_traits:652:12: required from ‘struct std::is_destructible<std::pair<const long unsigned int, TicTacToeState> >’
/usr/include/c++/4.8/type_traits:116:12: required from ‘struct std::__and_<std::is_destructible<std::pair<const long unsigned int, TicTacToeState> >, std::__is_direct_constructible_impl<std::pair<const long unsigned int, TicTacToeState>, const std::pair<const long unsigned int, TicTacToeState>&> >’
/usr/include/c++/4.8/type_traits:817:12: required from ‘struct std::__is_direct_constructible_new_safe<std::pair<const long unsigned int, TicTacToeState>, const std::pair<const long unsigned int, TicTacToeState>&>’
/usr/include/c++/4.8/type_traits:895:12: [ skipping 5 instantiation contexts, use -ftemplate-backtrace-limit=0 to disable ]
/usr/include/c++/4.8/type_traits:974:12: required from ‘struct std::is_copy_constructible<std::pair<const long unsigned int, TicTacToeState> >’
/usr/include/c++/4.8/bits/alloc_traits.h:540:12: required from ‘struct std::__is_copy_insertable<std::allocator<std::pair<const long unsigned int, TicTacToeState> > >’
/usr/include/c++/4.8/bits/alloc_traits.h:560:63: required by substitution of ‘template<class _Alloc> using __check_copy_constructible = std::__allow_copy_cons<std::__is_copy_insertable<_Alloc>::value> [with _Alloc = std::allocator<std::pair<const long unsigned int, TicTacToeState> >]’
/usr/include/c++/4.8/bits/unordered_map.h:97:11: required from ‘class std::unordered_map<long unsigned int, TicTacToeState, std::hash<long unsigned int>, std::equal_to<long unsigned int>, std::allocator<std::pair<const long unsigned int, TicTacToeState> > >’
tests/../examples/../gtsa.hpp:110:30: required from ‘struct State<TicTacToeState, TicTacToeMove>’
tests/../examples/tic_tac_toe.cpp:69:32: required from here
/usr/include/c++/4.8/bits/stl_pair.h:102:11: error: ‘std::pair<_T1, _T2>::second’ has incomplete type
_T2 second; /// #c second is a copy of the second object
^
In file included from tests/test_tic_tac_toe.cpp:3:0:
tests/../examples/tic_tac_toe.cpp:69:8: error: forward declaration of ‘struct TicTacToeState’
struct TicTacToeState : public State<TicTacToeState, TicTacToeMove> {
^
In file included from /usr/include/c++/4.8/utility:70:0,
from /usr/include/boost/config/no_tr1/utility.hpp:21,
from /usr/include/boost/config/select_stdlib_config.hpp:37,
from /usr/include/boost/config.hpp:40,
from /usr/include/boost/functional/hash/hash_fwd.hpp:17,
from /usr/include/boost/functional/hash/hash.hpp:13,
from /usr/include/boost/functional/hash.hpp:6,
from tests/../examples/tic_tac_toe.cpp:1,
from tests/test_tic_tac_toe.cpp:3:
/usr/include/c++/4.8/bits/stl_pair.h: In instantiation of ‘constexpr std::pair<_T1, _T2>::pair(_U1&&, _U2&&) [with _U1 = long unsigned int&; _U2 = TicTacToeState&; <template-parameter-2-3> = void; _T1 = const long unsigned int; _T2 = TicTacToeState]’:
tests/../examples/../gtsa.hpp:640:57: required from ‘S* MonteCarloTreeSearch<S, M>::add_child(S*, M&) [with S = TicTacToeState; M = TicTacToeMove]’
tests/../examples/../gtsa.hpp:472:41: required from ‘S* MonteCarloTreeSearch<S, M>::tree_policy(S*, S*) [with S = TicTacToeState; M = TicTacToeMove]’
tests/../examples/../gtsa.hpp:453:44: required from ‘void MonteCarloTreeSearch<S, M>::monte_carlo_tree_search(S*) [with S = TicTacToeState; M = TicTacToeMove]’
tests/../examples/../gtsa.hpp:433:41: required from ‘M MonteCarloTreeSearch<S, M>::get_move(S*) [with S = TicTacToeState; M = TicTacToeMove]’
tests/test_tic_tac_toe.cpp:123:1: required from here
/usr/include/c++/4.8/bits/stl_pair.h:145:64: error: using invalid field ‘std::pair<_T1, _T2>::second’
: first(std::forward<_U1>(__x)), second(std::forward<_U2>(__y)) { }
^
My understanding is:
I'm asking to create a struct TicTacToeState, it looks what's the base class, aha, it's template, fine, it tries to instantiate State with S = TicTacToeState but fails, because unordered_map<int, S> needs already defined type for map values, but TicTacToeState wasn't defined.
Placing TicTacToeState in front won't help, because then it will have no State declaration at hand.
If somebody would like to have a broader look at the original code, State is defined here. I use CRTP for the first time, maybe I don't need it and it's only complicating the code? I don't know, I haven't found anything simpler.
How to make it work?
Classes/structs can't have members which are incomplete types, so they cannot refer to itself, since they need a definition of itself to form this class.
Since looping over std::unordered_map should give you a reference to std::pair<const Key, Value> it requires a complete type.
So, in order to do something like this, you'll have to use a wrapper class which makes use of allocations, allowing you to first complete the type and use it elsewhere.
In most cases I would use std::unordered_map<int, std::unique_ptr<S>>, though if you really require the element to be created, you can wrap it.
struct SWrapper final
{
SWrapper();
operator S&() { return *_S; }
operator const S&() const { return *_S; }
private:
std::unique_ptr<S> _S;
};
// In .cpp
SWrapper::SWrapper() : _S(std::make_unique<S>()) {}

dijkstra_shortest_paths Boost Graph Lib 1.57.0 fails

I am using BGL and have recently migrated to 1.57.0 from 1.46.1. I also switched from using Xcode on a mac to gcc 4.9.2.
I am getting a no matching function call to get and have created this small snipet of code to illustrate the problem. If I change the INCLUDE path to be 1.46.1, this code works great, its on 1.55.0 and 1.57.0 that it fails.
Any advice appreciated.
Thanks.
#include <boost/config.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/connected_components.hpp>
#include <boost/graph/strong_components.hpp>
#include <boost/graph/dijkstra_shortest_paths.hpp>
struct EdgeDef
{
double dist;
double prop1;
};
typedef boost::adjacency_list < boost::listS, boost::vecS, boost::directedS,boost::no_property,EdgeDef > Graph;
int main() {
Graph g;
std::vector<double> d(num_vertices(g));
std::vector<Graph::vertex_descriptor> p(num_vertices(g));
Graph::vertex_descriptor s = 0;
dijkstra_shortest_paths(g,s,
boost::predecessor_map(&p[0]).distance_map(&d[0]).
weight_map(get(&EdgeDef::dist,g)));
}
Error log from building with gcc
2:37:37 **** Incremental Build of configuration Debug for project TestBGL ****
make all
Building file: ../src/TestBGL.cpp
Invoking: GCC C++ Compiler
/usr/local/bin/g++-4.9 -I/Users/flyboy777/Downloads/boost_1_57_0 -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/TestBGL.d" -MT"src/TestBGL.d" -o "src/TestBGL.o" "../src/TestBGL.cpp"
In file included from ../src/TestBGL.cpp:6:0:
/Users/flyboy777/Downloads/boost_1_57_0/boost/graph/dijkstra_shortest_paths.hpp: In instantiation of 'void boost::detail::dijkstra_bfs_visitor<UniformCostVisitor, UpdatableQueue, WeightMap, PredecessorMap, DistanceMap, BinaryFunction, BinaryPredicate>::gray_target(Edge, Graph&) [with Edge = boost::detail::edge_desc_impl<boost::directed_tag, long unsigned int>; Graph = const boost::adjacency_list<boost::listS, boost::vecS, boost::directedS, boost::no_property, EdgeDef>; UniformCostVisitor = boost::dijkstra_visitor<>; UpdatableQueue = boost::d_ary_heap_indirect<long unsigned int, 4ul, boost::iterator_property_map<long unsigned int*, boost::vec_adj_list_vertex_id_map<boost::no_property, long unsigned int>, long unsigned int, long unsigned int&>, double*, std::less<double>, std::vector<long unsigned int> >; WeightMap = boost::adj_list_edge_property_map<boost::directed_tag, double, double&, long unsigned int, EdgeDef, double EdgeDef::*>; PredecessorMap = long unsigned int*; DistanceMap = double*; BinaryFunction = boost::closed_plus<double>; BinaryPredicate = std::less<double>]':
/Users/flyboy777/Downloads/boost_1_57_0/boost/graph/breadth_first_search.hpp:87:47: required from 'void boost::breadth_first_visit(const IncidenceGraph&, SourceIterator, SourceIterator, Buffer&, BFSVisitor, ColorMap) [with IncidenceGraph = boost::adjacency_list<boost::listS, boost::vecS, boost::directedS, boost::no_property, EdgeDef>; Buffer = boost::d_ary_heap_indirect<long unsigned int, 4ul, boost::iterator_property_map<long unsigned int*, boost::vec_adj_list_vertex_id_map<boost::no_property, long unsigned int>, long unsigned int, long unsigned int&>, double*, std::less<double>, std::vector<long unsigned int> >; BFSVisitor = boost::detail::dijkstra_bfs_visitor<boost::dijkstra_visitor<>, boost::d_ary_heap_indirect<long unsigned int, 4ul, boost::iterator_property_map<long unsigned int*, boost::vec_adj_list_vertex_id_map<boost::no_property, long unsigned int>, long unsigned int, long unsigned int&>, double*, std::less<double>, std::vector<long unsigned int> >, boost::adj_list_edge_property_map<boost::directed_tag, double, double&, long unsigned int, EdgeDef, double EdgeDef::*>, long unsigned int*, double*, boost::closed_plus<double>, std::less<double> >; ColorMap = boost::two_bit_color_map<boost::vec_adj_list_vertex_id_map<boost::no_property, long unsigned int> >; SourceIterator = long unsigned int*]'
/Users/flyboy777/Downloads/boost_1_57_0/boost/graph/dijkstra_shortest_paths.hpp:383:61: required from 'void boost::dijkstra_shortest_paths_no_init(const Graph&, SourceInputIter, SourceInputIter, PredecessorMap, DistanceMap, WeightMap, IndexMap, Compare, Combine, DistZero, DijkstraVisitor, ColorMap) [with Graph = boost::adjacency_list<boost::listS, boost::vecS, boost::directedS, boost::no_property, EdgeDef>; SourceInputIter = long unsigned int*; DijkstraVisitor = boost::dijkstra_visitor<>; PredecessorMap = long unsigned int*; DistanceMap = double*; WeightMap = boost::adj_list_edge_property_map<boost::directed_tag, double, double&, long unsigned int, EdgeDef, double EdgeDef::*>; IndexMap = boost::vec_adj_list_vertex_id_map<boost::no_property, long unsigned int>; Compare = std::less<double>; Combine = boost::closed_plus<double>; DistZero = double; ColorMap = boost::two_bit_color_map<boost::vec_adj_list_vertex_id_map<boost::no_property, long unsigned int> >]'
/Users/flyboy777/Downloads/boost_1_57_0/boost/graph/dijkstra_shortest_paths.hpp:478:34: required from 'void boost::dijkstra_shortest_paths(const VertexListGraph&, SourceInputIter, SourceInputIter, PredecessorMap, DistanceMap, WeightMap, IndexMap, Compare, Combine, DistInf, DistZero, DijkstraVisitor, ColorMap) [with VertexListGraph = boost::adjacency_list<boost::listS, boost::vecS, boost::directedS, boost::no_property, EdgeDef>; SourceInputIter = long unsigned int*; DijkstraVisitor = boost::dijkstra_visitor<>; PredecessorMap = long unsigned int*; DistanceMap = double*; WeightMap = boost::adj_list_edge_property_map<boost::directed_tag, double, double&, long unsigned int, EdgeDef, double EdgeDef::*>; IndexMap = boost::vec_adj_list_vertex_id_map<boost::no_property, long unsigned int>; Compare = std::less<double>; Combine = boost::closed_plus<double>; DistInf = double; DistZero = double; ColorMap = boost::two_bit_color_map<boost::vec_adj_list_vertex_id_map<boost::no_property, long unsigned int> >]'
/Users/flyboy777/Downloads/boost_1_57_0/boost/graph/dijkstra_shortest_paths.hpp:425:34: required from 'void boost::dijkstra_shortest_paths(const VertexListGraph&, SourceInputIter, SourceInputIter, PredecessorMap, DistanceMap, WeightMap, IndexMap, Compare, Combine, DistInf, DistZero, DijkstraVisitor, const boost::bgl_named_params<T, Tag, Base>&, typename boost::enable_if_c<boost::is_base_and_derived<boost::vertex_list_graph_tag, typename boost::graph_traits<Graph>::traversal_category>::value, boost::graph::detail::no_parameter>::type) [with VertexListGraph = boost::adjacency_list<boost::listS, boost::vecS, boost::directedS, boost::no_property, EdgeDef>; SourceInputIter = long unsigned int*; DijkstraVisitor = boost::dijkstra_visitor<>; PredecessorMap = long unsigned int*; DistanceMap = double*; WeightMap = boost::adj_list_edge_property_map<boost::directed_tag, double, double&, long unsigned int, EdgeDef, double EdgeDef::*>; IndexMap = boost::vec_adj_list_vertex_id_map<boost::no_property, long unsigned int>; Compare = std::less<double>; Combine = boost::closed_plus<double>; DistInf = double; DistZero = double; T = char; Tag = boost::detail::unused_tag_type; Base = boost::no_property; typename boost::enable_if_c<boost::is_base_and_derived<boost::vertex_list_graph_tag, typename boost::graph_traits<Graph>::traversal_category>::value, boost::graph::detail::no_parameter>::type = boost::graph::detail::no_parameter]'
/Users/flyboy777/Downloads/boost_1_57_0/boost/graph/dijkstra_shortest_paths.hpp:518:50: required from 'void boost::dijkstra_shortest_paths(const VertexListGraph&, SourceInputIter, SourceInputIter, PredecessorMap, DistanceMap, WeightMap, IndexMap, Compare, Combine, DistInf, DistZero, DijkstraVisitor) [with VertexListGraph = boost::adjacency_list<boost::listS, boost::vecS, boost::directedS, boost::no_property, EdgeDef>; SourceInputIter = long unsigned int*; DijkstraVisitor = boost::dijkstra_visitor<>; PredecessorMap = long unsigned int*; DistanceMap = double*; WeightMap = boost::adj_list_edge_property_map<boost::directed_tag, double, double&, long unsigned int, EdgeDef, double EdgeDef::*>; IndexMap = boost::vec_adj_list_vertex_id_map<boost::no_property, long unsigned int>; Compare = std::less<double>; Combine = boost::closed_plus<double>; DistInf = double; DistZero = double]'
/Users/flyboy777/Downloads/boost_1_57_0/boost/graph/dijkstra_shortest_paths.hpp:446:72: required from 'void boost::dijkstra_shortest_paths(const VertexListGraph&, typename boost::graph_traits<Graph>::vertex_descriptor, PredecessorMap, DistanceMap, WeightMap, IndexMap, Compare, Combine, DistInf, DistZero, DijkstraVisitor, const boost::bgl_named_params<T, Tag, Base>&, typename boost::enable_if_c<boost::is_base_and_derived<boost::vertex_list_graph_tag, typename boost::graph_traits<Graph>::traversal_category>::value, boost::graph::detail::no_parameter>::type) [with VertexListGraph = boost::adjacency_list<boost::listS, boost::vecS, boost::directedS, boost::no_property, EdgeDef>; DijkstraVisitor = boost::dijkstra_visitor<>; PredecessorMap = long unsigned int*; DistanceMap = double*; WeightMap = boost::adj_list_edge_property_map<boost::directed_tag, double, double&, long unsigned int, EdgeDef, double EdgeDef::*>; IndexMap = boost::vec_adj_list_vertex_id_map<boost::no_property, long unsigned int>; Compare = std::less<double>; Combine = boost::closed_plus<double>; DistInf = double; DistZero = double; T = boost::adj_list_edge_property_map<boost::directed_tag, double, double&, long unsigned int, EdgeDef, double EdgeDef::*>; Tag = boost::edge_weight_t; Base = boost::bgl_named_params<double*, boost::vertex_distance_t, boost::bgl_named_params<long unsigned int*, boost::vertex_predecessor_t, boost::no_property> >; typename boost::graph_traits<Graph>::vertex_descriptor = long unsigned int; typename boost::enable_if_c<boost::is_base_and_derived<boost::vertex_list_graph_tag, typename boost::graph_traits<Graph>::traversal_category>::value, boost::graph::detail::no_parameter>::type = boost::graph::detail::no_parameter]'
/Users/flyboy777/Downloads/boost_1_57_0/boost/graph/dijkstra_shortest_paths.hpp:573:16: required from 'void boost::detail::dijkstra_dispatch2(const VertexListGraph&, typename boost::graph_traits<Graph>::vertex_descriptor, DistanceMap, WeightMap, IndexMap, const Params&) [with VertexListGraph = boost::adjacency_list<boost::listS, boost::vecS, boost::directedS, boost::no_property, EdgeDef>; DistanceMap = double*; WeightMap = boost::adj_list_edge_property_map<boost::directed_tag, double, double&, long unsigned int, EdgeDef, double EdgeDef::*>; IndexMap = boost::vec_adj_list_vertex_id_map<boost::no_property, long unsigned int>; Params = boost::bgl_named_params<boost::adj_list_edge_property_map<boost::directed_tag, double, double&, long unsigned int, EdgeDef, double EdgeDef::*>, boost::edge_weight_t, boost::bgl_named_params<double*, boost::vertex_distance_t, boost::bgl_named_params<long unsigned int*, boost::vertex_predecessor_t, boost::no_property> > >; typename boost::graph_traits<Graph>::vertex_descriptor = long unsigned int]'
/Users/flyboy777/Downloads/boost_1_57_0/boost/graph/dijkstra_shortest_paths.hpp:595:35: required from 'void boost::detail::dijkstra_dispatch1(const VertexListGraph&, typename boost::graph_traits<Graph>::vertex_descriptor, DistanceMap, WeightMap, IndexMap, const Params&) [with VertexListGraph = boost::adjacency_list<boost::listS, boost::vecS, boost::directedS, boost::no_property, EdgeDef>; DistanceMap = double*; WeightMap = boost::adj_list_edge_property_map<boost::directed_tag, double, double&, long unsigned int, EdgeDef, double EdgeDef::*>; IndexMap = boost::vec_adj_list_vertex_id_map<boost::no_property, long unsigned int>; Params = boost::bgl_named_params<boost::adj_list_edge_property_map<boost::directed_tag, double, double&, long unsigned int, EdgeDef, double EdgeDef::*>, boost::edge_weight_t, boost::bgl_named_params<double*, boost::vertex_distance_t, boost::bgl_named_params<long unsigned int*, boost::vertex_predecessor_t, boost::no_property> > >; typename boost::graph_traits<Graph>::vertex_descriptor = long unsigned int]'
/Users/flyboy777/Downloads/boost_1_57_0/boost/graph/dijkstra_shortest_paths.hpp:614:14: required from 'void boost::dijkstra_shortest_paths(const VertexListGraph&, typename boost::graph_traits<Graph>::vertex_descriptor, const boost::bgl_named_params<T, Tag, Base>&) [with VertexListGraph = boost::adjacency_list<boost::listS, boost::vecS, boost::directedS, boost::no_property, EdgeDef>; Param = boost::adj_list_edge_property_map<boost::directed_tag, double, double&, long unsigned int, EdgeDef, double EdgeDef::*>; Tag = boost::edge_weight_t; Rest = boost::bgl_named_params<double*, boost::vertex_distance_t, boost::bgl_named_params<long unsigned int*, boost::vertex_predecessor_t, boost::no_property> >; typename boost::graph_traits<Graph>::vertex_descriptor = long unsigned int]'
../src/TestBGL.cpp:26:62: required from here
/Users/flyboy777/Downloads/boost_1_57_0/boost/graph/dijkstra_shortest_paths.hpp:141:54: error: no matching function for call to 'get(double*&, long unsigned int)'
D old_distance = get(m_distance, target(e, g));
^
/Users/flyboy777/Downloads/boost_1_57_0/boost/graph/dijkstra_shortest_paths.hpp:141:54: note: candidate is:
In file included from /Users/flyboy777/Downloads/boost_1_57_0/boost/graph/transpose_graph.hpp:16:0,
from /Users/flyboy777/Downloads/boost_1_57_0/boost/graph/strong_components.hpp:262,
from ../src/TestBGL.cpp:5:
/Users/flyboy777/Downloads/boost_1_57_0/boost/graph/reverse_graph.hpp:433:3: note: template<class E> E boost::detail::get(boost::detail::underlying_edge_desc_map_type<E>, const boost::detail::reverse_graph_edge_descriptor<EdgeDesc>&)
get(underlying_edge_desc_map_type<E> m,
^
/Users/flyboy777/Downloads/boost_1_57_0/boost/graph/reverse_graph.hpp:433:3: note: template argument deduction/substitution failed:
In file included from ../src/TestBGL.cpp:6:0:
/Users/flyboy777/Downloads/boost_1_57_0/boost/graph/dijkstra_shortest_paths.hpp:141:54: note: mismatched types 'boost::detail::underlying_edge_desc_map_type<E>' and 'double*'
D old_distance = get(m_distance, target(e, g));
^
/Users/flyboy777/Downloads/boost_1_57_0/boost/graph/dijkstra_shortest_paths.hpp: In instantiation of 'void boost::detail::dijkstra_bfs_visitor<UniformCostVisitor, UpdatableQueue, WeightMap, PredecessorMap, DistanceMap, BinaryFunction, BinaryPredicate>::gray_target(Edge, Graph&) [with Edge = boost::detail::edge_desc_impl<boost::directed_tag, long unsigned int>; Graph = boost::adjacency_list<boost::listS, boost::vecS, boost::directedS, boost::no_property, EdgeDef>; UniformCostVisitor = boost::dijkstra_visitor<>; UpdatableQueue = boost::d_ary_heap_indirect<long unsigned int, 4ul, boost::iterator_property_map<long unsigned int*, boost::vec_adj_list_vertex_id_map<boost::no_property, long unsigned int>, long unsigned int, long unsigned int&>, double*, std::less<double>, std::vector<long unsigned int> >; WeightMap = boost::adj_list_edge_property_map<boost::directed_tag, double, double&, long unsigned int, EdgeDef, double EdgeDef::*>; PredecessorMap = long unsigned int*; DistanceMap = double*; BinaryFunction = boost::closed_plus<double>; BinaryPredicate = std::less<double>]':
/Users/flyboy777/Downloads/boost_1_57_0/boost/graph/breadth_first_search.hpp:45:7: required from 'void boost::BFSVisitorConcept<Visitor, Graph>::constraints() [with Visitor = boost::detail::dijkstra_bfs_visitor<boost::dijkstra_visitor<>, boost::d_ary_heap_indirect<long unsigned int, 4ul, boost::iterator_property_map<long unsigned int*, boost::vec_adj_list_vertex_id_map<boost::no_property, long unsigned int>, long unsigned int, long unsigned int&>, double*, std::less<double>, std::vector<long unsigned int> >, boost::adj_list_edge_property_map<boost::directed_tag, double, double&, long unsigned int, EdgeDef, double EdgeDef::*>, long unsigned int*, double*, boost::closed_plus<double>, std::less<double> >; Graph = boost::adjacency_list<boost::listS, boost::vecS, boost::directedS, boost::no_property, EdgeDef>]'
/Users/flyboy777/Downloads/boost_1_57_0/boost/concept/detail/has_constraints.hpp:32:62: required by substitution of 'template<class Model> boost::concepts::detail::yes boost::concepts::detail::has_constraints_(Model*, boost::concepts::detail::wrap_constraints<Model, (& Model:: constraints)>*) [with Model = boost::BFSVisitorConcept<boost::detail::dijkstra_bfs_visitor<boost::dijkstra_visitor<>, boost::d_ary_heap_indirect<long unsigned int, 4ul, boost::iterator_property_map<long unsigned int*, boost::vec_adj_list_vertex_id_map<boost::no_property, long unsigned int>, long unsigned int, long unsigned int&>, double*, std::less<double>, std::vector<long unsigned int> >, boost::adj_list_edge_property_map<boost::directed_tag, double, double&, long unsigned int, EdgeDef, double EdgeDef::*>, long unsigned int*, double*, boost::closed_plus<double>, std::less<double> >, boost::adjacency_list<boost::listS, boost::vecS, boost::directedS, boost::no_property, EdgeDef> >]'
/Users/flyboy777/Downloads/boost_1_57_0/boost/concept/detail/has_constraints.hpp:42:5: required from 'const bool boost::concepts::not_satisfied<boost::BFSVisitorConcept<boost::detail::dijkstra_bfs_visitor<boost::dijkstra_visitor<>, boost::d_ary_heap_indirect<long unsigned int, 4ul, boost::iterator_property_map<long unsigned int*, boost::vec_adj_list_vertex_id_map<boost::no_property, long unsigned int>, long unsigned int, long unsigned int&>, double*, std::less<double>, std::vector<long unsigned int> >, boost::adj_list_edge_property_map<boost::directed_tag, double, double&, long unsigned int, EdgeDef, double EdgeDef::*>, long unsigned int*, double*, boost::closed_plus<double>, std::less<double> >, boost::adjacency_list<boost::listS, boost::vecS, boost::directedS, boost::no_property, EdgeDef> > >::value'
/Users/flyboy777/Downloads/boost_1_57_0/boost/concept/detail/has_constraints.hpp:45:31: required from 'struct boost::concepts::not_satisfied<boost::BFSVisitorConcept<boost::detail::dijkstra_bfs_visitor<boost::dijkstra_visitor<>, boost::d_ary_heap_indirect<long unsigned int, 4ul, boost::iterator_property_map<long unsigned int*, boost::vec_adj_list_vertex_id_map<boost::no_property, long unsigned int>, long unsigned int, long unsigned int&>, double*, std::less<double>, std::vector<long unsigned int> >, boost::adj_list_edge_property_map<boost::directed_tag, double, double&, long unsigned int, EdgeDef, double EdgeDef::*>, long unsigned int*, double*, boost::closed_plus<double>, std::less<double> >, boost::adjacency_list<boost::listS, boost::vecS, boost::directedS, boost::no_property, EdgeDef> > >'
/Users/flyboy777/Downloads/boost_1_57_0/boost/mpl/if.hpp:67:11: required from 'struct boost::mpl::if_<boost::concepts::not_satisfied<boost::BFSVisitorConcept<boost::detail::dijkstra_bfs_visitor<boost::dijkstra_visitor<>, boost::d_ary_heap_indirect<long unsigned int, 4ul, boost::iterator_property_map<long unsigned int*, boost::vec_adj_list_vertex_id_map<boost::no_property, long unsigned int>, long unsigned int, long unsigned int&>, double*, std::less<double>, std::vector<long unsigned int> >, boost::adj_list_edge_property_map<boost::directed_tag, double, double&, long unsigned int, EdgeDef, double EdgeDef::*>, long unsigned int*, double*, boost::closed_plus<double>, std::less<double> >, boost::adjacency_list<boost::listS, boost::vecS, boost::directedS, boost::no_property, EdgeDef> > >, boost::concepts::constraint<boost::BFSVisitorConcept<boost::detail::dijkstra_bfs_visitor<boost::dijkstra_visitor<>, boost::d_ary_heap_indirect<long unsigned int, 4ul, boost::iterator_property_map<long unsigned int*, boost::vec_adj_list_vertex_id_map<boost::no_property, long unsigned int>, long unsigned int, long unsigned int&>, double*, std::less<double>, std::vector<long unsigned int> >, boost::adj_list_edge_property_map<boost::directed_tag, double, double&, long unsigned int, EdgeDef, double EdgeDef::*>, long unsigned int*, double*, boost::closed_plus<double>, std::less<double> >, boost::adjacency_list<boost::listS, boost::vecS, boost::directedS, boost::no_property, EdgeDef> > >, boost::concepts::requirement<boost::concepts::failed************ boost::BFSVisitorConcept<boost::detail::dijkstra_bfs_visitor<boost::dijkstra_visitor<>, boost::d_ary_heap_indirect<long unsigned int, 4ul, boost::iterator_property_map<long unsigned int*, boost::vec_adj_list_vertex_id_map<boost::no_property, long unsigned int>, long unsigned int, long unsigned int&>, double*, std::less<double>, std::vector<long unsigned int> >, boost::adj_list_edge_property_map<boost::directed_tag, double, double&, long unsigned int, EdgeDef, double EdgeDef::*>, long unsigned int*, double*, boost::closed_plus<double>, std::less<double> >, boost::adjacency_list<boost::listS, boost::vecS, boost::directedS, boost::no_property, EdgeDef> >::************> >'
/Users/flyboy777/Downloads/boost_1_57_0/boost/concept/detail/general.hpp:50:8: [ skipping 5 instantiation contexts, use -ftemplate-backtrace-limit=0 to disable ]
/Users/flyboy777/Downloads/boost_1_57_0/boost/graph/dijkstra_shortest_paths.hpp:518:50: required from 'void boost::dijkstra_shortest_paths(const VertexListGraph&, SourceInputIter, SourceInputIter, PredecessorMap, DistanceMap, WeightMap, IndexMap, Compare, Combine, DistInf, DistZero, DijkstraVisitor) [with VertexListGraph = boost::adjacency_list<boost::listS, boost::vecS, boost::directedS, boost::no_property, EdgeDef>; SourceInputIter = long unsigned int*; DijkstraVisitor = boost::dijkstra_visitor<>; PredecessorMap = long unsigned int*; DistanceMap = double*; WeightMap = boost::adj_list_edge_property_map<boost::directed_tag, double, double&, long unsigned int, EdgeDef, double EdgeDef::*>; IndexMap = boost::vec_adj_list_vertex_id_map<boost::no_property, long unsigned int>; Compare = std::less<double>; Combine = boost::closed_plus<double>; DistInf = double; DistZero = double]'
/Users/flyboy777/Downloads/boost_1_57_0/boost/graph/dijkstra_shortest_paths.hpp:446:72: required from 'void boost::dijkstra_shortest_paths(const VertexListGraph&, typename boost::graph_traits<Graph>::vertex_descriptor, PredecessorMap, DistanceMap, WeightMap, IndexMap, Compare, Combine, DistInf, DistZero, DijkstraVisitor, const boost::bgl_named_params<T, Tag, Base>&, typename boost::enable_if_c<boost::is_base_and_derived<boost::vertex_list_graph_tag, typename boost::graph_traits<Graph>::traversal_category>::value, boost::graph::detail::no_parameter>::type) [with VertexListGraph = boost::adjacency_list<boost::listS, boost::vecS, boost::directedS, boost::no_property, EdgeDef>; DijkstraVisitor = boost::dijkstra_visitor<>; PredecessorMap = long unsigned int*; DistanceMap = double*; WeightMap = boost::adj_list_edge_property_map<boost::directed_tag, double, double&, long unsigned int, EdgeDef, double EdgeDef::*>; IndexMap = boost::vec_adj_list_vertex_id_map<boost::no_property, long unsigned int>; Compare = std::less<double>; Combine = boost::closed_plus<double>; DistInf = double; DistZero = double; T = boost::adj_list_edge_property_map<boost::directed_tag, double, double&, long unsigned int, EdgeDef, double EdgeDef::*>; Tag = boost::edge_weight_t; Base = boost::bgl_named_params<double*, boost::vertex_distance_t, boost::bgl_named_params<long unsigned int*, boost::vertex_predecessor_t, boost::no_property> >; typename boost::graph_traits<Graph>::vertex_descriptor = long unsigned int; typename boost::enable_if_c<boost::is_base_and_derived<boost::vertex_list_graph_tag, typename boost::graph_traits<Graph>::traversal_category>::value, boost::graph::detail::no_parameter>::type = boost::graph::detail::no_parameter]'
/Users/flyboy777/Downloads/boost_1_57_0/boost/graph/dijkstra_shortest_paths.hpp:573:16: required from 'void boost::detail::dijkstra_dispatch2(const VertexListGraph&, typename boost::graph_traits<Graph>::vertex_descriptor, DistanceMap, WeightMap, IndexMap, const Params&) [with VertexListGraph = boost::adjacency_list<boost::listS, boost::vecS, boost::directedS, boost::no_property, EdgeDef>; DistanceMap = double*; WeightMap = boost::adj_list_edge_property_map<boost::directed_tag, double, double&, long unsigned int, EdgeDef, double EdgeDef::*>; IndexMap = boost::vec_adj_list_vertex_id_map<boost::no_property, long unsigned int>; Params = boost::bgl_named_params<boost::adj_list_edge_property_map<boost::directed_tag, double, double&, long unsigned int, EdgeDef, double EdgeDef::*>, boost::edge_weight_t, boost::bgl_named_params<double*, boost::vertex_distance_t, boost::bgl_named_params<long unsigned int*, boost::vertex_predecessor_t, boost::no_property> > >; typename boost::graph_traits<Graph>::vertex_descriptor = long unsigned int]'
/Users/flyboy777/Downloads/boost_1_57_0/boost/graph/dijkstra_shortest_paths.hpp:595:35: required from 'void boost::detail::dijkstra_dispatch1(const VertexListGraph&, typename boost::graph_traits<Graph>::vertex_descriptor, DistanceMap, WeightMap, IndexMap, const Params&) [with VertexListGraph = boost::adjacency_list<boost::listS, boost::vecS, boost::directedS, boost::no_property, EdgeDef>; DistanceMap = double*; WeightMap = boost::adj_list_edge_property_map<boost::directed_tag, double, double&, long unsigned int, EdgeDef, double EdgeDef::*>; IndexMap = boost::vec_adj_list_vertex_id_map<boost::no_property, long unsigned int>; Params = boost::bgl_named_params<boost::adj_list_edge_property_map<boost::directed_tag, double, double&, long unsigned int, EdgeDef, double EdgeDef::*>, boost::edge_weight_t, boost::bgl_named_params<double*, boost::vertex_distance_t, boost::bgl_named_params<long unsigned int*, boost::vertex_predecessor_t, boost::no_property> > >; typename boost::graph_traits<Graph>::vertex_descriptor = long unsigned int]'
/Users/flyboy777/Downloads/boost_1_57_0/boost/graph/dijkstra_shortest_paths.hpp:614:14: required from 'void boost::dijkstra_shortest_paths(const VertexListGraph&, typename boost::graph_traits<Graph>::vertex_descriptor, const boost::bgl_named_params<T, Tag, Base>&) [with VertexListGraph = boost::adjacency_list<boost::listS, boost::vecS, boost::directedS, boost::no_property, EdgeDef>; Param = boost::adj_list_edge_property_map<boost::directed_tag, double, double&, long unsigned int, EdgeDef, double EdgeDef::*>; Tag = boost::edge_weight_t; Rest = boost::bgl_named_params<double*, boost::vertex_distance_t, boost::bgl_named_params<long unsigned int*, boost::vertex_predecessor_t, boost::no_property> >; typename boost::graph_traits<Graph>::vertex_descriptor = long unsigned int]'
../src/TestBGL.cpp:26:62: required from here
/Users/flyboy777/Downloads/boost_1_57_0/boost/graph/dijkstra_shortest_paths.hpp:141:54: error: no matching function for call to 'get(double*&, long unsigned int)'
/Users/flyboy777/Downloads/boost_1_57_0/boost/graph/dijkstra_shortest_paths.hpp:141:54: note: candidate is:
In file included from /Users/flyboy777/Downloads/boost_1_57_0/boost/graph/transpose_graph.hpp:16:0,
from /Users/flyboy777/Downloads/boost_1_57_0/boost/graph/strong_components.hpp:262,
from ../src/TestBGL.cpp:5:
/Users/flyboy777/Downloads/boost_1_57_0/boost/graph/reverse_graph.hpp:433:3: note: template<class E> E boost::detail::get(boost::detail::underlying_edge_desc_map_type<E>, const boost::detail::reverse_graph_edge_descriptor<EdgeDesc>&)
get(underlying_edge_desc_map_type<E> m,
^
/Users/flyboy777/Downloads/boost_1_57_0/boost/graph/reverse_graph.hpp:433:3: note: template argument deduction/substitution failed:
In file included from ../src/TestBGL.cpp:6:0:
/Users/flyboy777/Downloads/boost_1_57_0/boost/graph/dijkstra_shortest_paths.hpp:141:54: note: mismatched types 'boost::detail::underlying_edge_desc_map_type<E>' and 'double*'
D old_distance = get(m_distance, target(e, g));
^
make: *** [src/TestBGL.o] Error 1
22:37:39 Build Finished (took 2s.330ms)
You should update your code according to changes in property maps in 1.55.
Use make_iterator_property_map instead of raw pointers:
dijkstra_shortest_paths(g,s,
boost::predecessor_map(boost::make_iterator_property_map(p.begin(), get(boost::vertex_index, g))).
distance_map(boost::make_iterator_property_map(d.begin(), get(boost::vertex_index, g))).
weight_map(get(&EdgeDef::dist,g)));
See changes in 1.55 and this bug https://svn.boost.org/trac/boost/ticket/7877

Errors building STLPort

I'm trying to use STLPort in my project, and when I follow the directions in INSTALL.unixes I get compile errors.
I ran ./configure, then make, the output is below. I'm using make 3.81 and gcc 4.6.1 on Ubuntu.
Edit: I tried adding --with-extra-cxxflags="-std=c++ox" and I get a different and smaller set of errors, listed below.
In file included from ../stlport/memory:45:0,
from reachable.cc:16:
../stlport/stl/_shared_ptr.h:377:43: error: function definition does not declare parameters
../stlport/stl/_shared_ptr.h:421:39: error: declaration of ‘operator=’ as non-function
../stlport/stl/_shared_ptr.h:421:26: error: expected ‘;’ at end of member declaration
../stlport/stl/_shared_ptr.h:421:39: error: function definition does not declare parameters
../stlport/stl/_shared_ptr.h:463:17: error: ‘nullptr_t’ has not been declared
../stlport/stl/_shared_ptr.h:536:43: error: function definition does not declare parameters
../stlport/stl/_shared_ptr.h:552:39: error: declaration of ‘operator=’ as non-function
../stlport/stl/_shared_ptr.h:552:26: error: expected ‘;’ at end of member declaration
../stlport/stl/_shared_ptr.h:552:39: error: function definition does not declare parameters
../stlport/stl/_shared_ptr.h:591:17: error: ‘nullptr_t’ has not been declared
In file included from ../stlport/memory:45:0,
from reachable.cc:16:
../stlport/stl/_shared_ptr.h:643:45: error: ‘nullptr_t’ has not been declared
../stlport/stl/_shared_ptr.h:647:18: error: declaration of ‘operator==’ as non-function
../stlport/stl/_shared_ptr.h:647:18: error: ‘nullptr_t’ was not declared in this scope
../stlport/stl/_shared_ptr.h:647:18: note: suggested alternative:
/usr/include/c++/4.6/i686-linux-gnu/./bits/c++config.h:159:29: note: ‘std::nullptr_t’
../stlport/stl/_shared_ptr.h:647:29: error: expected primary-expression before ‘const’
../stlport/stl/_shared_ptr.h:647:50: error: expected primary-expression before ‘>’ token
../stlport/stl/_shared_ptr.h:647:53: error: ‘x’ was not declared in this scope
../stlport/stl/_shared_ptr.h:651:45: error: ‘nullptr_t’ has not been declared
../stlport/stl/_shared_ptr.h:655:18: error: declaration of ‘operator!=’ as non-function
../stlport/stl/_shared_ptr.h:655:18: error: ‘nullptr_t’ was not declared in this scope
../stlport/stl/_shared_ptr.h:655:18: note: suggested alternative:
/usr/include/c++/4.6/i686-linux-gnu/./bits/c++config.h:159:29: note: ‘std::nullptr_t’
../stlport/stl/_shared_ptr.h:655:29: error: expected primary-expression before ‘const’
../stlport/stl/_shared_ptr.h:655:50: error: expected primary-expression before ‘>’ token
../stlport/stl/_shared_ptr.h:655:53: error: ‘x’ was not declared in this scope
../stlport/stl/_shared_ptr.h:660:44: error: ‘nullptr_t’ has not been declared
../stlport/stl/_shared_ptr.h:665:17: error: declaration of ‘operator<’ as non-function
../stlport/stl/_shared_ptr.h:665:17: error: ‘nullptr_t’ was not declared in this scope
../stlport/stl/_shared_ptr.h:665:17: note: suggested alternative:
/usr/include/c++/4.6/i686-linux-gnu/./bits/c++config.h:159:29: note: ‘std::nullptr_t’
../stlport/stl/_shared_ptr.h:665:28: error: expected primary-expression before ‘const’
../stlport/stl/_shared_ptr.h:665:49: error: expected primary-expression before ‘>’ token
../stlport/stl/_shared_ptr.h:665:52: error: ‘x’ was not declared in this scope
../stlport/stl/_shared_ptr.h:669:44: error: ‘nullptr_t’ has not been declared
../stlport/stl/_shared_ptr.h:673:17: error: declaration of ‘operator>’ as non-function
../stlport/stl/_shared_ptr.h:673:17: error: ‘nullptr_t’ was not declared in this scope
../stlport/stl/_shared_ptr.h:673:17: note: suggested alternative:
/usr/include/c++/4.6/i686-linux-gnu/./bits/c++config.h:159:29: note: ‘std::nullptr_t’
../stlport/stl/_shared_ptr.h:673:28: error: expected primary-expression before ‘const’
../stlport/stl/_shared_ptr.h:673:49: error: expected primary-expression before ‘>’ token
../stlport/stl/_shared_ptr.h:673:52: error: ‘x’ was not declared in this scope
../stlport/stl/_shared_ptr.h:677:45: error: ‘nullptr_t’ has not been declared
../stlport/stl/_shared_ptr.h:681:18: error: declaration of ‘operator<=’ as non-function
../stlport/stl/_shared_ptr.h:681:18: error: ‘nullptr_t’ was not declared in this scope
../stlport/stl/_shared_ptr.h:681:18: note: suggested alternative:
/usr/include/c++/4.6/i686-linux-gnu/./bits/c++config.h:159:29: note: ‘std::nullptr_t’
../stlport/stl/_shared_ptr.h:681:29: error: expected primary-expression before ‘const’
../stlport/stl/_shared_ptr.h:681:50: error: expected primary-expression before ‘>’ token
../stlport/stl/_shared_ptr.h:681:53: error: ‘x’ was not declared in this scope
../stlport/stl/_shared_ptr.h:685:45: error: ‘nullptr_t’ has not been declared
../stlport/stl/_shared_ptr.h:689:18: error: declaration of ‘operator>=’ as non-function
../stlport/stl/_shared_ptr.h:689:18: error: ‘nullptr_t’ was not declared in this scope
../stlport/stl/_shared_ptr.h:689:18: note: suggested alternative:
/usr/include/c++/4.6/i686-linux-gnu/./bits/c++config.h:159:29: note: ‘std::nullptr_t’
../stlport/stl/_shared_ptr.h:689:29: error: expected primary-expression before ‘const’
../stlport/stl/_shared_ptr.h:689:50: error: expected primary-expression before ‘>’ token
../stlport/stl/_shared_ptr.h:689:53: error: ‘x’ was not declared in this scope
../stlport/stl/_shared_ptr.h:775:26: error: expected ‘)’ before ‘,’ token
../stlport/stl/_shared_ptr.h:790:26: error: expected ‘)’ before ‘,’ token
../stlport/stl/_shared_ptr.h:917:43: error: function definition does not declare parameters
../stlport/stl/_shared_ptr.h:1160:26: error: expected ‘)’ before ‘,’ token
../stlport/stl/_shared_ptr.h:1175:26: error: expected ‘)’ before ‘,’ token
../stlport/stl/_shared_ptr.h:1296:43: error: function definition does not declare parameters
../stlport/stl/_shared_ptr.h:1553:42: error: ‘nullptr_t’ has not been declared
../stlport/stl/_shared_ptr.h:1557:18: error: declaration of ‘operator==’ as non-function
../stlport/stl/_shared_ptr.h:1557:18: error: ‘nullptr_t’ was not declared in this scope
../stlport/stl/_shared_ptr.h:1557:18: note: suggested alternative:
/usr/include/c++/4.6/i686-linux-gnu/./bits/c++config.h:159:29: note: ‘std::nullptr_t’
../stlport/stl/_shared_ptr.h:1557:29: error: expected primary-expression before ‘const’
../stlport/stl/_shared_ptr.h:1561:42: error: ‘nullptr_t’ has not been declared
../stlport/stl/_shared_ptr.h:1565:18: error: declaration of ‘operator!=’ as non-function
../stlport/stl/_shared_ptr.h:1565:18: error: ‘nullptr_t’ was not declared in this scope
../stlport/stl/_shared_ptr.h:1565:18: note: suggested alternative:
/usr/include/c++/4.6/i686-linux-gnu/./bits/c++config.h:159:29: note: ‘std::nullptr_t’
../stlport/stl/_shared_ptr.h:1565:29: error: expected primary-expression before ‘const’
../stlport/stl/_shared_ptr.h:1569:41: error: ‘nullptr_t’ has not been declared
../stlport/stl/_shared_ptr.h:1573:17: error: declaration of ‘operator<’ as non-function
../stlport/stl/_shared_ptr.h:1573:17: error: ‘nullptr_t’ was not declared in this scope
../stlport/stl/_shared_ptr.h:1573:17: note: suggested alternative:
/usr/include/c++/4.6/i686-linux-gnu/./bits/c++config.h:159:29: note: ‘std::nullptr_t’
../stlport/stl/_shared_ptr.h:1573:28: error: expected primary-expression before ‘const’
../stlport/stl/_shared_ptr.h:1577:42: error: ‘nullptr_t’ has not been declared
../stlport/stl/_shared_ptr.h:1581:18: error: declaration of ‘operator<=’ as non-function
../stlport/stl/_shared_ptr.h:1581:18: error: ‘nullptr_t’ was not declared in this scope
../stlport/stl/_shared_ptr.h:1581:18: note: suggested alternative:
/usr/include/c++/4.6/i686-linux-gnu/./bits/c++config.h:159:29: note: ‘std::nullptr_t’
../stlport/stl/_shared_ptr.h:1581:29: error: expected primary-expression before ‘const’
../stlport/stl/_shared_ptr.h:1585:41: error: ‘nullptr_t’ has not been declared
../stlport/stl/_shared_ptr.h:1589:17: error: declaration of ‘operator>’ as non-function
../stlport/stl/_shared_ptr.h:1589:17: error: ‘nullptr_t’ was not declared in this scope
../stlport/stl/_shared_ptr.h:1589:17: note: suggested alternative:
/usr/include/c++/4.6/i686-linux-gnu/./bits/c++config.h:159:29: note: ‘std::nullptr_t’
../stlport/stl/_shared_ptr.h:1589:28: error: expected primary-expression before ‘const’
../stlport/stl/_shared_ptr.h:1593:42: error: ‘nullptr_t’ has not been declared
../stlport/stl/_shared_ptr.h:1597:18: error: declaration of ‘operator>=’ as non-function
../stlport/stl/_shared_ptr.h:1597:18: error: ‘nullptr_t’ was not declared in this scope
../stlport/stl/_shared_ptr.h:1597:18: note: suggested alternative:
/usr/include/c++/4.6/i686-linux-gnu/./bits/c++config.h:159:29: note: ‘std::nullptr_t’
../stlport/stl/_shared_ptr.h:1597:29: error: expected primary-expression before ‘const’
In file included from ../stlport/stl/_hashtable.h:541:0,
from ../stlport/stl/_unordered_map.h:24,
from ../stlport/unordered_map:28,
from reachable.cc:17:
../stlport/stl/_hashtable.c: In member function ‘stlp_std::pair<stlp_std::priv::_Ht_iterator<typename stlp_std::forward_list<_Val, _All>::iterator, typename _Traits::_NonConstTraits>, bool> stlp_std::hashtable<_Val, _Key, _HF, _Traits, _ExK, _EqK, _All>::insert_unique_noresize(const value_type&) [with _Val = stlp_std::pair<void* const, long unsigned int>, _Key = void*, _HF = stlp_std::hash<void*>, _Traits = stlp_std::priv::_UnorderedMapTraitsT<stlp_std::pair<void* const, long unsigned int> >, _ExK = stlp_std::priv::_Select1st<stlp_std::pair<void* const, long unsigned int> >, _EqK = stlp_std::equal_to<void*>, _All = stlp_std::allocator<stlp_std::pair<void* const, long unsigned int> >, typename _Traits::_NonConstTraits = stlp_std::priv::_NonLocalUnorderedMapTraitsT<stlp_std::pair<void* const, long unsigned int> >, typename stlp_std::forward_list<_Val, _All>::iterator = stlp_std::priv::_Slist_iterator<stlp_std::pair<void* const, long unsigned int>, stlp_std::_Nonconst_traits<stlp_std::pair<void* const, long unsigned int> > >, stlp_std::hashtable<_Val, _Key, _HF, _Traits, _ExK, _EqK, _All>::value_type = stlp_std::pair<void* const, long unsigned int>]’:
../stlport/stl/_hashtable.c:251:41: instantiated from ‘stlp_std::hashtable<_Val, _Key, _HF, _Traits, _ExK, _EqK, _All>::reference stlp_std::hashtable<_Val, _Key, _HF, _Traits, _ExK, _EqK, _All>::_M_insert(const value_type&) [with _Val = stlp_std::pair<void* const, long unsigned int>, _Key = void*, _HF = stlp_std::hash<void*>, _Traits = stlp_std::priv::_UnorderedMapTraitsT<stlp_std::pair<void* const, long unsigned int> >, _ExK = stlp_std::priv::_Select1st<stlp_std::pair<void* const, long unsigned int> >, _EqK = stlp_std::equal_to<void*>, _All = stlp_std::allocator<stlp_std::pair<void* const, long unsigned int> >, stlp_std::hashtable<_Val, _Key, _HF, _Traits, _ExK, _EqK, _All>::reference = stlp_std::pair<void* const, long unsigned int>&, stlp_std::hashtable<_Val, _Key, _HF, _Traits, _ExK, _EqK, _All>::value_type = stlp_std::pair<void* const, long unsigned int>]’
../stlport/stl/_unordered_map.h:130:22: instantiated from ‘_Tp& stlp_std::unordered_map<_Key, _Tp, _HashFcn, _EqualKey, _Alloc>::operator[](const _KT&) [with _KT = void*, _Key = void*, _Tp = long unsigned int, _HashFcn = stlp_std::hash<void*>, _EqualKey = stlp_std::equal_to<void*>, _Alloc = stlp_std::allocator<stlp_std::pair<void* const, long unsigned int> >]’
reachable.cc:45:27: instantiated from here
../stlport/stl/_hashtable.c:206:59: error: use of deleted function ‘stlp_std::pair<_T1, _T2>::pair(stlp_std::pair<_T1, _T2>&&) [with _T1 = stlp_std::priv::_Ht_iterator<stlp_std::priv::_Slist_iterator<stlp_std::pair<void* const, long unsigned int>, stlp_std::_Nonconst_traits<stlp_std::pair<void* const, long unsigned int> > >, stlp_std::priv::_NonLocalUnorderedMapTraitsT<stlp_std::pair<void* const, long unsigned int> > >, _T2 = bool, stlp_std::pair<_T1, _T2> = stlp_std::pair<stlp_std::priv::_Ht_iterator<stlp_std::priv::_Slist_iterator<stlp_std::pair<void* const, long unsigned int>, stlp_std::_Nonconst_traits<stlp_std::pair<void* const, long unsigned int> > >, stlp_std::priv::_NonLocalUnorderedMapTraitsT<stlp_std::pair<void* const, long unsigned int> > >, bool>]’
In file included from ../stlport/stl/_alloc.h:53:0,
from ../stlport/memory:30,
from reachable.cc:16:
../stlport/utility:140:3: error: ‘stlp_std::pair<_T1, _T2>::pair(stlp_std::pair<_T1, _T2>&&) [with _T1 = stlp_std::priv::_Ht_iterator<stlp_std::priv::_Slist_iterator<stlp_std::pair<void* const, long unsigned int>, stlp_std::_Nonconst_traits<stlp_std::pair<void* const, long unsigned int> > >, stlp_std::priv::_NonLocalUnorderedMapTraitsT<stlp_std::pair<void* const, long unsigned int> > >, _T2 = bool, stlp_std::pair<_T1, _T2> = stlp_std::pair<stlp_std::priv::_Ht_iterator<stlp_std::priv::_Slist_iterator<stlp_std::pair<void* const, long unsigned int>, stlp_std::_Nonconst_traits<stlp_std::pair<void* const, long unsigned int> > >, stlp_std::priv::_NonLocalUnorderedMapTraitsT<stlp_std::pair<void* const, long unsigned int> > >, bool>]’ is implicitly deleted because the default definition would be ill-formed:
../stlport/utility:140:3: error: non-static data member ‘stlp_std::pair<stlp_std::priv::_Ht_iterator<stlp_std::priv::_Slist_iterator<stlp_std::pair<void* const, long unsigned int>, stlp_std::_Nonconst_traits<stlp_std::pair<void* const, long unsigned int> > >, stlp_std::priv::_NonLocalUnorderedMapTraitsT<stlp_std::pair<void* const, long unsigned int> > >, bool>::first’ does not have a move constructor or trivial copy constructor
In file included from ../stlport/stl/_hashtable.h:541:0,
from ../stlport/stl/_unordered_map.h:24,
from ../stlport/unordered_map:28,
from reachable.cc:17:
../stlport/stl/_hashtable.c:251:41: instantiated from ‘stlp_std::hashtable<_Val, _Key, _HF, _Traits, _ExK, _EqK, _All>::reference stlp_std::hashtable<_Val, _Key, _HF, _Traits, _ExK, _EqK, _All>::_M_insert(const value_type&) [with _Val = stlp_std::pair<void* const, long unsigned int>, _Key = void*, _HF = stlp_std::hash<void*>, _Traits = stlp_std::priv::_UnorderedMapTraitsT<stlp_std::pair<void* const, long unsigned int> >, _ExK = stlp_std::priv::_Select1st<stlp_std::pair<void* const, long unsigned int> >, _EqK = stlp_std::equal_to<void*>, _All = stlp_std::allocator<stlp_std::pair<void* const, long unsigned int> >, stlp_std::hashtable<_Val, _Key, _HF, _Traits, _ExK, _EqK, _All>::reference = stlp_std::pair<void* const, long unsigned int>&, stlp_std::hashtable<_Val, _Key, _HF, _Traits, _ExK, _EqK, _All>::value_type = stlp_std::pair<void* const, long unsigned int>]’
../stlport/stl/_unordered_map.h:130:22: instantiated from ‘_Tp& stlp_std::unordered_map<_Key, _Tp, _HashFcn, _EqualKey, _Alloc>::operator[](const _KT&) [with _KT = void*, _Key = void*, _Tp = long unsigned int, _HashFcn = stlp_std::hash<void*>, _EqualKey = stlp_std::equal_to<void*>, _Alloc = stlp_std::allocator<stlp_std::pair<void* const, long unsigned int> >]’
reachable.cc:45:27: instantiated from here
../stlport/stl/_hashtable.c:216:54: error: use of deleted function ‘stlp_std::pair<_T1, _T2>::pair(stlp_std::pair<_T1, _T2>&&) [with _T1 = stlp_std::priv::_Ht_iterator<stlp_std::priv::_Slist_iterator<stlp_std::pair<void* const, long unsigned int>, stlp_std::_Nonconst_traits<stlp_std::pair<void* const, long unsigned int> > >, stlp_std::priv::_NonLocalUnorderedMapTraitsT<stlp_std::pair<void* const, long unsigned int> > >, _T2 = bool, stlp_std::pair<_T1, _T2> = stlp_std::pair<stlp_std::priv::_Ht_iterator<stlp_std::priv::_Slist_iterator<stlp_std::pair<void* const, long unsigned int>, stlp_std::_Nonconst_traits<stlp_std::pair<void* const, long unsigned int> > >, stlp_std::priv::_NonLocalUnorderedMapTraitsT<stlp_std::pair<void* const, long unsigned int> > >, bool>]’
../stlport/stl/_hashtable.c:251:41: instantiated from ‘stlp_std::hashtable<_Val, _Key, _HF, _Traits, _ExK, _EqK, _All>::reference stlp_std::hashtable<_Val, _Key, _HF, _Traits, _ExK, _EqK, _All>::_M_insert(const value_type&) [with _Val = stlp_std::pair<void* const, long unsigned int>, _Key = void*, _HF = stlp_std::hash<void*>, _Traits = stlp_std::priv::_UnorderedMapTraitsT<stlp_std::pair<void* const, long unsigned int> >, _ExK = stlp_std::priv::_Select1st<stlp_std::pair<void* const, long unsigned int> >, _EqK = stlp_std::equal_to<void*>, _All = stlp_std::allocator<stlp_std::pair<void* const, long unsigned int> >, stlp_std::hashtable<_Val, _Key, _HF, _Traits, _ExK, _EqK, _All>::reference = stlp_std::pair<void* const, long unsigned int>&, stlp_std::hashtable<_Val, _Key, _HF, _Traits, _ExK, _EqK, _All>::value_type = stlp_std::pair<void* const, long unsigned int>]’
../stlport/stl/_unordered_map.h:130:22: instantiated from ‘_Tp& stlp_std::unordered_map<_Key, _Tp, _HashFcn, _EqualKey, _Alloc>::operator[](const _KT&) [with _KT = void*, _Key = void*, _Tp = long unsigned int, _HashFcn = stlp_std::hash<void*>, _EqualKey = stlp_std::equal_to<void*>, _Alloc = stlp_std::allocator<stlp_std::pair<void* const, long unsigned int> >]’
reachable.cc:45:27: instantiated from here
../stlport/stl/_hashtable.c:219:67: error: use of deleted function ‘stlp_std::pair<_T1, _T2>::pair(stlp_std::pair<_T1, _T2>&&) [with _T1 = stlp_std::priv::_Ht_iterator<stlp_std::priv::_Slist_iterator<stlp_std::pair<void* const, long unsigned int>, stlp_std::_Nonconst_traits<stlp_std::pair<void* const, long unsigned int> > >, stlp_std::priv::_NonLocalUnorderedMapTraitsT<stlp_std::pair<void* const, long unsigned int> > >, _T2 = bool, stlp_std::pair<_T1, _T2> = stlp_std::pair<stlp_std::priv::_Ht_iterator<stlp_std::priv::_Slist_iterator<stlp_std::pair<void* const, long unsigned int>, stlp_std::_Nonconst_traits<stlp_std::pair<void* const, long unsigned int> > >, stlp_std::priv::_NonLocalUnorderedMapTraitsT<stlp_std::pair<void* const, long unsigned int> > >, bool>]’
make[1]: *** [obj/gcc/so/reachable.o] Error 1
make: *** [release-shared] Error 2
It turns out the source I got my copy of STLPort from, git://stlport.git.sourceforge.net/gitroot/stlport/stlport, is much more bleeding edge than I thought. If I grab the stable build from SourceForge it compiles fine.