From 9acf3d4b19ba040567e21de3a361c1021f586a5b Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Mon, 3 May 2021 15:37:20 +0200 Subject: [PATCH 1/5] Add missing fallbacks for IO functions and result_of --- BGL/include/CGAL/boost/graph/IO/INP.h | 20 ++++++++++++++++++- BGL/include/CGAL/boost/graph/IO/OFF.h | 6 ++++++ Installation/include/CGAL/config.h | 1 + .../include/CGAL/IO/write_xyz_points.h | 2 +- .../include/CGAL/Surface_mesh/IO/PLY.h | 5 +++++ 5 files changed, 32 insertions(+), 2 deletions(-) diff --git a/BGL/include/CGAL/boost/graph/IO/INP.h b/BGL/include/CGAL/boost/graph/IO/INP.h index fbc15b04d96..818e10386ed 100644 --- a/BGL/include/CGAL/boost/graph/IO/INP.h +++ b/BGL/include/CGAL/boost/graph/IO/INP.h @@ -96,8 +96,26 @@ bool write_INP(const std::string& fname, const std::string& type, const Graph& g return write_INP(fname, type, g, parameters::all_default()); } +#ifndef CGAL_NO_DEPRECATED_CODE +template +CGAL_DEPRECATED bool write_inp(std::ostream& os, + const FaceGraph& g, + std::string name, + std::string type, + const NamedParameters& np) +{ + return write_INP(os, name, type, g, np); +} +template +CGAL_DEPRECATED bool write_inp(std::ostream& os, + const FaceGraph& g, + std::string name, + std::string type) +{ + return write_INP(os, name, type, g, parameters::all_default()); +} +#endif /// \endcond - } // namespace CGAL #endif // CGAL_BGL_IO_INP_H diff --git a/BGL/include/CGAL/boost/graph/IO/OFF.h b/BGL/include/CGAL/boost/graph/IO/OFF.h index 57685046e79..e2d647d0c59 100644 --- a/BGL/include/CGAL/boost/graph/IO/OFF.h +++ b/BGL/include/CGAL/boost/graph/IO/OFF.h @@ -312,6 +312,12 @@ CGAL_DEPRECATED bool read_off(const char* fname, Graph& g) return read_off(fname, g, parameters::all_default()); } +template +CGAL_DEPRECATED bool read_off(const std::string& fname, Graph& g) +{ + return read_off(fname.c_str(), g, parameters::all_default()); +} + #endif // CGAL_NO_DEPRECATED_CODE //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/Installation/include/CGAL/config.h b/Installation/include/CGAL/config.h index 76d6fd9366c..aa9724b90d5 100644 --- a/Installation/include/CGAL/config.h +++ b/Installation/include/CGAL/config.h @@ -641,6 +641,7 @@ namespace CGAL { using std::is_enum; using std::unordered_set; using std::unordered_map; + using std::result_of; } // namespace cpp0x = cpp11; diff --git a/Point_set_processing_3/include/CGAL/IO/write_xyz_points.h b/Point_set_processing_3/include/CGAL/IO/write_xyz_points.h index 5ccfa93d943..16c8d0e814d 100644 --- a/Point_set_processing_3/include/CGAL/IO/write_xyz_points.h +++ b/Point_set_processing_3/include/CGAL/IO/write_xyz_points.h @@ -324,7 +324,7 @@ CGAL_DEPRECATED bool write_xyz_points(std::ostream& os, const PointRange& points template CGAL_DEPRECATED bool write_xyz_points(std::ostream& os, const PointRange& points) { - return write_XYZ(os, points, parameters::all_default(points)); + return write_XYZ(os, points, parameters::all_default()); } /// \endcond diff --git a/Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h b/Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h index f19a3b9d9b2..0a8c631bb8f 100644 --- a/Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h +++ b/Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h @@ -1140,6 +1140,11 @@ CGAL_DEPRECATED bool write_ply(std::ostream& os, const Surface_mesh

