diff --git a/Installation/include/CGAL/config.h b/Installation/include/CGAL/config.h index 5c37fb5fabf..208adc24849 100644 --- a/Installation/include/CGAL/config.h +++ b/Installation/include/CGAL/config.h @@ -615,6 +615,45 @@ using std::max; # define CGAL_PRAGMA_DIAG_POP #endif +// +// Compatibility with CGAL-4.14. +// +// That is temporary, and will be replaced by a namespace alias, as +// soon as we can remove cpp11::result_of, and and +// . +// +# include +# include +# include +# include +# include +# include +# include +// +namespace CGAL { +// + namespace cpp11 { + using std::next; + using std::prev; + using std::copy_n; + using std::array; + using std::function; + using std::tuple; + using std::make_tuple; + using std::tie; + using std::get; + using std::tuple_size; + using std::tuple_element; + using std::is_enum; + using std::unordered_set; + using std::unordered_map; + } +// + namespace cpp0x = cpp11; + using cpp11::array; + using cpp11::copy_n; +} // end of the temporary compatibility with CGAL-4.14 + namespace CGAL { // Typedef for the type of NULL. diff --git a/STL_Extension/test/STL_Extension/CMakeLists.txt b/STL_Extension/test/STL_Extension/CMakeLists.txt index e63ea1187d2..b7fb77d3d9d 100644 --- a/STL_Extension/test/STL_Extension/CMakeLists.txt +++ b/STL_Extension/test/STL_Extension/CMakeLists.txt @@ -34,6 +34,7 @@ if ( CGAL_FOUND ) create_single_source_cgal_program( "test_Modifiable_priority_queue.cpp" ) create_single_source_cgal_program( "test_multiset.cpp" ) create_single_source_cgal_program( "test_N_tuple.cpp" ) + create_single_source_cgal_program( "test_namespaces.cpp" ) create_single_source_cgal_program( "test_Nested_iterator.cpp" ) create_single_source_cgal_program( "test_Object.cpp" ) create_single_source_cgal_program( "test_stl_extension.cpp" ) diff --git a/STL_Extension/test/STL_Extension/test_namespaces.cpp b/STL_Extension/test/STL_Extension/test_namespaces.cpp new file mode 100644 index 00000000000..91a2f890665 --- /dev/null +++ b/STL_Extension/test/STL_Extension/test_namespaces.cpp @@ -0,0 +1,35 @@ +#include // because CGAL::copy_n is deprecated + +#include + +#if defined(BOOST_MSVC) +// avoid: warning C4996: 'CGAL::copy_n': was declared deprecated +# pragma warning(disable:4996) +#endif +#include +#include +#include +#include + +int main() +{ + CGAL::cpp0x::array arr; + std::array arr2; + + CGAL::cpp0x::tuple tuple; + std::tuple tuple2; + + CGAL_USE(tuple); + CGAL_USE(tuple2); + + CGAL::copy_n(arr.begin(), 3, arr2.begin()); + + CGAL::cpp0x::copy_n(arr.begin(), 3, arr2.begin()); + std::copy_n(arr.begin(), 3, arr2.begin()); + + CGAL::cpp0x::prev(arr.end()); + std::prev(arr.end()); + CGAL::cpp0x::next(arr.begin()); + std::next(arr.begin()); + return 0; +}