From f0e03e997a83f7b8eae9317f23f2565730f66ff5 Mon Sep 17 00:00:00 2001 From: Simon Giraudot Date: Tue, 11 Jul 2017 14:20:16 +0200 Subject: [PATCH] Some more internal adaptions of read_ply_points --- .../include/CGAL/IO/read_ply_points.h | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/Point_set_processing_3/include/CGAL/IO/read_ply_points.h b/Point_set_processing_3/include/CGAL/IO/read_ply_points.h index 7b41878ae53..a40a5e0a7d6 100644 --- a/Point_set_processing_3/include/CGAL/IO/read_ply_points.h +++ b/Point_set_processing_3/include/CGAL/IO/read_ply_points.h @@ -478,17 +478,17 @@ namespace internal { template bool does_tag_exist (const char* tag, Type) { - for (std::size_t i = 0; i < m_point_properties.size (); ++ i) - if (m_point_properties[i]->name () == tag) - return (dynamic_cast*>(m_point_properties[i]) != NULL); + for (std::size_t i = 0; i < m_properties->size (); ++ i) + if ((*m_properties)[i]->name () == tag) + return (dynamic_cast*>((*m_properties)[i]) != NULL); return false; } bool does_tag_exist (const char* tag, double) { - for (std::size_t i = 0; i < m_point_properties.size (); ++ i) - if (m_point_properties[i]->name () == tag) - return (dynamic_cast*>(m_point_properties[i]) != NULL - || dynamic_cast*>(m_point_properties[i]) != NULL); + for (std::size_t i = 0; i < m_properties->size (); ++ i) + if ((*m_properties)[i]->name () == tag) + return (dynamic_cast*>((*m_properties)[i]) != NULL + || dynamic_cast*>((*m_properties)[i]) != NULL); return false; } @@ -586,7 +586,7 @@ namespace internal { typename NextPropertyBinder, typename ... PropertyMapBinders> void process_properties (PLY_reader& reader, OutputValueType& new_element, - std::tuple...>& current, + std::tuple...>&& current, NextPropertyBinder&& next, PropertyMapBinders&& ... properties) { @@ -596,7 +596,8 @@ namespace internal { PmapValueType new_value = call_functor(std::get<1>(current), values); put (std::get<0>(current), new_element, new_value); - process_properties (reader, new_element, next, properties...); + process_properties (reader, new_element, std::forward(next), + std::forward(properties)...); } @@ -612,14 +613,15 @@ namespace internal { template void process_properties (PLY_reader& reader, OutputValueType& new_element, - std::pair >& current, + std::pair >&& current, NextPropertyBinder&& next, PropertyMapBinders&& ... properties) { T new_value = T(); reader.assign (new_value, current.second.name); put (current.first, new_element, new_value); - process_properties (reader, new_element, next, properties...); + process_properties (reader, new_element, std::forward(next), + std::forward(properties)...); } } // namespace PLY