diff --git a/Envelope_2/include/CGAL/Envelope_2/Env_divide_and_conquer_2_impl.h b/Envelope_2/include/CGAL/Envelope_2/Env_divide_and_conquer_2_impl.h index af0f793f4ed..f813f8ccc9a 100644 --- a/Envelope_2/include/CGAL/Envelope_2/Env_divide_and_conquer_2_impl.h +++ b/Envelope_2/include/CGAL/Envelope_2/Env_divide_and_conquer_2_impl.h @@ -609,9 +609,7 @@ _merge_two_intervals(Edge_const_handle e1, bool is_leftmost1, // This is the rightmost vertex in the current minimization diagram (out_d). // The intersection points/curves that interest us are the ones in // [v_leftmost, v]. - // Without using make_optional we get a "maybe uninitialized" warning with gcc -Wall - std::optional v_leftmost = - std::make_optional(false, Vertex_const_handle()); + std::optional v_leftmost; if (is_leftmost1 == true) { if (is_leftmost2 == false) diff --git a/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h b/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h index d2f1065785a..81140cdc66e 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h +++ b/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h @@ -1524,7 +1524,7 @@ change_ball_size(const Vertex_handle& v, const FT squared_size, const bool speci Bare_point p = cp(c3t3_.triangulation().point(v)); // intentional copy // Remove v from the set of corners - std::optional corner_index = std::make_optional(false, Corner_index()); + std::optional corner_index; if ( c3t3_.is_in_complex(v) ) { corner_index = c3t3_.corner_index(v); diff --git a/Periodic_3_mesh_3/include/CGAL/Periodic_3_mesh_3/Protect_edges_sizing_field.h b/Periodic_3_mesh_3/include/CGAL/Periodic_3_mesh_3/Protect_edges_sizing_field.h index d46e847a2c0..e35eb180ba6 100644 --- a/Periodic_3_mesh_3/include/CGAL/Periodic_3_mesh_3/Protect_edges_sizing_field.h +++ b/Periodic_3_mesh_3/include/CGAL/Periodic_3_mesh_3/Protect_edges_sizing_field.h @@ -2479,7 +2479,7 @@ change_ball_size(Vertex_handle& v, const FT squared_size, const bool special_bal const Bare_point p = cp(c3t3_.triangulation().point(v)); // intentional copy // Remove v from the set of corners - std::optional corner_index = std::make_optional(false, Corner_index()); + std::optional corner_index; if(c3t3_.is_in_complex(v)) { corner_index = c3t3_.corner_index(v); diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_corefinement_and_constraints.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_corefinement_and_constraints.cpp index 3f3af6c44ae..7642f81f493 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_corefinement_and_constraints.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_corefinement_and_constraints.cpp @@ -167,8 +167,8 @@ void test_bool_op_no_copy( typedef std::optional OTM; Triangle_mesh *ptr = nullptr; const std::array output = - reverse ? CGAL::make_array(OTM(&tm2), OTM(&tm1), std::make_optional(false,ptr), std::make_optional(false,ptr)) - : CGAL::make_array(OTM(&tm1), OTM(&tm2), std::make_optional(false,ptr), std::make_optional(false,ptr)); + reverse ? CGAL::make_array(OTM(&tm2), OTM(&tm1), std::optional(), std::optional()) + : CGAL::make_array(OTM(&tm1), OTM(&tm2), std::optional(), std::optional()); PMP::corefine_and_compute_boolean_operations(tm1, tm2, output, diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Point_inside_polyhedron_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Point_inside_polyhedron_plugin.cpp index a25fa8072f0..85238d26ff4 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Point_inside_polyhedron_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Point_inside_polyhedron_plugin.cpp @@ -189,8 +189,7 @@ public Q_SLOTS: void on_Sample_random_points_from_bbox() { // calculate bbox of selected polyhedron items - std::optional bbox - = std::make_optional(false, CGAL::Three::Scene_interface::Bbox()); + std::optional bbox; // Workaround a bug in g++-4.8.3: // https://stackoverflow.com/a/21755207/1728537 // Using std::make_optional to copy-initialize 'bbox' hides the diff --git a/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.h b/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.h index 15b6171cf28..a65e7adf764 100644 --- a/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.h +++ b/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.h @@ -295,9 +295,7 @@ public: constVPmap vpm = get(CGAL::vertex_point, *polyhedron()); - std::optional item_bbox - = std::make_optional(false, CGAL::Bbox_3()); - + std::optional item_bbox; for(Selection_set_vertex::const_iterator v_it = selected_vertices.begin(); v_it != selected_vertices.end(); ++v_it) {