output of Debug-build: 1st way: (0,1) (1,2) (2,3) (3,0) 2nd way: (0,1) (1,2) (2,3) (3,0) 3rd way: (0,1) (1,2) (2,3) (3,0) output of Release-build: 1st way: (0,1) (1,2) (2,3) (3,0) 2nd way: (0,1) (0,1) (0,1) (0,1) 3rd way: (0,0) (0,0) (0,0) (0,0) compilation error: In file included from /usr/include/boost/graph/adjacency_list.hpp:337:0, from /home/anders/Desktop/sandbox/bgl_iterator/main.cpp:11: /home/anders/Desktop/sandbox/bgl_iterator/main.cpp: In function ‘typename boost::property_map::type boost::detail::get_dispatch(boost::adj_list_helper&, Property, boost::edge_property_tag) [with Config = boost::detail::adj_list_gen, boost::vecS, boost::listS, boost::bidirectionalS, boost::no_property, boost::property, boost::no_property, boost::listS>::config, Base = boost::bidirectional_graph_helper_with_property, boost::vecS, boost::listS, boost::bidirectionalS, boost::no_property, boost::property, boost::no_property, boost::listS>::config>, Property = boost::edge_bundle_t, typename boost::property_map::type = boost::adj_list_edge_property_map, boost::edge_bundle_t>]’: /usr/include/boost/graph/detail/adjacency_list.hpp:1695:47: instantiated from ‘typename boost::property_map::type boost::get(Property, boost::adj_list_helper&) [with Config = boost::detail::adj_list_gen, boost::vecS, boost::listS, boost::bidirectionalS, boost::no_property, boost::property, boost::no_property, boost::listS>::config, Base = boost::bidirectional_graph_helper_with_property, boost::vecS, boost::listS, boost::bidirectionalS, boost::no_property, boost::property, boost::no_property, boost::listS>::config>, Property = boost::edge_bundle_t, typename boost::property_map::type = boost::adj_list_edge_property_map, boost::edge_bundle_t>]’ /usr/include/boost/graph/adjacency_list.hpp:482:39: instantiated from ‘boost::adjacency_list::edge_bundled& boost::adjacency_list::operator[](boost::adjacency_list::edge_descriptor) [with OutEdgeListS = boost::listS, VertexListS = boost::vecS, DirectedS = boost::bidirectionalS, VertexProperty = boost::no_property, EdgeProperty = EdgeProperty, GraphProperty = boost::no_property, EdgeListS = boost::listS, boost::adjacency_list::edge_bundled = EdgeProperty, boost::adjacency_list::edge_descriptor = boost::detail::edge_desc_impl]’ /sandbox/bgl_iterator/main.cpp:49:30: instantiated from here /sandbox/bgl_iterator/main.cpp:33:34: warning: shadowed declaration is here [-Wshadow]