diff --git a/BGL/include/CGAL/boost/graph/IO/PLY.h b/BGL/include/CGAL/boost/graph/IO/PLY.h index 406bf87c603..f44128e8d9c 100644 --- a/BGL/include/CGAL/boost/graph/IO/PLY.h +++ b/BGL/include/CGAL/boost/graph/IO/PLY.h @@ -370,15 +370,11 @@ bool write_PLY(std::ostream& os, bool has_vcolor = !is_default_parameter::value; bool has_fcolor = !is_default_parameter::value; - bool has_vnormal; + bool has_vnormal = false; if constexpr (!parameters::is_default_parameter::value) { has_vnormal = true; } - else - { - has_vnormal = false; - } VIMap vim = CGAL::get_initialized_vertex_index_map(g, np); Vpm vpm = choose_parameter(get_parameter(np, internal_np::vertex_point), get_const_property_map(boost::vertex_point, g)); @@ -416,7 +412,7 @@ bool write_PLY(std::ostream& os, << "property uchar alpha" << std::endl; } - if constexpr (!parameters::is_default_parameter::value) + if(has_vnormal) { auto vnm = get_parameter(np, internal_np::vertex_normal_map); typedef decltype(vnm) Normal_map;