& sm, cons return write_PLY(os, sm, comments); } +template +CGAL_DEPRECATED bool write_ply(std::ostream& os, const Surface_mesh

& sm) +{ + return write_PLY(os, sm, ""); +} #endif // CGAL_NO_DEPRECATED_CODE } // namespace CGAL From e775ed2ebc21b63a86235eed3dc7c6658b199f07 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Tue, 4 May 2021 10:10:43 +0200 Subject: [PATCH 2/5] use CGAL/result_of instead of std::result_of in config.h --- Installation/include/CGAL/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Installation/include/CGAL/config.h b/Installation/include/CGAL/config.h index aa9724b90d5..cf339cadfe3 100644 --- a/Installation/include/CGAL/config.h +++ b/Installation/include/CGAL/config.h @@ -623,6 +623,7 @@ using std::max; # include # include # include +# include // namespace CGAL { // @@ -641,7 +642,6 @@ namespace CGAL { using std::is_enum; using std::unordered_set; using std::unordered_map; - using std::result_of; } // namespace cpp0x = cpp11; From 9533a9fea8e307d51b772318fd33ae9292da957f Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Tue, 4 May 2021 10:43:26 +0200 Subject: [PATCH 3/5] remove CGAL/result_of.h and move its content to config.h --- .../internal/Generic_random_point_generator.h | 1 - Installation/include/CGAL/config.h | 8 +- .../include/CGAL/Periodic_3_triangulation_3.h | 1 - ...ic_4_hyperbolic_Delaunay_triangulation_2.h | 1 - STL_Extension/include/CGAL/result_of.h | 73 ------------------- .../CGAL/Manhattan_distance_iso_box_point.h | 1 - .../include/CGAL/Regular_triangulation_3.h | 1 - 7 files changed, 7 insertions(+), 79 deletions(-) delete mode 100644 STL_Extension/include/CGAL/result_of.h diff --git a/Generator/include/CGAL/internal/Generic_random_point_generator.h b/Generator/include/CGAL/internal/Generic_random_point_generator.h index 76c52dd55cb..a161df1da76 100644 --- a/Generator/include/CGAL/internal/Generic_random_point_generator.h +++ b/Generator/include/CGAL/internal/Generic_random_point_generator.h @@ -18,7 +18,6 @@ #include #include #include -#include #include diff --git a/Installation/include/CGAL/config.h b/Installation/include/CGAL/config.h index cf339cadfe3..007ac147dcf 100644 --- a/Installation/include/CGAL/config.h +++ b/Installation/include/CGAL/config.h @@ -623,7 +623,6 @@ using std::max; # include # include # include -# include // namespace CGAL { // @@ -642,6 +641,13 @@ namespace CGAL { using std::is_enum; using std::unordered_set; using std::unordered_map; +#if CGAL_CXX20 || __cpp_lib_is_invocable>=201703L + template class result_of; + template + class result_of : public std::invoke_result { }; +#else + using std::result_of; +#endif } // namespace cpp0x = cpp11; diff --git a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3.h b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3.h index 380e9b70f86..579dc2edede 100644 --- a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3.h +++ b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3.h @@ -22,7 +22,6 @@ #include #include -#include #include #include #include diff --git a/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_Delaunay_triangulation_2.h b/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_Delaunay_triangulation_2.h index 0c74a7a8be4..3b17771004c 100644 --- a/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_Delaunay_triangulation_2.h +++ b/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_Delaunay_triangulation_2.h @@ -24,7 +24,6 @@ #include #include -#include #include #include diff --git a/STL_Extension/include/CGAL/result_of.h b/STL_Extension/include/CGAL/result_of.h deleted file mode 100644 index 863ddb90806..00000000000 --- a/STL_Extension/include/CGAL/result_of.h +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) 2013 -// Utrecht University (The Netherlands), -// ETH Zurich (Switzerland), -// INRIA Sophia-Antipolis (France), -// Max-Planck-Institute Saarbruecken (Germany), -// and Tel-Aviv University (Israel). All rights reserved. -// -// This file is part of CGAL (www.cgal.org) -// -// $URL$ -// $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// -// -// Author(s) : Sebastien Loriot - - -#ifndef CGAL_RESULT_OF_H -#define CGAL_RESULT_OF_H - -#include -#include - -#if CGAL_CXX20 || __cpp_lib_is_invocable>=201703L - - // C++>=17 - -#elif CGAL_CXX11 - - #include - -#else // C++<11 - - // Address the warning C4003: not enough actual parameters for macro 'BOOST_PP_SEQ_DETAIL_IS_NOT_EMPTY' - // result_of.hpp includes files from boost/preprocessor - // This concerns boost 1_65_1 - #if defined(BOOST_MSVC) - #pragma warning(push) - #pragma warning(disable: 4003) - #endif - #include - #if defined(BOOST_MSVC) - #pragma warning(pop) - #endif - #include - -#endif // end C++<11 - -namespace CGAL { -namespace cpp11 { - -#if CGAL_CXX20 || __cpp_lib_is_invocable>=201703L - - template class result_of; - template - class result_of : public std::invoke_result { }; - -#elif CGAL_CXX11 - - using std::result_of; - -#else // C++<11 - - using boost::result_of; - -#endif // end C++<11 - -} // end cpp11 -} // end CGAL - -#include - -#endif // CGAL_RESULT_OF_H diff --git a/Spatial_searching/include/CGAL/Manhattan_distance_iso_box_point.h b/Spatial_searching/include/CGAL/Manhattan_distance_iso_box_point.h index 16ffe439eaa..cd348d178e3 100644 --- a/Spatial_searching/include/CGAL/Manhattan_distance_iso_box_point.h +++ b/Spatial_searching/include/CGAL/Manhattan_distance_iso_box_point.h @@ -17,7 +17,6 @@ #include -#include #include #include #include diff --git a/Triangulation_3/include/CGAL/Regular_triangulation_3.h b/Triangulation_3/include/CGAL/Regular_triangulation_3.h index 34186b034a0..c65d42e9bf8 100644 --- a/Triangulation_3/include/CGAL/Regular_triangulation_3.h +++ b/Triangulation_3/include/CGAL/Regular_triangulation_3.h @@ -38,7 +38,6 @@ #include #include #include -#include #ifndef CGAL_TRIANGULATION_3_DONT_INSERT_RANGE_OF_POINTS_WITH_INFO #include From 902802713162264d66b675c989457dd74c876671 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Fri, 7 May 2021 12:54:40 +0200 Subject: [PATCH 4/5] Restore result_of.h and deprecate it --- STL_Extension/include/CGAL/result_of.h | 76 ++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 STL_Extension/include/CGAL/result_of.h diff --git a/STL_Extension/include/CGAL/result_of.h b/STL_Extension/include/CGAL/result_of.h new file mode 100644 index 00000000000..87329e362b7 --- /dev/null +++ b/STL_Extension/include/CGAL/result_of.h @@ -0,0 +1,76 @@ +// Copyright (c) 2013 +// Utrecht University (The Netherlands), +// ETH Zurich (Switzerland), +// INRIA Sophia-Antipolis (France), +// Max-Planck-Institute Saarbruecken (Germany), +// and Tel-Aviv University (Israel). All rights reserved. +// +// This file is part of CGAL (www.cgal.org) +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// +// +// Author(s) : Sebastien Loriot + + +#ifndef CGAL_RESULT_OF_H +#define CGAL_RESULT_OF_H + +#define CGAL_DEPRECATED_HEADER "" +#define CGAL_REPLACEMENT_HEADER "" + +#include +#include + +#if CGAL_CXX20 || __cpp_lib_is_invocable>=201703L + + // C++>=17 + +#elif CGAL_CXX11 + + #include + +#else // C++<11 + + // Address the warning C4003: not enough actual parameters for macro 'BOOST_PP_SEQ_DETAIL_IS_NOT_EMPTY' + // result_of.hpp includes files from boost/preprocessor + // This concerns boost 1_65_1 + #if defined(BOOST_MSVC) + #pragma warning(push) + #pragma warning(disable: 4003) + #endif + #include + #if defined(BOOST_MSVC) + #pragma warning(pop) + #endif + #include + +#endif // end C++<11 + +namespace CGAL { +namespace cpp11 { + +#if CGAL_CXX20 || __cpp_lib_is_invocable>=201703L + + template class result_of; + template + class result_of : public std::invoke_result { }; + +#elif CGAL_CXX11 + + using std::result_of; + +#else // C++<11 + + using boost::result_of; + +#endif // end C++<11 + +} // end cpp11 +} // end CGAL + +#include + +#endif // CGAL_RESULT_OF_H From 0b229ae0430b69231067da224ec26aaca6859101 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Mon, 17 May 2021 11:57:44 +0200 Subject: [PATCH 5/5] move result_of out of deprecated_code. It is not deprecated, we need the wokaround for c++20 --- Installation/include/CGAL/config.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Installation/include/CGAL/config.h b/Installation/include/CGAL/config.h index 007ac147dcf..a848194d68b 100644 --- a/Installation/include/CGAL/config.h +++ b/Installation/include/CGAL/config.h @@ -641,13 +641,6 @@ namespace CGAL { using std::is_enum; using std::unordered_set; using std::unordered_map; -#if CGAL_CXX20 || __cpp_lib_is_invocable>=201703L - template class result_of; - template - class result_of : public std::invoke_result { }; -#else - using std::result_of; -#endif } // namespace cpp0x = cpp11; @@ -659,7 +652,15 @@ namespace CGAL { // Typedef for the type of nullptr. typedef const void * Nullptr_t; // Anticipate C++0x's std::nullptr_t - +namespace cpp11{ +#if CGAL_CXX20 || __cpp_lib_is_invocable>=201703L + template class result_of; + template + class result_of : public std::invoke_result { }; +#else + using std::result_of; +#endif +}//namespace cpp11 } //namespace CGAL //Support for c++11 noexcept