diff --git a/Hash_map/benchmark/Hash_map/hm.cpp b/Hash_map/benchmark/Hash_map/hm.cpp index c1f114e3f68..7c8b83af85a 100644 --- a/Hash_map/benchmark/Hash_map/hm.cpp +++ b/Hash_map/benchmark/Hash_map/hm.cpp @@ -35,7 +35,6 @@ run(const G& g) typedef typename boost::property_map::const_type VPM; VPM vpm = get(CGAL::vertex_point,g); - std::vector V, V2; std::vector P1, P2; BOOST_FOREACH(vertex_descriptor vd, vertices(g)){ @@ -69,16 +68,17 @@ run(const G& g) std::cerr << "BOOST_FOREACH boost::iterator_range r = vertices(g))\n"; t.reset(); t.start(); boost::iterator_range::vertex_iterator> r = vertices(g); - BOOST_FOREACH(vertex_descriptor& vd, r) { + BOOST_FOREACH(vertex_descriptor vd, r) { typename Map::iterator it = vm.find(vd); v = v + ((*it).second - CGAL::ORIGIN); } t.stop(); std::cerr << " " <::vertex_iterator> ir = vertices(g); - BOOST_FOREACH(vertex_descriptor& vd, ir) { + BOOST_FOREACH(vertex_descriptor vd, ir) { typename Map::iterator it = vm.find(vd); v = v + ((*it).second - CGAL::ORIGIN); } @@ -91,7 +91,7 @@ run(const G& g) v = v + ((*it).second - CGAL::ORIGIN); } t.stop(); std::cerr << " " <(m); + //std::cerr << num_vertices(m) << " items\n"; + //std::cerr << "\nSurface_mesh std::map"<< std::endl; + //run(m); std::cerr << "\nSurface_mesh std::unordered_map"<< std::endl; run(m); std::cerr << "\nSurface_mesh boost::unordered_map"<< std::endl; run(m); } - +#if 0 { typedef CGAL::Polyhedron_3 Mesh; typedef boost::graph_traits::vertex_descriptor vertex_descriptor; @@ -187,6 +188,7 @@ int main(int , char* argv[]) std::cerr << " std::unordered_map: " << t.time() << " sec.\n"; } } - +#endif + return 0; } diff --git a/STL_Extension/include/CGAL/Iterator_range.h b/STL_Extension/include/CGAL/Iterator_range.h index 3d356fc25c7..f4448dac400 100644 --- a/STL_Extension/include/CGAL/Iterator_range.h +++ b/STL_Extension/include/CGAL/Iterator_range.h @@ -45,6 +45,11 @@ namespace CGAL { : Base(b,e) {} + + // Iterator_range(const Iterator_range& ip) + // : Base(ip) + // {} + Iterator_range(const std::pair& ip) : Base(ip) {} @@ -90,9 +95,19 @@ namespace CGAL { { return x.second; } + + + } // namespace CGAL +// At global scope... + template +inline boost::mpl::true_ * + boost_foreach_is_lightweight_proxy( CGAL::Iterator_range *&, boost::foreach::tag ) +{ + return 0; +} namespace boost { namespace foreach { template