diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_pair_analysis_2.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_pair_analysis_2.h index 97b0c3f63d0..28e270f0fac 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_pair_analysis_2.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_pair_analysis_2.h @@ -1435,7 +1435,13 @@ compute_event_x_coordinates_with_event_indices() const { CGAL_ACK_DEBUG_PRINT << " one curve event" << std::endl; #endif */ +#if CGAL_CXX11 + // Fix a warning by using `emplace_back()` instead of + // copying a non-initialized `optional + this->ptr()->event_slices.emplace_back(); +#else this->ptr()->event_slices.push_back(Lazy_status_line_CPA_1()); +#endif switch(*(one_curve_it++)) { case(CGAL::internal::ROOT_OF_FIRST_SET): { event_indices.push_back(Event_indices(-1,f_count,-1)); @@ -1462,8 +1468,11 @@ compute_event_x_coordinates_with_event_indices() const { CGAL_ACK_DEBUG_PRINT << " two curve event" << std::endl; #endif */ - this->ptr()-> - event_slices.push_back(Lazy_status_line_CPA_1()); +#if CGAL_CXX11 + this->ptr()->event_slices.emplace_back(); +#else + this->ptr()->event_slices.push_back(Lazy_status_line_CPA_1()); +#endif event_indices.push_back (Event_indices(inter_count,-1,-1)); @@ -1477,7 +1486,11 @@ compute_event_x_coordinates_with_event_indices() const { << std::endl; #endif */ +#if CGAL_CXX11 + this->ptr()->event_slices.emplace_back(); +#else this->ptr()->event_slices.push_back(Lazy_status_line_CPA_1()); +#endif switch(*(one_curve_it++)) {