diff --git a/Point_set_3/include/CGAL/Point_set_3.h b/Point_set_3/include/CGAL/Point_set_3.h index 7a006c3d10a..0103389b0b6 100644 --- a/Point_set_3/include/CGAL/Point_set_3.h +++ b/Point_set_3/include/CGAL/Point_set_3.h @@ -17,6 +17,7 @@ #include +#include #include @@ -933,15 +934,15 @@ public: /*! \brief Returns a vector of pairs that describe properties and associated types. */ - std::vector > properties_and_types() const + std::vector > properties_and_types() const { std::vector prop = m_base.properties(); prop.erase (prop.begin()); // remove "index" prop.erase (prop.begin()); // remove "point" - std::vector > out; out.reserve (prop.size()); + std::vector > out; out.reserve (prop.size()); for (std::size_t i = 0; i < prop.size(); ++ i) - out.push_back (std::make_pair (prop[i], m_base.get_type(prop[i]))); + out.push_back (std::make_pair (prop[i], std::type_index(m_base.get_type(prop[i])))); return out; } diff --git a/Point_set_3/test/Point_set_3/point_set_test.cpp b/Point_set_3/test/Point_set_3/point_set_test.cpp index 4accb458dfa..3089af3eca1 100644 --- a/Point_set_3/test/Point_set_3/point_set_test.cpp +++ b/Point_set_3/test/Point_set_3/point_set_test.cpp @@ -106,6 +106,11 @@ int main (int, char**) point_set.add_property_map ("label", 0); point_set.add_property_map ("intensity", 0.0); + auto pnt = point_set.properties_and_types(); + std::cerr << "Properties = " << std::endl; + for (const auto& p : pnt) + std::cerr << " * " << p.first << " with type " << p.second.name() << std::endl; + test (point_set.base().n_properties() == 4, "point set should have 4 properties."); Point p_before = *(point_set.points().begin());