From affaa1932786e5b0ca7c15ed773dbaa672a48acf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 19 Mar 2019 12:10:44 +0100 Subject: [PATCH 01/28] remove workaround for non support of variadic template --- AABB_tree/include/CGAL/AABB_traits.h | 31 -- AABB_tree/include/CGAL/AABB_tree.h | 445 ------------------ .../internal/AABB_tree/AABB_search_tree.h | 2 - 3 files changed, 478 deletions(-) diff --git a/AABB_tree/include/CGAL/AABB_traits.h b/AABB_tree/include/CGAL/AABB_traits.h index a3e20752516..562062a07bf 100644 --- a/AABB_tree/include/CGAL/AABB_traits.h +++ b/AABB_tree/include/CGAL/AABB_traits.h @@ -60,41 +60,10 @@ template struct AABB_traits_base{ typename Primitive::Shared_data m_primitive_data; - #if !defined(CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES) && !defined(CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE) template void set_shared_data(T&& ... t){ m_primitive_data=Primitive::construct_shared_data(std::forward(t)...); } - #else - void set_shared_data(){ - m_primitive_data=Primitive::construct_shared_data(); - } - - template - void set_shared_data(T1& t1){ - m_primitive_data=Primitive::construct_shared_data(t1); - } - - template - void set_shared_data(T1& t1, T2& t2){ - m_primitive_data=Primitive::construct_shared_data(t1,t2); - } - - template - void set_shared_data(T1& t1,T2& t2,T3& t3){ - m_primitive_data=Primitive::construct_shared_data(t1,t2,t3); - } - - template - void set_shared_data(T1& t1,T2& t2,T3& t3,T4& t4){ - m_primitive_data=Primitive::construct_shared_data(t1,t2,t3,t4); - } - - template - void set_shared_data(T1& t1,T2& t2,T3& t3,T4& t4,T5& t5){ - m_primitive_data=Primitive::construct_shared_data(t1,t2,t3,t4,t5); - } - #endif const typename Primitive::Shared_data& shared_data() const {return m_primitive_data;} }; diff --git a/AABB_tree/include/CGAL/AABB_tree.h b/AABB_tree/include/CGAL/AABB_tree.h index 50600ec6944..e362bfbd969 100644 --- a/AABB_tree/include/CGAL/AABB_tree.h +++ b/AABB_tree/include/CGAL/AABB_tree.h @@ -126,27 +126,10 @@ namespace CGAL { * @param beyond past-the-end iterator * * It is equivalent to constructing an empty tree and calling `insert(first,last,t...)`. - * For compilers that do not support variadic templates, overloads up to - * 5 template arguments are provided. * The tree stays empty if the memory allocation is not successful. */ - #if !defined(CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES) && !defined(CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE) template AABB_tree(InputIterator first, InputIterator beyond,T&& ...); - #else - template - AABB_tree(InputIterator first, InputIterator beyond); - template - AABB_tree(InputIterator first, InputIterator beyond, T1&); - template - AABB_tree(InputIterator first, InputIterator beyond,T1&,T2&); - template - AABB_tree(InputIterator first, InputIterator beyond,T1&,T2&,T3&); - template - AABB_tree(InputIterator first, InputIterator beyond,T1&,T2&,T3&,T4&); - template - AABB_tree(InputIterator first, InputIterator beyond,T1&,T2&,T3&,T4&,T5&); - #endif /// After one or more calls to `insert()` the internal data /// structure of the tree must be reconstructed. This procedure @@ -158,26 +141,10 @@ namespace CGAL { /// data structure. /// A call to `AABBTraits::set_shared_data(t...)` /// is made using the internally stored traits. - /// For compilers that do not support variadic templates, - /// overloads up to 5 template arguments are provided. -#if !defined(CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES) && !defined(CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE) template void build(T&& ...); #ifndef DOXYGEN_RUNNING void build(); -#endif -#else - void build(); - template - void build(T1& t1); - template - void build(T1& t1, T2& t2); - template - void build(T1& t1, T2& t2, T3& t3); - template - void build(T1& t1, T2& t2, T3& t3, T4& t4); - template - void build(T1& t1, T2& t2, T3& t3, T4& t4, T5& t5); #endif ///@} @@ -185,25 +152,8 @@ namespace CGAL { ///@{ /// Equivalent to calling `clear()` and then `insert(first,last,t...)`. - /// For compilers that do not support variadic templates, overloads up - /// to 5 template arguments are provided. - #if !defined(CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES) && !defined(CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE) template void rebuild(ConstPrimitiveIterator first, ConstPrimitiveIterator beyond,T&& ...); - #else - template - void rebuild(ConstPrimitiveIterator first, ConstPrimitiveIterator beyond); - template - void rebuild(ConstPrimitiveIterator first, ConstPrimitiveIterator beyond, T1&); - template - void rebuild(ConstPrimitiveIterator first, ConstPrimitiveIterator beyond,T1&,T2&); - template - void rebuild(ConstPrimitiveIterator first, ConstPrimitiveIterator beyond,T1&,T2&,T3&); - template - void rebuild(ConstPrimitiveIterator first, ConstPrimitiveIterator beyond,T1&,T2&,T3&,T4&); - template - void rebuild(ConstPrimitiveIterator first, ConstPrimitiveIterator beyond,T1&,T2&,T3&,T4&,T5&); - #endif /// Add a sequence of primitives to the set of primitives of the AABB tree. @@ -212,25 +162,8 @@ namespace CGAL { /// `Primitive(%InputIterator, T...)`. If `Primitive` is a model of the concept /// `AABBPrimitiveWithSharedData`, a call to `AABBTraits::set_shared_data(t...)` /// is made using the internally stored traits. - /// For compilers that do not support variadic templates, - /// overloads up to 5 template arguments are provided. - #if !defined(CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES) && !defined(CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE) template void insert(InputIterator first, InputIterator beyond,T&& ...); - #else - template - void insert(InputIterator first, InputIterator beyond); - template - void insert(InputIterator first, InputIterator beyond,T1&); - template - void insert(InputIterator first, InputIterator beyond,T1&, T2&); - template - void insert(InputIterator first, InputIterator beyond,T1&,T2&,T3&); - template - void insert(InputIterator first, InputIterator beyond,T1&,T2&,T3&,T4&); - template - void insert(InputIterator first, InputIterator beyond,T1&,T2&,T3&,T4&,T5&); - #endif /// Adds a primitive to the set of primitives of the tree. inline void insert(const Primitive& p); @@ -274,7 +207,6 @@ namespace CGAL { ///@} private: - #if !defined(CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES) && !defined(CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE) template void set_primitive_data_impl(CGAL::Boolean_tag,T ... ){} template @@ -285,64 +217,6 @@ namespace CGAL { void set_shared_data(T&& ...t){ set_primitive_data_impl(CGAL::Boolean_tag::value>(),std::forward(t)...); } - #else - void set_primitive_data_impl(CGAL::Boolean_tag){} - void set_primitive_data_impl(CGAL::Boolean_tag) - {m_traits.set_shared_data();} - void set_shared_data(){ - set_primitive_data_impl(CGAL::Boolean_tag::value>()); - } - - template - void set_primitive_data_impl(CGAL::Boolean_tag,T1){} - template - void set_primitive_data_impl(CGAL::Boolean_tag,T1& t1) - {m_traits.set_shared_data(t1);} - template - void set_shared_data(T1& t1){ - set_primitive_data_impl(Boolean_tag::value>(),t1); - } - - template - void set_primitive_data_impl(CGAL::Boolean_tag,T1,T2){} - template - void set_primitive_data_impl(CGAL::Boolean_tag,T1& t1,T2& t2) - {m_traits.set_shared_data(t1,t2);} - template - void set_shared_data(const T1& t1,const T2& t2){ - set_primitive_data_impl(Boolean_tag::value>(),t1,t2); - } - - template - void set_primitive_data_impl(CGAL::Boolean_tag,T1,T2,T3){} - template - void set_primitive_data_impl(CGAL::Boolean_tag,T1& t1,T2& t2,T3& t3) - {m_traits.set_shared_data(t1,t2,t3);} - template - void set_shared_data(T1& t1,T2& t2,T3& t3){ - set_primitive_data_impl(Boolean_tag::value>(),t1,t2,t3); - } - - template - void set_primitive_data_impl(CGAL::Boolean_tag,T1,T2,T3,T4){} - template - void set_primitive_data_impl(CGAL::Boolean_tag,T1& t1,T2& t2,T3& t3,T4& t4) - {m_traits.set_shared_data(t1,t2,t3,t4);} - template - void set_shared_data(T1& t1,T2& t2,T3& t3,T4& t4){ - set_primitive_data_impl(Boolean_tag::value>(),t1,t2,t3,t4); - } - - template - void set_primitive_data_impl(CGAL::Boolean_tag,T1,T2,T3,T4,T5){} - template - void set_primitive_data_impl(CGAL::Boolean_tag,T1& t1,T2& t2,T3& t3,T4& t4,T5& t5) - {m_traits.set_shared_data(t1,t2,t3,t4,t5);} - template - void set_shared_data(T1& t1,T2& t2,T3& t3,T4& t4,T5& t5){ - set_primitive_data_impl(Boolean_tag::value>(),t1,t2,t3,t4,t5); - } - #endif bool build_kd_tree() const; template @@ -744,7 +618,6 @@ public: , m_need_build(false) {} - #if !defined(CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES) && !defined(CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE) template template AABB_tree::AABB_tree(ConstPrimitiveIterator first, @@ -800,324 +673,6 @@ public: set_shared_data(std::forward(t)...); build(); } - #else - //=============constructor====================== - template - template - AABB_tree::AABB_tree(ConstPrimitiveIterator first, - ConstPrimitiveIterator beyond) - : m_traits() - , m_primitives() - , m_p_root_node(NULL) - , m_p_search_tree(NULL) - , m_search_tree_constructed(false) - , m_default_search_tree_constructed(false) - , m_need_build(false) - { - // Insert each primitive into tree - insert(first, beyond); - } - - template - template - AABB_tree::AABB_tree(ConstPrimitiveIterator first, - ConstPrimitiveIterator beyond, - T1& t1) - : m_traits() - , m_primitives() - , m_p_root_node(NULL) - , m_p_search_tree(NULL) - , m_search_tree_constructed(false) - , m_default_search_tree_constructed(false) - , m_need_build(false) - { - // Insert each primitive into tree - insert(first, beyond,t1); - } - - template - template - AABB_tree::AABB_tree(ConstPrimitiveIterator first, - ConstPrimitiveIterator beyond, - T1& t1,T2& t2) - : m_traits() - , m_primitives() - , m_p_root_node(NULL) - , m_p_search_tree(NULL) - , m_search_tree_constructed(false) - , m_default_search_tree_constructed(false) - , m_need_build(false) - { - // Insert each primitive into tree - insert(first, beyond,t1,t2); - } - - template - template - AABB_tree::AABB_tree(ConstPrimitiveIterator first, - ConstPrimitiveIterator beyond, - T1& t1,T2& t2,T3& t3) - : m_traits() - , m_primitives() - , m_p_root_node(NULL) - , m_p_search_tree(NULL) - , m_search_tree_constructed(false) - , m_default_search_tree_constructed(false) - , m_need_build(false) - { - // Insert each primitive into tree - insert(first, beyond,t1,t2,t3); - } - - template - template - AABB_tree::AABB_tree(ConstPrimitiveIterator first, - ConstPrimitiveIterator beyond, - T1& t1,T2& t2,T3& t3,T4& t4) - : m_traits() - , m_primitives() - , m_p_root_node(NULL) - , m_p_search_tree(NULL) - , m_search_tree_constructed(false) - , m_default_search_tree_constructed(false) - , m_need_build(false) - { - // Insert each primitive into tree - insert(first, beyond,t1,t2,t3,t4); - } - - template - template - AABB_tree::AABB_tree(ConstPrimitiveIterator first, - ConstPrimitiveIterator beyond, - T1& t1,T2& t2,T3& t3,T4& t4,T5& t5) - : m_traits() - , m_primitives() - , m_p_root_node(NULL) - , m_p_search_tree(NULL) - , m_search_tree_constructed(false) - , m_default_search_tree_constructed(false) - , m_need_build(false) - { - // Insert each primitive into tree - insert(first, beyond,t1,t2,t3,t4,t5); - } - //=============insert====================== - template - template - void AABB_tree::insert(ConstPrimitiveIterator first, - ConstPrimitiveIterator beyond) - { - set_shared_data(); - while(first != beyond) - { - m_primitives.push_back(Primitive(first)); - ++first; - } - m_need_build = true; - } - - template - template - void AABB_tree::insert(ConstPrimitiveIterator first, - ConstPrimitiveIterator beyond, - T1& t1) - { - set_shared_data(t1); - while(first != beyond) - { - m_primitives.push_back(Primitive(first,t1)); - ++first; - } - m_need_build = true; - } - - template - template - void AABB_tree::insert(ConstPrimitiveIterator first, - ConstPrimitiveIterator beyond, - T1& t1, T2& t2) - { - set_shared_data(t1,t2); - while(first != beyond) - { - m_primitives.push_back(Primitive(first,t1,t2)); - ++first; - } - m_need_build = true; - } - - template - template - void AABB_tree::insert(ConstPrimitiveIterator first, - ConstPrimitiveIterator beyond, - T1& t1,T2& t2,T3& t3) - { - set_shared_data(t1,t2,t3); - while(first != beyond) - { - m_primitives.push_back(Primitive(first,t1,t2,t3)); - ++first; - } - m_need_build = true; - } - - template - template - void AABB_tree::insert(ConstPrimitiveIterator first, - ConstPrimitiveIterator beyond, - T1& t1,T2& t2,T3& t3,T4& t4) - { - set_shared_data(t1,t2,t3,t4); - while(first != beyond) - { - m_primitives.push_back(Primitive(first,t1,t2,t3,t4)); - ++first; - } - m_need_build = true; - } - - template - template - void AABB_tree::insert(ConstPrimitiveIterator first, - ConstPrimitiveIterator beyond, - T1& t1,T2& t2,T3& t3,T4& t4,T5& t5) - { - set_shared_data(t1,t2,t3,t4,t5); - while(first != beyond) - { - m_primitives.push_back(Primitive(first,t1,t2,t3,t4,t5)); - ++first; - } - m_need_build = true; - } - - //=============rebuild====================== - template - template - void AABB_tree::rebuild(ConstPrimitiveIterator first, - ConstPrimitiveIterator beyond) - { - // cleanup current tree and internal KD tree - clear(); - - // inserts primitives - insert(first, beyond); - - build(); - } - - template - template - void AABB_tree::rebuild(ConstPrimitiveIterator first, - ConstPrimitiveIterator beyond, - T1& t1) - { - // cleanup current tree and internal KD tree - clear(); - - // inserts primitives - insert(first, beyond,t1); - - build(); - } - - template - template - void AABB_tree::rebuild(ConstPrimitiveIterator first, - ConstPrimitiveIterator beyond, - T1& t1, T2& t2) - { - // cleanup current tree and internal KD tree - clear(); - - // inserts primitives - insert(first, beyond,t1,t2); - - build(); - } - - template - template - void AABB_tree::rebuild(ConstPrimitiveIterator first, - ConstPrimitiveIterator beyond, - T1& t1,T2& t2,T3& t3) - { - // cleanup current tree and internal KD tree - clear(); - - // inserts primitives - insert(first, beyond,t1,t2,t3); - - build(); - } - - template - template - void AABB_tree::rebuild(ConstPrimitiveIterator first, - ConstPrimitiveIterator beyond, - T1& t1,T2& t2,T3& t3,T4& t4) - { - // cleanup current tree and internal KD tree - clear(); - - // inserts primitives - insert(first, beyond,t1,t2,t3,t4); - - build(); - } - - template - template - void AABB_tree::rebuild(ConstPrimitiveIterator first, - ConstPrimitiveIterator beyond, - T1& t1,T2& t2,T3& t3,T4& t4,T5& t5) - { - // cleanup current tree and internal KD tree - clear(); - - // inserts primitives - insert(first, beyond,t1,t2,t3,t4,t5); - - build(); - } - //overloads calling set_shared_data() - template - template - void AABB_tree::build(T1& t1) - { - set_shared_data(t1); - build(); - } - template - template - void AABB_tree::build(T1& t1, T2& t2) - { - set_shared_data(t1, t2); - build(); - } - template - template - void AABB_tree::build(T1& t1, T2& t2, T3& t3) - { - set_shared_data(t1, t2, t3); - build(); - } - template - template - void AABB_tree::build(T1& t1, T2& t2, T3& t3, T4& t4) - { - set_shared_data(t1, t2, t3, t4); - build(); - } - template - template - void AABB_tree::build(T1& t1, T2& t2, T3& t3, T4& t4, T5& t5) - { - set_shared_data(t1, t2, t3, t4, t5); - build(); - } -#endif template void AABB_tree::insert(const Primitive& p) diff --git a/AABB_tree/include/CGAL/internal/AABB_tree/AABB_search_tree.h b/AABB_tree/include/CGAL/internal/AABB_tree/AABB_search_tree.h index b02bb264fb2..214a8d2644a 100644 --- a/AABB_tree/include/CGAL/internal/AABB_tree/AABB_search_tree.h +++ b/AABB_tree/include/CGAL/internal/AABB_tree/AABB_search_tree.h @@ -65,9 +65,7 @@ namespace CGAL m_id = rhs.m_id; } -#ifndef CGAL_CFG_NO_CPP0X_DELETED_AND_DEFAULT_FUNCTIONS Decorated_point& operator=(const Decorated_point&)=default; -#endif private: Id m_id; From 3cfbccd44acb70f550b7a252cbd9414d4fdb1aff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 19 Mar 2019 12:25:25 +0100 Subject: [PATCH 02/28] remove workaround c++11 features in STL_extension --- .../copy_n_benchmark/copy_n_benchmark.cpp | 2 - .../copy_n_use_case_benchmark.cpp | 2 - .../include/CGAL/Compact_container.h | 156 --- .../CGAL/Concurrent_compact_container.h | 106 -- STL_Extension/include/CGAL/Handle_for.h | 39 +- .../include/CGAL/Handle_for_virtual.h | 2 - STL_Extension/include/CGAL/Object.h | 15 - STL_Extension/include/CGAL/array.h | 103 -- STL_Extension/include/CGAL/iterator.h | 1109 ----------------- STL_Extension/include/CGAL/utility.h | 29 +- .../test/STL_Extension/test_Cache.cpp | 4 +- .../test/STL_Extension/test_In_place_list.cpp | 3 - 12 files changed, 3 insertions(+), 1567 deletions(-) diff --git a/STL_Extension/benchmark/copy_n_benchmark/copy_n_benchmark.cpp b/STL_Extension/benchmark/copy_n_benchmark/copy_n_benchmark.cpp index 0ee6ec41bcc..227c8dd8bf2 100644 --- a/STL_Extension/benchmark/copy_n_benchmark/copy_n_benchmark.cpp +++ b/STL_Extension/benchmark/copy_n_benchmark/copy_n_benchmark.cpp @@ -33,7 +33,6 @@ int format_output(const char* lib, const char* container, const char* to, int n, struct std_tag {}; struct cgal_tag {}; -#ifndef CGAL_CFG_NO_CPP0X_COPY_N template inline double test(ForwardIterator it, Size n, OutputIterator result, int repeats, std_tag) { boost::timer timer; @@ -41,7 +40,6 @@ inline double test(ForwardIterator it, Size n, OutputIterator result, int repeat for (int i = 0; i < repeats; ++i) { std::copy_n(it, n, result); } return (double)n*repeats/timer.elapsed()/1.0E6; } -#endif template inline double test(ForwardIterator it, Size n, OutputIterator result, int repeats, cgal_tag) { diff --git a/STL_Extension/benchmark/copy_n_benchmark/copy_n_use_case_benchmark.cpp b/STL_Extension/benchmark/copy_n_benchmark/copy_n_use_case_benchmark.cpp index 7c6a298ee2a..60135205bad 100644 --- a/STL_Extension/benchmark/copy_n_benchmark/copy_n_use_case_benchmark.cpp +++ b/STL_Extension/benchmark/copy_n_benchmark/copy_n_use_case_benchmark.cpp @@ -51,12 +51,10 @@ int main(int argc, char* argv[]) { format_output("CGAL", generator , n, time); std::cout << "|- \n"; -#ifndef CGAL_CFG_NO_CPP0X_COPY_N timer.restart(); for (int i = 0; i < repeats; ++i) { std::copy_n( g, n, points.begin()); } time = (double)n*repeats/timer.elapsed()/1.0E6; format_output("stdlib", generator, n, time); -#endif //wiki markup footer std::cout << "|}" << std::endl; diff --git a/STL_Extension/include/CGAL/Compact_container.h b/STL_Extension/include/CGAL/Compact_container.h index 2396e370e89..a0e31f23595 100644 --- a/STL_Extension/include/CGAL/Compact_container.h +++ b/STL_Extension/include/CGAL/Compact_container.h @@ -403,7 +403,6 @@ public: // Special insert methods that construct the objects in place // (just forward the arguments to the constructor, to optimize a copy). -#ifndef CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES template < typename... Args > iterator emplace(const Args&... args) @@ -419,157 +418,6 @@ public: time_stamper->set_time_stamp(ret); return iterator(ret, 0); } -#else - // inserts a default constructed item. - iterator emplace() - { - if (free_list == NULL) - allocate_new_block(); - - pointer ret = free_list; - free_list = clean_pointee(ret); - new (ret) value_type(); - CGAL_assertion(type(ret) == USED); - ++size_; - time_stamper->set_time_stamp(ret); - return iterator(ret, 0); - } - - template < typename T1 > - iterator - emplace(const T1 &t1) - { - if (free_list == NULL) - allocate_new_block(); - - pointer ret = free_list; - free_list = clean_pointee(ret); - new (ret) value_type(t1); - CGAL_assertion(type(ret) == USED); - ++size_; - time_stamper->set_time_stamp(ret); - return iterator(ret, 0); - } - - template < typename T1, typename T2 > - iterator - emplace(const T1 &t1, const T2 &t2) - { - if (free_list == NULL) - allocate_new_block(); - - pointer ret = free_list; - free_list = clean_pointee(ret); - new (ret) value_type(t1, t2); - CGAL_assertion(type(ret) == USED); - ++size_; - time_stamper->set_time_stamp(ret); - return iterator(ret, 0); - } - - template < typename T1, typename T2, typename T3 > - iterator - emplace(const T1 &t1, const T2 &t2, const T3 &t3) - { - if (free_list == NULL) - allocate_new_block(); - - pointer ret = free_list; - free_list = clean_pointee(ret); - new (ret) value_type(t1, t2, t3); - CGAL_assertion(type(ret) == USED); - ++size_; - time_stamper->set_time_stamp(ret); - return iterator(ret, 0); - } - - template < typename T1, typename T2, typename T3, typename T4 > - iterator - emplace(const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4) - { - if (free_list == NULL) - allocate_new_block(); - - pointer ret = free_list; - free_list = clean_pointee(ret); - new (ret) value_type(t1, t2, t3, t4); - CGAL_assertion(type(ret) == USED); - ++size_; - time_stamper->set_time_stamp(ret); - return iterator(ret, 0); - } - - template < typename T1, typename T2, typename T3, typename T4, typename T5 > - iterator - emplace(const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4, - const T5 &t5) - { - if (free_list == NULL) - allocate_new_block(); - - pointer ret = free_list; - free_list = clean_pointee(ret); - new (ret) value_type(t1, t2, t3, t4, t5); - CGAL_assertion(type(ret) == USED); - ++size_; - time_stamper->set_time_stamp(ret); - return iterator(ret, 0); - } - - template < typename T1, typename T2, typename T3, typename T4, - typename T5, typename T6 > - iterator - emplace(const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4, - const T5 &t5, const T6 &t6) - { - if (free_list == NULL) - allocate_new_block(); - - pointer ret = free_list; - free_list = clean_pointee(ret); - new (ret) value_type(t1, t2, t3, t4, t5, t6); - CGAL_assertion(type(ret) == USED); - ++size_; - time_stamper->set_time_stamp(ret); - return iterator(ret, 0); - } - - template < typename T1, typename T2, typename T3, typename T4, - typename T5, typename T6, typename T7 > - iterator - emplace(const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4, - const T5 &t5, const T6 &t6, const T7 &t7) - { - if (free_list == NULL) - allocate_new_block(); - - pointer ret = free_list; - free_list = clean_pointee(ret); - new (ret) value_type(t1, t2, t3, t4, t5, t6, t7); - CGAL_assertion(type(ret) == USED); - ++size_; - time_stamper->set_time_stamp(ret); - return iterator(ret, 0); - } - - template < typename T1, typename T2, typename T3, typename T4, - typename T5, typename T6, typename T7, typename T8 > - iterator - emplace(const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4, - const T5 &t5, const T6 &t6, const T7 &t7, const T8 &t8) - { - if (free_list == NULL) - allocate_new_block(); - - pointer ret = free_list; - free_list = clean_pointee(ret); - new (ret) value_type(t1, t2, t3, t4, t5, t6, t7, t8); - CGAL_assertion(type(ret) == USED); - ++size_; - time_stamper->set_time_stamp(ret); - return iterator(ret, 0); - } -#endif // CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES iterator insert(const T &t) { @@ -578,11 +426,7 @@ public: pointer ret = free_list; free_list = clean_pointee(ret); -#ifdef CGAL_CXX11 std::allocator_traits::construct(alloc, ret, t); -#else - alloc.construct(ret, t); -#endif CGAL_assertion(type(ret) == USED); ++size_; time_stamper->set_time_stamp(ret); diff --git a/STL_Extension/include/CGAL/Concurrent_compact_container.h b/STL_Extension/include/CGAL/Concurrent_compact_container.h index deb229b675d..5fb5401c4f1 100644 --- a/STL_Extension/include/CGAL/Concurrent_compact_container.h +++ b/STL_Extension/include/CGAL/Concurrent_compact_container.h @@ -306,7 +306,6 @@ public: // Special insert methods that construct the objects in place // (just forward the arguments to the constructor, to optimize a copy). -#ifndef CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES template < typename... Args > iterator emplace(const Args&... args) @@ -316,113 +315,12 @@ public: new (ret) value_type(args...); return finalize_insert(ret, fl); } -#else - // inserts a default constructed item. - iterator emplace() - { - FreeList * fl = get_free_list(); - pointer ret = init_insert(fl); - new (ret) value_type(); - return finalize_insert(ret, fl); - } - - template < typename T1 > - iterator - emplace(const T1 &t1) - { - FreeList * fl = get_free_list(); - pointer ret = init_insert(fl); - new (ret) value_type(t1); - return finalize_insert(ret, fl); - } - - template < typename T1, typename T2 > - iterator - emplace(const T1 &t1, const T2 &t2) - { - FreeList * fl = get_free_list(); - pointer ret = init_insert(fl); - new (ret) value_type(t1, t2); - return finalize_insert(ret, fl); - } - - template < typename T1, typename T2, typename T3 > - iterator - emplace(const T1 &t1, const T2 &t2, const T3 &t3) - { - FreeList * fl = get_free_list(); - pointer ret = init_insert(fl); - new (ret) value_type(t1, t2, t3); - return finalize_insert(ret, fl); - } - - template < typename T1, typename T2, typename T3, typename T4 > - iterator - emplace(const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4) - { - FreeList * fl = get_free_list(); - pointer ret = init_insert(fl); - new (ret) value_type(t1, t2, t3, t4); - return finalize_insert(ret, fl); - } - - template < typename T1, typename T2, typename T3, typename T4, typename T5 > - iterator - emplace(const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4, - const T5 &t5) - { - FreeList * fl = get_free_list(); - pointer ret = init_insert(fl); - new (ret) value_type(t1, t2, t3, t4, t5); - return finalize_insert(ret, fl); - } - - template < typename T1, typename T2, typename T3, typename T4, - typename T5, typename T6 > - iterator - emplace(const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4, - const T5 &t5, const T6 &t6) - { - FreeList * fl = get_free_list(); - pointer ret = init_insert(fl); - new (ret) value_type(t1, t2, t3, t4, t5, t6); - return finalize_insert(ret, fl); - } - - template < typename T1, typename T2, typename T3, typename T4, - typename T5, typename T6, typename T7 > - iterator - emplace(const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4, - const T5 &t5, const T6 &t6, const T7 &t7) - { - FreeList * fl = get_free_list(); - pointer ret = init_insert(fl); - new (ret) value_type(t1, t2, t3, t4, t5, t6, t7); - return finalize_insert(ret, fl); - } - - template < typename T1, typename T2, typename T3, typename T4, - typename T5, typename T6, typename T7, typename T8 > - iterator - emplace(const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4, - const T5 &t5, const T6 &t6, const T7 &t7, const T8 &t8) - { - FreeList * fl = get_free_list(); - pointer ret = init_insert(fl); - new (ret) value_type(t1, t2, t3, t4, t5, t6, t7, t8); - return finalize_insert(ret, fl); - } -#endif // CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES iterator insert(const T &t) { FreeList * fl = get_free_list(); pointer ret = init_insert(fl); -#ifdef CGAL_CXX11 std::allocator_traits::construct(m_alloc, ret, t); -#else - m_alloc.construct(ret, t); -#endif return finalize_insert(ret, fl); } @@ -449,11 +347,7 @@ private: CGAL_precondition(type(x) == USED); EraseCounterStrategy::increment_erase_counter(*x); -#ifdef CGAL_CXX11 std::allocator_traits::destroy(m_alloc, &*x); -#else - m_alloc.destroy(&*x); -#endif /* WE DON'T DO THAT BECAUSE OF THE ERASE COUNTER #ifndef CGAL_NO_ASSERTIONS diff --git a/STL_Extension/include/CGAL/Handle_for.h b/STL_Extension/include/CGAL/Handle_for.h index bb0774c70eb..484a45dd87b 100644 --- a/STL_Extension/include/CGAL/Handle_for.h +++ b/STL_Extension/include/CGAL/Handle_for.h @@ -87,7 +87,6 @@ public: ptr_ = p; } -#ifndef CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE Handle_for(element_type && t) { pointer p = allocator.allocate(1); @@ -95,7 +94,6 @@ public: p->count = 1; ptr_ = p; } -#endif /* I comment this one for now, since it's preventing the automatic conversions to take place. We'll see if it's a problem later. @@ -109,7 +107,6 @@ public: } */ -#if !defined CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES && !defined CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE template < typename T1, typename T2, typename... Args > Handle_for(T1 && t1, T2 && t2, Args && ... args) { @@ -118,34 +115,6 @@ public: p->count = 1; ptr_ = p; } -#else - template < typename T1, typename T2 > - Handle_for(const T1& t1, const T2& t2) - { - pointer p = allocator.allocate(1); - new (&(p->t)) element_type(t1, t2); - p->count = 1; - ptr_ = p; - } - - template < typename T1, typename T2, typename T3 > - Handle_for(const T1& t1, const T2& t2, const T3& t3) - { - pointer p = allocator.allocate(1); - new (&(p->t)) element_type(t1, t2, t3); - p->count = 1; - ptr_ = p; - } - - template < typename T1, typename T2, typename T3, typename T4 > - Handle_for(const T1& t1, const T2& t2, const T3& t3, const T4& t4) - { - pointer p = allocator.allocate(1); - new (&(p->t)) element_type(t1, t2, t3, t4); - p->count = 1; - ptr_ = p; - } -#endif // CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES Handle_for(const Handle_for& h) : ptr_(h.ptr_) @@ -173,7 +142,6 @@ public: return *this; } -#ifndef CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE // Note : I don't see a way to make a useful move constructor, apart // from e.g. using NULL as a ptr value, but this is drastic. @@ -194,17 +162,12 @@ public: return *this; } -#endif ~Handle_for() { if (--(ptr_->count) == 0) { -#ifdef CGAL_CXX11 Allocator_traits::destroy(allocator, ptr_); -#else - allocator.destroy( ptr_); -#endif - allocator.deallocate( ptr_, 1); + allocator.deallocate( ptr_, 1); } } diff --git a/STL_Extension/include/CGAL/Handle_for_virtual.h b/STL_Extension/include/CGAL/Handle_for_virtual.h index 7ae39a46377..6df81110a78 100644 --- a/STL_Extension/include/CGAL/Handle_for_virtual.h +++ b/STL_Extension/include/CGAL/Handle_for_virtual.h @@ -104,14 +104,12 @@ class Handle_for_virtual return *this; } -#ifndef CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE Handle_for_virtual& operator=( Handle_for_virtual && h) { swap(h); return *this; } -#endif // protected: typedef RefCounted element_type; diff --git a/STL_Extension/include/CGAL/Object.h b/STL_Extension/include/CGAL/Object.h index 03d43bc582d..f04f5ec04ce 100644 --- a/STL_Extension/include/CGAL/Object.h +++ b/STL_Extension/include/CGAL/Object.h @@ -68,13 +68,8 @@ class Object Object() : obj() { } -#ifndef CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE template Object(T && t, private_tag) : obj(new boost::any(std::forward(t))) { } -#else - template - Object(const T&t, private_tag) : obj(new boost::any(t)) { } -#endif // implicit constructor from optionals containing variants template @@ -155,7 +150,6 @@ class Object }; -#ifndef CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE template inline Object @@ -163,15 +157,6 @@ make_object(T && t) { return Object(std::forward(t), Object::private_tag()); } -#else -template -inline -Object -make_object(const T& t) -{ - return Object(t, Object::private_tag()); -} -#endif template inline diff --git a/STL_Extension/include/CGAL/array.h b/STL_Extension/include/CGAL/array.h index 1a185d42e04..696783674cb 100644 --- a/STL_Extension/include/CGAL/array.h +++ b/STL_Extension/include/CGAL/array.h @@ -74,8 +74,6 @@ using cpp11::array; // It's also untrue that this is not documented... It is ! -#ifndef CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES - template< typename T, typename... Args > inline cpp11::array< T, 1 + sizeof...(Args) > @@ -96,107 +94,6 @@ struct Construct_array } }; -#else // CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES - -template < typename T > inline -cpp11::array -make_array(const T& b1) -{ - cpp11::array a = { { b1 } }; - return a; -} - -template < typename T > inline -cpp11::array -make_array(const T& b1, const T& b2) -{ - cpp11::array a = { { b1, b2 } }; - return a; -} - -template < typename T > inline -cpp11::array -make_array(const T& b1, const T& b2, const T& b3) -{ - cpp11::array a = { { b1, b2, b3 } }; - return a; -} - -template < typename T > inline -cpp11::array -make_array(const T& b1, const T& b2, const T& b3, const T& b4) -{ - cpp11::array a = { { b1, b2, b3, b4 } }; - return a; -} - -template < typename T > inline -cpp11::array -make_array(const T& b1, const T& b2, const T& b3, const T& b4, const T& b5) -{ - cpp11::array a = { { b1, b2, b3, b4, b5 } }; - return a; -} - -template < typename T > inline -cpp11::array -make_array(const T& b1, const T& b2, const T& b3, const T& b4, const T& b5, - const T& b6) -{ - cpp11::array a = { { b1, b2, b3, b4, b5, b6 } }; - return a; -} - -// Functor version -struct Construct_array -{ - template < typename T > - cpp11::array - operator()(const T& b1) - { - return make_array (b1); - } - - template < typename T > - cpp11::array - operator()(const T& b1, const T& b2) - { - return make_array (b1, b2); - } - - template < typename T > - cpp11::array - operator()(const T& b1, const T& b2, const T& b3) - { - return make_array (b1, b2, b3); - } - - template < typename T > - cpp11::array - operator()(const T& b1, const T& b2, const T& b3, const T& b4) - { - return make_array (b1, b2, b3, b4); - } - - template < typename T > - cpp11::array - operator()(const T& b1, const T& b2, const T& b3, const T& b4, const T& b5) - { - return make_array (b1, b2, b3, b4, b5); - } - - template < typename T > - cpp11::array - operator()(const T& b1, const T& b2, const T& b3, const T& b4, const T& b5, - const T& b6) - { - return make_array (b1, b2, b3, b4, b5, b6); - } -}; - - -#endif // CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES - } //namespace CGAL #endif // CGAL_ARRAY_H diff --git a/STL_Extension/include/CGAL/iterator.h b/STL_Extension/include/CGAL/iterator.h index 4b9331e88c0..221e0c849de 100644 --- a/STL_Extension/include/CGAL/iterator.h +++ b/STL_Extension/include/CGAL/iterator.h @@ -1283,17 +1283,14 @@ struct Output_visitor : boost::static_visitor { } // internal -#if !defined(CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES) && !defined(CGAL_CFG_NO_CPP0X_TUPLE) namespace internal { template < typename D, typename V = cpp11::tuple<>, typename O = cpp11::tuple<> > struct Derivator { -#ifndef CGAL_CFG_NO_CPP0X_DELETED_AND_DEFAULT_FUNCTIONS typedef Derivator Self; Self& operator=(const Self&) = delete; -#endif template void tuple_dispatch(const Tuple&) {} @@ -1306,9 +1303,7 @@ struct Derivator, cpp11::tuple > typedef Derivator, cpp11::tuple > Self; typedef Derivator, cpp11::tuple > Base; -#ifndef CGAL_CFG_NO_CPP0X_DELETED_AND_DEFAULT_FUNCTIONS Self& operator=(const Self&) = delete; -#endif using Base::operator=; @@ -1372,9 +1367,7 @@ public: Dispatch_output_iterator(O... o) : cpp11::tuple(o...) {} -#ifndef CGAL_CFG_NO_CPP0X_DELETED_AND_DEFAULT_FUNCTIONS Dispatch_output_iterator(const Dispatch_output_iterator&)=default; -#endif Self& operator=(const Self& s) { @@ -1445,10 +1438,8 @@ public: Dispatch_or_drop_output_iterator(O... o) : Base(o...) {} -#ifndef CGAL_CFG_NO_CPP0X_DELETED_AND_DEFAULT_FUNCTIONS Dispatch_or_drop_output_iterator(const Dispatch_or_drop_output_iterator&)=default; Dispatch_or_drop_output_iterator& operator=(const Dispatch_or_drop_output_iterator&)=default; -#endif using Base::operator=; @@ -1469,1106 +1460,6 @@ dispatch_or_drop_output(O... o) return Dispatch_or_drop_output_iterator, cpp11::tuple >(o...); } -#else - -// Non-variadic version - -template < typename V, typename O > -class Dispatch_output_iterator; - -template < typename V, typename O > -class Dispatch_or_drop_output_iterator; - - -// Version with 1 parameters -template -class Dispatch_output_iterator,cpp11::tuple >:public cpp11::tuple{ - typedef Dispatch_output_iterator Self; - -public: - typedef cpp11::tuple Value_type_tuple; - typedef cpp11::tuple Iterator_tuple; - typedef std::output_iterator_tag iterator_category; - typedef void value_type; - typedef void difference_type; - typedef void pointer; - typedef void reference; - - - Self& operator*(){ return *this; } - Self& operator++(){ return *this; } - Self& operator++(int){ return *this; } - - Dispatch_output_iterator(O1 out1):Iterator_tuple(out1){} - - //Added because required by MSVC10 - Dispatch_output_iterator(const Self& other): - Iterator_tuple(static_cast(other)) - {} - - Self& operator=(const V1& obj){ - *cpp11::get<0>(static_cast(*this))++=obj; - return *this; - } - - Self& operator=(const cpp11::tuple& obj){ - *cpp11::get<0>(static_cast(*this))++=cpp11::get<0>(obj); - return *this; - } - - Self& operator=(const Self& s){ - static_cast< Iterator_tuple& >(*this) = static_cast< const Iterator_tuple& >(s); - return *this; - } - - template - Self& operator=(const boost::variant& t) { - internal::Output_visitor visitor(this); - boost::apply_visitor(visitor, t); - return *this; - } - - template - Self& operator=(const boost::optional< boost::variant >& t) { - internal::Output_visitor visitor(this); - if(t) boost::apply_visitor(visitor, *t); - return *this; - } - - const Iterator_tuple& get_iterator_tuple() const - { return *this; } - -}; - - -template -inline -Dispatch_output_iterator,cpp11::tuple > -dispatch_output(O1 out1){ - return Dispatch_output_iterator,cpp11::tuple >(out1); -} - -//Version with DROP - -template -class Dispatch_or_drop_output_iterator,cpp11::tuple >: - public Dispatch_output_iterator,cpp11::tuple > -{ - typedef Dispatch_or_drop_output_iterator Self; - typedef Dispatch_output_iterator,cpp11::tuple > Base; - -public: - - Self& operator*(){ return *this; } - Self& operator++(){ return *this; } - Self& operator++(int){ return *this; } - - Dispatch_or_drop_output_iterator(O1 out1):Base(out1){} - - #if defined(__EDG__) - typedef cpp11::tuple Iterator_tuple; - - Self& operator=(const V1& obj){ - *cpp11::get<0>(static_cast(*this))++=obj; - return *this; - } - - Self& operator=(const Self& s){ - static_cast< Iterator_tuple& >(*this) = static_cast< const Iterator_tuple& >(s); - return *this; - } - - Self& operator=(const cpp11::tuple& t){ - static_cast< Base& >(*this) = t; - return *this; - } - #else - using Base::operator=; - #endif //defined(__EDG__) - - - template - Self& operator=(const T&){ - return *this; - } -}; - -template -inline -Dispatch_or_drop_output_iterator,cpp11::tuple > -dispatch_or_drop_output(O1 out1){ - return Dispatch_or_drop_output_iterator,cpp11::tuple >(out1); -} - -// Version with 2 parameters -template -class Dispatch_output_iterator,cpp11::tuple >:public cpp11::tuple{ - typedef Dispatch_output_iterator Self; - -public: - typedef cpp11::tuple Value_type_tuple; - typedef cpp11::tuple Iterator_tuple; - typedef std::output_iterator_tag iterator_category; - typedef void value_type; - typedef void difference_type; - typedef void pointer; - typedef void reference; - - - Self& operator*(){ return *this; } - Self& operator++(){ return *this; } - Self& operator++(int){ return *this; } - - Dispatch_output_iterator(O1 out1,O2 out2):Iterator_tuple(out1,out2){} - - //Added because required by MSVC10 - Dispatch_output_iterator(const Self& other): - Iterator_tuple(static_cast(other)) - {} - - Self& operator=(const V1& obj){ - *cpp11::get<0>(static_cast(*this))++=obj; - return *this; - } - - Self& operator=(const V2& obj){ - *cpp11::get<1>(static_cast(*this))++=obj; - return *this; - } - - Self& operator=(const cpp11::tuple& obj){ - *cpp11::get<0>(static_cast(*this))++=cpp11::get<0>(obj); - *cpp11::get<1>(static_cast(*this))++=cpp11::get<1>(obj); - return *this; - } - - Self& operator=(const Self& s){ - static_cast< Iterator_tuple& >(*this) = static_cast< const Iterator_tuple& >(s); - return *this; - } - - template - Self& operator=(const boost::variant& t) { - internal::Output_visitor visitor(this); - boost::apply_visitor(visitor, t); - return *this; - } - - template - Self& operator=(const boost::optional< boost::variant >& t) { - internal::Output_visitor visitor(this); - if(t) boost::apply_visitor(visitor, *t); - return *this; - } - - const Iterator_tuple& get_iterator_tuple() const - { return *this; } - -}; - - -template -inline -Dispatch_output_iterator,cpp11::tuple > -dispatch_output(O1 out1,O2 out2){ - return Dispatch_output_iterator,cpp11::tuple >(out1,out2); -} - -//Version with DROP - -template -class Dispatch_or_drop_output_iterator,cpp11::tuple >: - public Dispatch_output_iterator,cpp11::tuple > -{ - typedef Dispatch_or_drop_output_iterator Self; - typedef Dispatch_output_iterator,cpp11::tuple > Base; - -public: - - Self& operator*(){ return *this; } - Self& operator++(){ return *this; } - Self& operator++(int){ return *this; } - - Dispatch_or_drop_output_iterator(O1 out1,O2 out2):Base(out1,out2){} - - #if defined(__EDG__) - typedef cpp11::tuple Iterator_tuple; - - Self& operator=(const V1& obj){ - *cpp11::get<0>(static_cast(*this))++=obj; - return *this; - } - - Self& operator=(const V2& obj){ - *cpp11::get<1>(static_cast(*this))++=obj; - return *this; - } - - Self& operator=(const Self& s){ - static_cast< Iterator_tuple& >(*this) = static_cast< const Iterator_tuple& >(s); - return *this; - } - - Self& operator=(const cpp11::tuple& t){ - static_cast< Base& >(*this) = t; - return *this; - } - #else - using Base::operator=; - #endif //defined(__EDG__) - - - template - Self& operator=(const T&){ - return *this; - } -}; - -template -inline -Dispatch_or_drop_output_iterator,cpp11::tuple > -dispatch_or_drop_output(O1 out1,O2 out2){ - return Dispatch_or_drop_output_iterator,cpp11::tuple >(out1,out2); -} - -//Version with 3 parameters -template -class Dispatch_output_iterator,cpp11::tuple >:public cpp11::tuple{ - typedef Dispatch_output_iterator Self; - -public: - typedef cpp11::tuple Value_type_tuple; - typedef cpp11::tuple Iterator_tuple; - typedef std::output_iterator_tag iterator_category; - typedef void value_type; - typedef void difference_type; - typedef void pointer; - typedef void reference; - - - Self& operator*(){ return *this; } - Self& operator++(){ return *this; } - Self& operator++(int){ return *this; } - - Dispatch_output_iterator(O1 out1,O2 out2,O3 out3):Iterator_tuple(out1,out2,out3){} - - //Added because required by MSVC10 - Dispatch_output_iterator(const Self& other): - Iterator_tuple(static_cast(other)) - {} - - Self& operator=(const V1& obj){ - *cpp11::get<0>(static_cast(*this))++=obj; - return *this; - } - - Self& operator=(const V2& obj){ - *cpp11::get<1>(static_cast(*this))++=obj; - return *this; - } - - Self& operator=(const V3& obj){ - *cpp11::get<2>(static_cast(*this))++=obj; - return *this; - } - - Self& operator=(const cpp11::tuple& obj){ - *cpp11::get<0>(static_cast(*this))++=cpp11::get<0>(obj); - *cpp11::get<1>(static_cast(*this))++=cpp11::get<1>(obj); - *cpp11::get<2>(static_cast(*this))++=cpp11::get<2>(obj); - return *this; - } - - Self& operator=(const Self& s){ - static_cast< Iterator_tuple& >(*this) = static_cast< const Iterator_tuple& >(s); - return *this; - } - - template - Self& operator=(const boost::variant& t) { - internal::Output_visitor visitor(this); - boost::apply_visitor(visitor, t); - return *this; - } - - template - Self& operator=(const boost::optional< boost::variant >& t) { - internal::Output_visitor visitor(this); - if(t) boost::apply_visitor(visitor, *t); - return *this; - } - - const Iterator_tuple& get_iterator_tuple() const - { return *this; } - -}; - - -template -inline -Dispatch_output_iterator,cpp11::tuple > -dispatch_output(O1 out1,O2 out2,O3 out3){ - return Dispatch_output_iterator,cpp11::tuple >(out1,out2,out3); -} - -//Version with DROP -template < typename V, typename O > -class Dispatch_or_drop_output_iterator; - - -template -class Dispatch_or_drop_output_iterator,cpp11::tuple >: - public Dispatch_output_iterator,cpp11::tuple > -{ - typedef Dispatch_or_drop_output_iterator Self; - typedef Dispatch_output_iterator,cpp11::tuple > Base; - -public: - - Self& operator*(){ return *this; } - Self& operator++(){ return *this; } - Self& operator++(int){ return *this; } - - Dispatch_or_drop_output_iterator(O1 out1,O2 out2,O3 out3):Base(out1,out2,out3){} - - #if defined(__EDG__) - typedef cpp11::tuple Iterator_tuple; - - Self& operator=(const V1& obj){ - *cpp11::get<0>(static_cast(*this))++=obj; - return *this; - } - - Self& operator=(const V2& obj){ - *cpp11::get<1>(static_cast(*this))++=obj; - return *this; - } - - Self& operator=(const V3& obj){ - *cpp11::get<2>(static_cast(*this))++=obj; - return *this; - } - - Self& operator=(const Self& s){ - static_cast< Iterator_tuple& >(*this) = static_cast< const Iterator_tuple& >(s); - return *this; - } - - Self& operator=(const cpp11::tuple& t){ - static_cast< Base& >(*this) = t; - return *this; - } - #else - using Base::operator=; - #endif //defined(__EDG__) - - - template - Self& operator=(const T&){ - return *this; - } -}; - -template -inline -Dispatch_or_drop_output_iterator,cpp11::tuple > -dispatch_or_drop_output(O1 out1,O2 out2,O3 out3){ - return Dispatch_or_drop_output_iterator,cpp11::tuple >(out1,out2,out3); -} - -//Version with 4 parameters -template -class Dispatch_output_iterator,cpp11::tuple >:public cpp11::tuple{ - typedef Dispatch_output_iterator Self; - -public: - typedef cpp11::tuple Value_type_tuple; - typedef cpp11::tuple Iterator_tuple; - typedef std::output_iterator_tag iterator_category; - typedef void value_type; - typedef void difference_type; - typedef void pointer; - typedef void reference; - - - Self& operator*(){ return *this; } - Self& operator++(){ return *this; } - Self& operator++(int){ return *this; } - - Dispatch_output_iterator(O1 out1,O2 out2,O3 out3,O4 out4):Iterator_tuple(out1,out2,out3,out4){} - - //Added because required by MSVC10 - Dispatch_output_iterator(const Self& other): - Iterator_tuple(static_cast(other)) - {} - - Self& operator=(const V1& obj){ - *cpp11::get<0>(static_cast(*this))++=obj; - return *this; - } - - Self& operator=(const V2& obj){ - *cpp11::get<1>(static_cast(*this))++=obj; - return *this; - } - - Self& operator=(const V3& obj){ - *cpp11::get<2>(static_cast(*this))++=obj; - return *this; - } - - Self& operator=(const V4& obj){ - *cpp11::get<3>(static_cast(*this))++=obj; - return *this; - } - - Self& operator=(const cpp11::tuple& obj){ - *cpp11::get<0>(static_cast(*this))++=cpp11::get<0>(obj); - *cpp11::get<1>(static_cast(*this))++=cpp11::get<1>(obj); - *cpp11::get<2>(static_cast(*this))++=cpp11::get<2>(obj); - *cpp11::get<3>(static_cast(*this))++=cpp11::get<3>(obj); - return *this; - } - - Self& operator=(const Self& s){ - static_cast< Iterator_tuple& >(*this) = static_cast< const Iterator_tuple& >(s); - return *this; - } - - template - Self& operator=(const boost::variant& t) { - internal::Output_visitor visitor(this); - boost::apply_visitor(visitor, t); - return *this; - } - - template - Self& operator=(const boost::optional< boost::variant >& t) { - internal::Output_visitor visitor(this); - if(t) boost::apply_visitor(visitor, *t); - return *this; - } - - const Iterator_tuple& get_iterator_tuple() const - { return *this; } - -}; - - -template -inline -Dispatch_output_iterator,cpp11::tuple > -dispatch_output(O1 out1,O2 out2,O3 out3,O4 out4){ - return Dispatch_output_iterator,cpp11::tuple >(out1,out2,out3,out4); -} - -//Version with DROP -template < typename V, typename O > -class Dispatch_or_drop_output_iterator; - - -template -class Dispatch_or_drop_output_iterator,cpp11::tuple >: - public Dispatch_output_iterator,cpp11::tuple > -{ - typedef Dispatch_or_drop_output_iterator Self; - typedef Dispatch_output_iterator,cpp11::tuple > Base; - -public: - - Self& operator*(){ return *this; } - Self& operator++(){ return *this; } - Self& operator++(int){ return *this; } - - Dispatch_or_drop_output_iterator(O1 out1,O2 out2,O3 out3,O4 out4):Base(out1,out2,out3,out4){} - - #if defined(__EDG__) - typedef cpp11::tuple Iterator_tuple; - - Self& operator=(const V1& obj){ - *cpp11::get<0>(static_cast(*this))++=obj; - return *this; - } - - Self& operator=(const V2& obj){ - *cpp11::get<1>(static_cast(*this))++=obj; - return *this; - } - - Self& operator=(const V3& obj){ - *cpp11::get<2>(static_cast(*this))++=obj; - return *this; - } - - Self& operator=(const V4& obj){ - *cpp11::get<3>(static_cast(*this))++=obj; - return *this; - } - - Self& operator=(const Self& s){ - static_cast< Iterator_tuple& >(*this) = static_cast< const Iterator_tuple& >(s); - return *this; - } - - Self& operator=(const cpp11::tuple& t){ - static_cast< Base& >(*this) = t; - return *this; - } - #else - using Base::operator=; - #endif //defined(__EDG__) - - - template - Self& operator=(const T&){ - return *this; - } -}; - -template -inline -Dispatch_or_drop_output_iterator,cpp11::tuple > -dispatch_or_drop_output(O1 out1,O2 out2,O3 out3,O4 out4){ - return Dispatch_or_drop_output_iterator,cpp11::tuple >(out1,out2,out3,out4); -} - -//Version with 5 parameters -template -class Dispatch_output_iterator,cpp11::tuple >:public cpp11::tuple{ - typedef Dispatch_output_iterator Self; - -public: - typedef cpp11::tuple Value_type_tuple; - typedef cpp11::tuple Iterator_tuple; - typedef std::output_iterator_tag iterator_category; - typedef void value_type; - typedef void difference_type; - typedef void pointer; - typedef void reference; - - - Self& operator*(){ return *this; } - Self& operator++(){ return *this; } - Self& operator++(int){ return *this; } - - Dispatch_output_iterator(O1 out1,O2 out2,O3 out3,O4 out4,O5 out5):Iterator_tuple(out1,out2,out3,out4,out5){} - - //Added because required by MSVC10 - Dispatch_output_iterator(const Self& other): - Iterator_tuple(static_cast(other)) - {} - - Self& operator=(const V1& obj){ - *cpp11::get<0>(static_cast(*this))++=obj; - return *this; - } - - Self& operator=(const V2& obj){ - *cpp11::get<1>(static_cast(*this))++=obj; - return *this; - } - - Self& operator=(const V3& obj){ - *cpp11::get<2>(static_cast(*this))++=obj; - return *this; - } - - Self& operator=(const V4& obj){ - *cpp11::get<3>(static_cast(*this))++=obj; - return *this; - } - - Self& operator=(const V5& obj){ - *cpp11::get<4>(static_cast(*this))++=obj; - return *this; - } - - Self& operator=(const cpp11::tuple& obj){ - *cpp11::get<0>(static_cast(*this))++=cpp11::get<0>(obj); - *cpp11::get<1>(static_cast(*this))++=cpp11::get<1>(obj); - *cpp11::get<2>(static_cast(*this))++=cpp11::get<2>(obj); - *cpp11::get<3>(static_cast(*this))++=cpp11::get<3>(obj); - *cpp11::get<4>(static_cast(*this))++=cpp11::get<4>(obj); - return *this; - } - - Self& operator=(const Self& s){ - static_cast< Iterator_tuple& >(*this) = static_cast< const Iterator_tuple& >(s); - return *this; - } - - template - Self& operator=(const boost::variant& t) { - internal::Output_visitor visitor(this); - boost::apply_visitor(visitor, t); - return *this; - } - - template - Self& operator=(const boost::optional< boost::variant >& t) { - internal::Output_visitor visitor(this); - if(t) boost::apply_visitor(visitor, *t); - return *this; - } - - - const Iterator_tuple& get_iterator_tuple() const - { return *this; } - -}; - - -template -inline -Dispatch_output_iterator,cpp11::tuple > -dispatch_output(O1 out1,O2 out2,O3 out3,O4 out4,O5 out5){ - return Dispatch_output_iterator,cpp11::tuple >(out1,out2,out3,out4,out5); -} - -//Version with DROP -template < typename V, typename O > -class Dispatch_or_drop_output_iterator; - - -template -class Dispatch_or_drop_output_iterator,cpp11::tuple >: - public Dispatch_output_iterator,cpp11::tuple > -{ - typedef Dispatch_or_drop_output_iterator Self; - typedef Dispatch_output_iterator,cpp11::tuple > Base; - -public: - - Self& operator*(){ return *this; } - Self& operator++(){ return *this; } - Self& operator++(int){ return *this; } - - Dispatch_or_drop_output_iterator(O1 out1,O2 out2,O3 out3,O4 out4,O5 out5):Base(out1,out2,out3,out4,out5){} - - #if defined(__EDG__) - typedef cpp11::tuple Iterator_tuple; - - Self& operator=(const V1& obj){ - *cpp11::get<0>(static_cast(*this))++=obj; - return *this; - } - - Self& operator=(const V2& obj){ - *cpp11::get<1>(static_cast(*this))++=obj; - return *this; - } - - Self& operator=(const V3& obj){ - *cpp11::get<2>(static_cast(*this))++=obj; - return *this; - } - - Self& operator=(const V4& obj){ - *cpp11::get<3>(static_cast(*this))++=obj; - return *this; - } - - Self& operator=(const V5& obj){ - *cpp11::get<4>(static_cast(*this))++=obj; - return *this; - } - - Self& operator=(const Self& s){ - static_cast< Iterator_tuple& >(*this) = static_cast< const Iterator_tuple& >(s); - return *this; - } - - Self& operator=(const cpp11::tuple& t){ - static_cast< Base& >(*this) = t; - return *this; - } - #else - using Base::operator=; - #endif //defined(__EDG__) - - - template - Self& operator=(const T&){ - return *this; - } -}; - -template -inline -Dispatch_or_drop_output_iterator,cpp11::tuple > -dispatch_or_drop_output(O1 out1,O2 out2,O3 out3,O4 out4,O5 out5){ - return Dispatch_or_drop_output_iterator,cpp11::tuple >(out1,out2,out3,out4,out5); -} - -//Version with 6 parameters -template -class Dispatch_output_iterator,cpp11::tuple >:public cpp11::tuple{ - typedef Dispatch_output_iterator Self; - -public: - typedef cpp11::tuple Value_type_tuple; - typedef cpp11::tuple Iterator_tuple; - typedef std::output_iterator_tag iterator_category; - typedef void value_type; - typedef void difference_type; - typedef void pointer; - typedef void reference; - - - Self& operator*(){ return *this; } - Self& operator++(){ return *this; } - Self& operator++(int){ return *this; } - - Dispatch_output_iterator(O1 out1,O2 out2,O3 out3,O4 out4,O5 out5,O6 out6):Iterator_tuple(out1,out2,out3,out4,out5,out6){} - - //Added because required by MSVC10 - Dispatch_output_iterator(const Self& other): - Iterator_tuple(static_cast(other)) - {} - - Self& operator=(const V1& obj){ - *cpp11::get<0>(static_cast(*this))++=obj; - return *this; - } - - Self& operator=(const V2& obj){ - *cpp11::get<1>(static_cast(*this))++=obj; - return *this; - } - - Self& operator=(const V3& obj){ - *cpp11::get<2>(static_cast(*this))++=obj; - return *this; - } - - Self& operator=(const V4& obj){ - *cpp11::get<3>(static_cast(*this))++=obj; - return *this; - } - - Self& operator=(const V5& obj){ - *cpp11::get<4>(static_cast(*this))++=obj; - return *this; - } - - Self& operator=(const V6& obj){ - *cpp11::get<5>(static_cast(*this))++=obj; - return *this; - } - - Self& operator=(const cpp11::tuple& obj){ - *cpp11::get<0>(static_cast(*this))++=cpp11::get<0>(obj); - *cpp11::get<1>(static_cast(*this))++=cpp11::get<1>(obj); - *cpp11::get<2>(static_cast(*this))++=cpp11::get<2>(obj); - *cpp11::get<3>(static_cast(*this))++=cpp11::get<3>(obj); - *cpp11::get<4>(static_cast(*this))++=cpp11::get<4>(obj); - *cpp11::get<5>(static_cast(*this))++=cpp11::get<5>(obj); - return *this; - } - - Self& operator=(const Self& s){ - static_cast< Iterator_tuple& >(*this) = static_cast< const Iterator_tuple& >(s); - return *this; - } - - template - Self& operator=(const boost::variant& t) { - internal::Output_visitor visitor(this); - boost::apply_visitor(visitor, t); - return *this; - } - - template - Self& operator=(const boost::optional< boost::variant >& t) { - internal::Output_visitor visitor(this); - if(t) boost::apply_visitor(visitor, *t); - return *this; - } - - const Iterator_tuple& get_iterator_tuple() const - { return *this; } - -}; - - -template -inline -Dispatch_output_iterator,cpp11::tuple > -dispatch_output(O1 out1,O2 out2,O3 out3,O4 out4,O5 out5,O6 out6){ - return Dispatch_output_iterator,cpp11::tuple >(out1,out2,out3,out4,out5,out6); -} - -//Version with DROP -template < typename V, typename O > -class Dispatch_or_drop_output_iterator; - - -template -class Dispatch_or_drop_output_iterator,cpp11::tuple >: - public Dispatch_output_iterator,cpp11::tuple > -{ - typedef Dispatch_or_drop_output_iterator Self; - typedef Dispatch_output_iterator,cpp11::tuple > Base; - -public: - - Self& operator*(){ return *this; } - Self& operator++(){ return *this; } - Self& operator++(int){ return *this; } - - Dispatch_or_drop_output_iterator(O1 out1,O2 out2,O3 out3,O4 out4,O5 out5,O6 out6):Base(out1,out2,out3,out4,out5,out6){} - - #if defined(__EDG__) - typedef cpp11::tuple Iterator_tuple; - - Self& operator=(const V1& obj){ - *cpp11::get<0>(static_cast(*this))++=obj; - return *this; - } - - Self& operator=(const V2& obj){ - *cpp11::get<1>(static_cast(*this))++=obj; - return *this; - } - - Self& operator=(const V3& obj){ - *cpp11::get<2>(static_cast(*this))++=obj; - return *this; - } - - Self& operator=(const V4& obj){ - *cpp11::get<3>(static_cast(*this))++=obj; - return *this; - } - - Self& operator=(const V5& obj){ - *cpp11::get<4>(static_cast(*this))++=obj; - return *this; - } - - Self& operator=(const V6& obj){ - *cpp11::get<5>(static_cast(*this))++=obj; - return *this; - } - - Self& operator=(const Self& s){ - static_cast< Iterator_tuple& >(*this) = static_cast< const Iterator_tuple& >(s); - return *this; - } - - Self& operator=(const cpp11::tuple& t){ - static_cast< Base& >(*this) = t; - return *this; - } - #else - using Base::operator=; - #endif //defined(__EDG__) - - - template - Self& operator=(const T&){ - return *this; - } -}; - -template -inline -Dispatch_or_drop_output_iterator,cpp11::tuple > -dispatch_or_drop_output(O1 out1,O2 out2,O3 out3,O4 out4,O5 out5,O6 out6){ - return Dispatch_or_drop_output_iterator,cpp11::tuple >(out1,out2,out3,out4,out5,out6); -} - -//Version with 7 parameters -template -class Dispatch_output_iterator,cpp11::tuple >:public cpp11::tuple{ - typedef Dispatch_output_iterator Self; - -public: - typedef cpp11::tuple Value_type_tuple; - typedef cpp11::tuple Iterator_tuple; - typedef std::output_iterator_tag iterator_category; - typedef void value_type; - typedef void difference_type; - typedef void pointer; - typedef void reference; - - - Self& operator*(){ return *this; } - Self& operator++(){ return *this; } - Self& operator++(int){ return *this; } - - Dispatch_output_iterator(O1 out1,O2 out2,O3 out3,O4 out4,O5 out5,O6 out6,O7 out7):Iterator_tuple(out1,out2,out3,out4,out5,out6,out7){} - - //Added because required by MSVC10 - Dispatch_output_iterator(const Self& other): - Iterator_tuple(static_cast(other)) - {} - - Self& operator=(const V1& obj){ - *cpp11::get<0>(static_cast(*this))++=obj; - return *this; - } - - Self& operator=(const V2& obj){ - *cpp11::get<1>(static_cast(*this))++=obj; - return *this; - } - - Self& operator=(const V3& obj){ - *cpp11::get<2>(static_cast(*this))++=obj; - return *this; - } - - Self& operator=(const V4& obj){ - *cpp11::get<3>(static_cast(*this))++=obj; - return *this; - } - - Self& operator=(const V5& obj){ - *cpp11::get<4>(static_cast(*this))++=obj; - return *this; - } - - Self& operator=(const V6& obj){ - *cpp11::get<5>(static_cast(*this))++=obj; - return *this; - } - - Self& operator=(const V7& obj){ - *cpp11::get<6>(static_cast(*this))++=obj; - return *this; - } - - Self& operator=(const cpp11::tuple& obj){ - *cpp11::get<0>(static_cast(*this))++=cpp11::get<0>(obj); - *cpp11::get<1>(static_cast(*this))++=cpp11::get<1>(obj); - *cpp11::get<2>(static_cast(*this))++=cpp11::get<2>(obj); - *cpp11::get<3>(static_cast(*this))++=cpp11::get<3>(obj); - *cpp11::get<4>(static_cast(*this))++=cpp11::get<4>(obj); - *cpp11::get<5>(static_cast(*this))++=cpp11::get<5>(obj); - *cpp11::get<6>(static_cast(*this))++=cpp11::get<6>(obj); - return *this; - } - - Self& operator=(const Self& s){ - static_cast< Iterator_tuple& >(*this) = static_cast< const Iterator_tuple& >(s); - return *this; - } - - template - Self& operator=(const boost::variant& t) { - internal::Output_visitor visitor(this); - boost::apply_visitor(visitor, t); - return *this; - } - - template - Self& operator=(const boost::optional< boost::variant >& t) { - internal::Output_visitor visitor(this); - if(t) boost::apply_visitor(visitor, *t); - return *this; - } - - const Iterator_tuple& get_iterator_tuple() const - { return *this; } - -}; - - -template -inline -Dispatch_output_iterator,cpp11::tuple > -dispatch_output(O1 out1,O2 out2,O3 out3,O4 out4,O5 out5,O6 out6,O7 out7){ - return Dispatch_output_iterator,cpp11::tuple >(out1,out2,out3,out4,out5,out6,out7); -} - -//Version with DROP -template < typename V, typename O > -class Dispatch_or_drop_output_iterator; - - -template -class Dispatch_or_drop_output_iterator,cpp11::tuple >: - public Dispatch_output_iterator,cpp11::tuple > -{ - typedef Dispatch_or_drop_output_iterator Self; - typedef Dispatch_output_iterator,cpp11::tuple > Base; - -public: - - Self& operator*(){ return *this; } - Self& operator++(){ return *this; } - Self& operator++(int){ return *this; } - - Dispatch_or_drop_output_iterator(O1 out1,O2 out2,O3 out3,O4 out4,O5 out5,O6 out6,O7 out7):Base(out1,out2,out3,out4,out5,out6,out7){} - - #if defined(__EDG__) - typedef cpp11::tuple Iterator_tuple; - - Self& operator=(const V1& obj){ - *cpp11::get<0>(static_cast(*this))++=obj; - return *this; - } - - Self& operator=(const V2& obj){ - *cpp11::get<1>(static_cast(*this))++=obj; - return *this; - } - - Self& operator=(const V3& obj){ - *cpp11::get<2>(static_cast(*this))++=obj; - return *this; - } - - Self& operator=(const V4& obj){ - *cpp11::get<3>(static_cast(*this))++=obj; - return *this; - } - - Self& operator=(const V5& obj){ - *cpp11::get<4>(static_cast(*this))++=obj; - return *this; - } - - Self& operator=(const V6& obj){ - *cpp11::get<5>(static_cast(*this))++=obj; - return *this; - } - - Self& operator=(const V7& obj){ - *cpp11::get<6>(static_cast(*this))++=obj; - return *this; - } - - Self& operator=(const Self& s){ - static_cast< Iterator_tuple& >(*this) = static_cast< const Iterator_tuple& >(s); - return *this; - } - - Self& operator=(const cpp11::tuple& t){ - static_cast< Base& >(*this) = t; - return *this; - } - #else - using Base::operator=; - #endif //defined(__EDG__) - - - template - Self& operator=(const T&){ - return *this; - } -}; - -template -inline -Dispatch_or_drop_output_iterator,cpp11::tuple > -dispatch_or_drop_output(O1 out1,O2 out2,O3 out3,O4 out4,O5 out5,O6 out6,O7 out7){ - return Dispatch_or_drop_output_iterator,cpp11::tuple >(out1,out2,out3,out4,out5,out6,out7); -} - -#endif - } //namespace CGAL #include diff --git a/STL_Extension/include/CGAL/utility.h b/STL_Extension/include/CGAL/utility.h index 06c70f4e90a..44d9cae2724 100644 --- a/STL_Extension/include/CGAL/utility.h +++ b/STL_Extension/include/CGAL/utility.h @@ -31,6 +31,7 @@ #include #include #include +#include #include // The Triple and Quadruple classes are NOT RECOMMENDED anymore. @@ -290,33 +291,6 @@ operator<(const Quadruple& x, (!(y.third < x.third) && x.fourth < y.fourth)) ) ) ) ); } -#if defined(CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE) || \ - defined(CGAL_CFG_NO_CPP0X_DEFAULT_TEMPLATE_ARGUMENTS_FOR_FUNCTION_TEMPLATES) || \ - BOOST_VERSION < 105000 || \ - defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS) -template -inline -std::pair< T, T > -make_sorted_pair(const T& t1, const T& t2, Compare comp) -{ - return comp(t1, t2) ? std::make_pair(t1,t2) : std::make_pair(t2,t1); -} - -template -inline -std::pair -make_sorted_pair(const T& t1, const T& t2) -{ - return make_sorted_pair(t1,t2, std::less()); -} -#else - -} //end of namespace CGAL - -#include - -namespace CGAL { - struct Default_using_type { template @@ -357,7 +331,6 @@ inline P make_sorted_pair(T1&& t1, T2&& t2, Compare comp = Compare()) return comp(t1, t2) ? P(std::forward(t1), std::forward(t2)) : P(std::forward(t2), std::forward(t1)); } -#endif } //namespace CGAL diff --git a/STL_Extension/test/STL_Extension/test_Cache.cpp b/STL_Extension/test/STL_Extension/test_Cache.cpp index 188830a95e4..94b9af54d0b 100644 --- a/STL_Extension/test/STL_Extension/test_Cache.cpp +++ b/STL_Extension/test/STL_Extension/test_Cache.cpp @@ -40,9 +40,7 @@ struct Int_t : public CGAL::Handle_with_policy< Int_rep, Unify > { // This is needed to prevent VC7.1 and VC8 to call // the explicit templated constructor in Base instead of its copy-ctor. Int_t( Int_t const& rhs ) : Base( static_cast(rhs) ) {} -#ifndef CGAL_CFG_NO_CPP0X_DELETED_AND_DEFAULT_FUNCTIONS - Int_t& operator=(Int_t const&)=default; -#endif + Int_t& operator=(Int_t const&)=default; int value() const { return this->ptr()->val; } void set_value( int i) { this->copy_on_write(); diff --git a/STL_Extension/test/STL_Extension/test_In_place_list.cpp b/STL_Extension/test/STL_Extension/test_In_place_list.cpp index 34a01dfb356..c8a5e7105d6 100644 --- a/STL_Extension/test/STL_Extension/test_In_place_list.cpp +++ b/STL_Extension/test/STL_Extension/test_In_place_list.cpp @@ -184,10 +184,7 @@ struct item : public In_place_list_base { item( const item& i) : In_place_list_base(i), key(i.key) {} -#ifndef CGAL_CFG_NO_CPP0X_DELETED_AND_DEFAULT_FUNCTIONS item& operator=(const item& rhs)=default; -#endif - bool operator== (const item& i) const { return key == i.key;} bool operator!= (const item& i) const { return key != i.key;} bool operator== (int i) const { return key == i;} From 0669c6ad97d2b6ad43ddb141383b69e20c84435f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 19 Mar 2019 12:28:36 +0100 Subject: [PATCH 03/28] remove error messages and disabled test if CPP11 is not available in PSP --- .../examples/Point_set_processing_3/property_map.cpp | 3 +-- Point_set_processing_3/include/CGAL/IO/read_las_points.h | 3 --- Point_set_processing_3/include/CGAL/IO/read_ply_points.h | 3 --- Point_set_processing_3/include/CGAL/IO/write_las_points.h | 3 --- Point_set_processing_3/include/CGAL/IO/write_ply_points.h | 3 --- .../include/CGAL/bilateral_smooth_point_set.h | 2 -- 6 files changed, 1 insertion(+), 16 deletions(-) diff --git a/Point_set_processing_3/examples/Point_set_processing_3/property_map.cpp b/Point_set_processing_3/examples/Point_set_processing_3/property_map.cpp index ac74a7f5ed3..72e6edb596f 100644 --- a/Point_set_processing_3/examples/Point_set_processing_3/property_map.cpp +++ b/Point_set_processing_3/examples/Point_set_processing_3/property_map.cpp @@ -155,7 +155,6 @@ int main() } } - #ifndef CGAL_CFG_NO_CPP0X_TUPLE // same test with std::tuple { typedef std::tuple IndexedPointWithOrientableNormalTuple; @@ -175,6 +174,6 @@ int main() CGAL::make_nth_of_tuple_property_map<2>(IndexedPointWithOrientableNormalTuple()), CGAL::make_nth_of_tuple_property_map<3>(IndexedPointWithOrientableNormalTuple())); } - #endif + return 0; } diff --git a/Point_set_processing_3/include/CGAL/IO/read_las_points.h b/Point_set_processing_3/include/CGAL/IO/read_las_points.h index 538ef68dcfd..0102a0be288 100644 --- a/Point_set_processing_3/include/CGAL/IO/read_las_points.h +++ b/Point_set_processing_3/include/CGAL/IO/read_las_points.h @@ -24,9 +24,6 @@ #include #include -#if defined(CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE) || defined(CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES) -#error CGAL LAS reader requires a C++11 compiler -#endif #include diff --git a/Point_set_processing_3/include/CGAL/IO/read_ply_points.h b/Point_set_processing_3/include/CGAL/IO/read_ply_points.h index 094e3ac7633..3f7d18f1435 100644 --- a/Point_set_processing_3/include/CGAL/IO/read_ply_points.h +++ b/Point_set_processing_3/include/CGAL/IO/read_ply_points.h @@ -24,9 +24,6 @@ #include #include -#if defined(CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE) || defined(CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES) -#error CGAL PLY reader requires a C++11 compiler -#endif #include diff --git a/Point_set_processing_3/include/CGAL/IO/write_las_points.h b/Point_set_processing_3/include/CGAL/IO/write_las_points.h index 07cb6e244f7..b6ba6d76c75 100644 --- a/Point_set_processing_3/include/CGAL/IO/write_las_points.h +++ b/Point_set_processing_3/include/CGAL/IO/write_las_points.h @@ -24,9 +24,6 @@ #include #include -#if defined(CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE) || defined(CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES) -#error CGAL LAS writer requires a C++11 compiler -#endif #include diff --git a/Point_set_processing_3/include/CGAL/IO/write_ply_points.h b/Point_set_processing_3/include/CGAL/IO/write_ply_points.h index 7d9886858b9..e20d211252f 100644 --- a/Point_set_processing_3/include/CGAL/IO/write_ply_points.h +++ b/Point_set_processing_3/include/CGAL/IO/write_ply_points.h @@ -24,9 +24,6 @@ #include #include -#if defined(CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE) || defined(CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES) -#error CGAL PLY writer requires a C++11 compiler -#endif #include diff --git a/Point_set_processing_3/include/CGAL/bilateral_smooth_point_set.h b/Point_set_processing_3/include/CGAL/bilateral_smooth_point_set.h index da0d9c43a97..a379ad01b3b 100644 --- a/Point_set_processing_3/include/CGAL/bilateral_smooth_point_set.h +++ b/Point_set_processing_3/include/CGAL/bilateral_smooth_point_set.h @@ -93,9 +93,7 @@ public: : Base(other), index(other.index) {} -#ifndef CGAL_CFG_NO_CPP0X_DELETED_AND_DEFAULT_FUNCTIONS Kd_tree_element& operator=(const Kd_tree_element&)=default; -#endif }; From f95533f2d213d4117aaa803d47684ccef3a8b276 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 19 Mar 2019 13:02:46 +0100 Subject: [PATCH 04/28] remove conditional code with cpp11 in Number types --- Number_types/include/CGAL/Mpzf.h | 9 +-------- Number_types/include/CGAL/Quotient.h | 19 ------------------- Number_types/include/CGAL/double.h | 8 +------- Number_types/include/CGAL/float.h | 4 +--- 4 files changed, 3 insertions(+), 37 deletions(-) diff --git a/Number_types/include/CGAL/Mpzf.h b/Number_types/include/CGAL/Mpzf.h index bcf2c480c87..73fe360be9f 100644 --- a/Number_types/include/CGAL/Mpzf.h +++ b/Number_types/include/CGAL/Mpzf.h @@ -356,8 +356,7 @@ struct Mpzf { exp=x.exp; if(size!=0) mpn_copyi(data(),x.data(),asize); } -#if !defined(CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE) \ - && !defined(CGAL_MPZF_USE_CACHE) +#if !defined(CGAL_MPZF_USE_CACHE) Mpzf(Mpzf&& x):data_(x.data()),size(x.size),exp(x.exp){ x.init(); // yes, that's a shame... x.size = 0; @@ -944,9 +943,7 @@ struct Mpzf { } #ifdef CGAL_USE_GMPXX -#ifndef CGAL_CFG_NO_CPP0X_EXPLICIT_CONVERSION_OPERATORS explicit -#endif operator mpq_class () const { mpq_class q; export_to_mpq_t(q.get_mpq_t()); @@ -954,9 +951,7 @@ struct Mpzf { } #endif -#ifndef CGAL_CFG_NO_CPP0X_EXPLICIT_CONVERSION_OPERATORS explicit -#endif operator Gmpq () const { Gmpq q; export_to_mpq_t(q.mpq()); @@ -983,9 +978,7 @@ struct Mpzf { } } #if 0 -#ifndef CGAL_CFG_NO_CPP0X_EXPLICIT_CONVERSION_OPERATORS explicit -#endif // This makes Mpzf==int ambiguous operator Gmpzf () const { mpz_t z; diff --git a/Number_types/include/CGAL/Quotient.h b/Number_types/include/CGAL/Quotient.h index 800620d7c0e..1a0bc36fd12 100644 --- a/Number_types/include/CGAL/Quotient.h +++ b/Number_types/include/CGAL/Quotient.h @@ -119,29 +119,10 @@ class Quotient return *this; } -#ifdef CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE - template Quotient(const T1& n, const T2& d) : num(n), den(d) { CGAL_precondition( d != 0 ); } -#else - template - Quotient(T1 && n, T2 && d) - : num(std::forward(n)), den(std::forward(d)) - { CGAL_postcondition( den != 0 ); } - - Quotient(NT && n) - : num(std::move(n)), den(1) {} - - Quotient& operator=(NT && n) - { - num = std::move(n); - den = 1; - return *this; - } -#endif - Quotient& operator+= (const Quotient& r); Quotient& operator-= (const Quotient& r); Quotient& operator*= (const Quotient& r); diff --git a/Number_types/include/CGAL/double.h b/Number_types/include/CGAL/double.h index 0d924c7cb75..d9384887f9e 100644 --- a/Number_types/include/CGAL/double.h +++ b/Number_types/include/CGAL/double.h @@ -174,14 +174,8 @@ template <> class Real_embeddable_traits< double > Type d = x; IEEE_754_double* p = reinterpret_cast(&d); return is_finite_by_mask_double( p->c.H ); -#elif !defined CGAL_CFG_NO_CPP0X_ISFINITE - return std::isfinite(x); -#elif defined CGAL_CFG_NUMERIC_LIMITS_BUG - return (x == x) && (is_valid(x-x)); #else - return (x != std::numeric_limits::infinity()) - && (-x != std::numeric_limits::infinity()) - && is_valid(x); + return std::isfinite(x); #endif } }; diff --git a/Number_types/include/CGAL/float.h b/Number_types/include/CGAL/float.h index 5377b6e87f1..1654b5fdc60 100644 --- a/Number_types/include/CGAL/float.h +++ b/Number_types/include/CGAL/float.h @@ -124,10 +124,8 @@ public: Type f = x; IEEE_754_float* p = reinterpret_cast(&f); return is_finite_by_mask_float( p->c ); -#elif !defined CGAL_CFG_NO_CPP0X_ISFINITE - return std::isfinite(x); #else - return (x == x) && (is_valid(x-x)); + return std::isfinite(x); #endif } }; From 8ec090d1d15320037d6708c88a12ef4a820e575c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 19 Mar 2019 13:05:21 +0100 Subject: [PATCH 05/28] remove condition for cpp11 in Nef --- Nef_3/include/CGAL/Nef_3/SNC_list.h | 14 +++----------- Nef_3/include/CGAL/Nef_3/SNC_sphere_map.h | 2 -- Nef_S2/include/CGAL/Nef_S2/SM_list.h | 10 ++-------- 3 files changed, 5 insertions(+), 21 deletions(-) diff --git a/Nef_3/include/CGAL/Nef_3/SNC_list.h b/Nef_3/include/CGAL/Nef_3/SNC_list.h index 1113b6b1c4e..46553c3bf52 100644 --- a/Nef_3/include/CGAL/Nef_3/SNC_list.h +++ b/Nef_3/include/CGAL/Nef_3/SNC_list.h @@ -39,9 +39,7 @@ public: // typedef typename Vertex::Vertex_handle Vertex_handle; // typedef typename Vertex::Vertex_const_handle Vertex_const_handle; SNC_in_place_list_sm() {} -#ifndef CGAL_CFG_NO_CPP0X_DELETED_AND_DEFAULT_FUNCTIONS SNC_in_place_list_sm(const Self&)=default; -#endif SNC_in_place_list_sm(const Sphere_map& sm) // down cast : Sphere_map(sm) {} Self& operator=( const Self& sm) { @@ -63,9 +61,7 @@ public: SNC_in_place_list_halffacet() {} SNC_in_place_list_halffacet(const Halffacet& v) // down cast : Halffacet(v) {} -#ifndef CGAL_CFG_NO_CPP0X_DELETED_AND_DEFAULT_FUNCTIONS - SNC_in_place_list_halffacet(const Self&)=default; -#endif + SNC_in_place_list_halffacet(const Self&)=default; Self& operator=( const Self& v) { // This self written assignment avoids that assigning vertices will // overwrite the list linking of the target vertex. @@ -85,9 +81,7 @@ public: SNC_in_place_list_volume() {} SNC_in_place_list_volume(const Volume& v) // down cast : Volume(v) {} -#ifndef CGAL_CFG_NO_CPP0X_DELETED_AND_DEFAULT_FUNCTIONS - SNC_in_place_list_volume(const Self&)=default; -#endif + SNC_in_place_list_volume(const Self&)=default; Self& operator=( const Self& v) { // This self written assignment avoids that assigning vertices will // overwrite the list linking of the target vertex. @@ -107,9 +101,7 @@ public: SNC_in_place_list_shalfloop() {} SNC_in_place_list_shalfloop(const SHalfloop& v) // down cast : SHalfloop(v) {} -#ifndef CGAL_CFG_NO_CPP0X_DELETED_AND_DEFAULT_FUNCTIONS - SNC_in_place_list_shalfloop(const Self&)=default; -#endif + SNC_in_place_list_shalfloop(const Self&)=default; Self& operator=( const Self& v) { // This self written assignment avoids that assigning vertices will // overwrite the list linking of the target vertex. diff --git a/Nef_3/include/CGAL/Nef_3/SNC_sphere_map.h b/Nef_3/include/CGAL/Nef_3/SNC_sphere_map.h index 64726dd6037..195f4f6090d 100644 --- a/Nef_3/include/CGAL/Nef_3/SNC_sphere_map.h +++ b/Nef_3/include/CGAL/Nef_3/SNC_sphere_map.h @@ -154,9 +154,7 @@ class SNC_sphere_map : public Items_::template Vertex Date: Tue, 19 Mar 2019 13:17:37 +0100 Subject: [PATCH 06/28] remove variadic template workaround for cmap, gmap, and lcell --- BGL/examples/BGL_LCC/range_lcc.cpp | 2 - BGL/examples/BGL_polyhedron_3/range.cpp | 2 - .../include/CGAL/Combinatorial_map.h | 649 ----- .../include/CGAL/Dart_const_iterators.h | 67 +- .../include/CGAL/Dart_iterators.h | 198 -- .../Combinatorial_map_internal_functors.h | 2 - .../CGAL/internal/Combinatorial_map_utility.h | 119 - .../Combinatorial_map_utility_novariadic.h | 2574 ----------------- .../include/CGAL/GMap_dart_const_iterators.h | 66 - .../include/CGAL/GMap_dart_iterators.h | 204 -- .../include/CGAL/Generalized_map.h | 608 ---- .../Generalized_map_internal_functors.h | 2 - .../include/CGAL/Linear_cell_complex_base.h | 60 - 13 files changed, 1 insertion(+), 4552 deletions(-) delete mode 100644 Combinatorial_map/include/CGAL/internal/Combinatorial_map_utility_novariadic.h diff --git a/BGL/examples/BGL_LCC/range_lcc.cpp b/BGL/examples/BGL_LCC/range_lcc.cpp index d33676676b4..6e1e30aefbb 100644 --- a/BGL/examples/BGL_LCC/range_lcc.cpp +++ b/BGL/examples/BGL_LCC/range_lcc.cpp @@ -37,12 +37,10 @@ void fct(const LCC& lcc) { vertex_range vr(vertices(lcc)); -#ifndef CGAL_CFG_NO_CPP0X_RANGE_BASED_FOR std::cout << "new for loop" << std::endl; for(vertex_descriptor vd : vr){ std::cout << vd->point() << std::endl; } -#endif std::cout << "BOOST_FOREACH" << std::endl; BOOST_FOREACH(vertex_descriptor vd, vr){ diff --git a/BGL/examples/BGL_polyhedron_3/range.cpp b/BGL/examples/BGL_polyhedron_3/range.cpp index 48343cca787..dfddcdebf5d 100644 --- a/BGL/examples/BGL_polyhedron_3/range.cpp +++ b/BGL/examples/BGL_polyhedron_3/range.cpp @@ -36,12 +36,10 @@ void fct(const Polyhedron& p) { vertex_range vr(vertices(p)); -#ifndef CGAL_CFG_NO_CPP0X_RANGE_BASED_FOR std::cout << "new for loop" << std::endl; for(vertex_descriptor vd : vr){ std::cout << vd->point() << std::endl; } -#endif std::cout << "BOOST_FOREACH" << std::endl; BOOST_FOREACH(vertex_descriptor vd, vr){ diff --git a/Combinatorial_map/include/CGAL/Combinatorial_map.h b/Combinatorial_map/include/CGAL/Combinatorial_map.h index 341789472da..9ccf7126441 100644 --- a/Combinatorial_map/include/CGAL/Combinatorial_map.h +++ b/Combinatorial_map/include/CGAL/Combinatorial_map.h @@ -431,7 +431,6 @@ namespace CGAL { * is unmarked for all the marks. * @return a Dart_handle on the new dart. */ -#ifndef CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES template < typename... Args > Dart_handle create_dart(const Args&... args) { @@ -439,90 +438,6 @@ namespace CGAL { init_dart(res); return res; } -#else - Dart_handle create_dart() - { - Dart_handle res=mdarts.emplace(); - init_dart(res); - return res; - } - template < typename T1 > - Dart_handle create_dart(const T1 &t1) - { - Dart_handle res=mdarts.emplace(t1); - init_dart(res); - return res; - } - template < typename T1, typename T2 > - Dart_handle create_dart(const T1 &t1, const T2 &t2) - { - Dart_handle res=mdarts.emplace(t1, t2); - init_dart(res); - return res; - } - template < typename T1, typename T2, typename T3 > - Dart_handle create_dart(const T1 &t1, const T2 &t2, const T3 &t3) - { - Dart_handle res=mdarts.emplace(t1, t2, t3); - init_dart(res); - return res; - } - template < typename T1, typename T2, typename T3, typename T4 > - Dart_handle create_dart(const T1 &t1, const T2 &t2, const T3 &t3, - const T4 &t4) - { - Dart_handle res=mdarts.emplace(t1, t2, t3, t4); - init_dart(res); - return res; - } - template < typename T1, typename T2, typename T3, typename T4, typename T5 > - Dart_handle create_dart(const T1 &t1, const T2 &t2, const T3 &t3, - const T4 &t4, const T5 &t5) - { - Dart_handle res=mdarts.emplace(t1, t2, t3, t4, t5); - init_dart(res); - return res; - } - template < typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6 > - Dart_handle create_dart(const T1 &t1, const T2 &t2, const T3 &t3, - const T4 &t4, const T5 &t5, const T6 &t6) - { - Dart_handle res=mdarts.emplace(t1, t2, t3, t4, t5, t6); - init_dart(res); - return res; - } - template < typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7 > - Dart_handle create_dart(const T1 &t1, const T2 &t2, const T3 &t3, - const T4 &t4, const T5 &t5, const T6 &t6, - const T7 &t7) - { - Dart_handle res=mdarts.emplace(t1, t2, t3, t4, t5, t6, t7); - init_dart(res); - return res; - } - template < typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8 > - Dart_handle create_dart(const T1 &t1, const T2 &t2, const T3 &t3, - const T4 &t4, const T5 &t5, const T6 &t6, - const T7 &t7, const T8 &t8) - { - Dart_handle res=mdarts.emplace(t1, t2, t3, t4, t5, t6, t7, t8); - init_dart(res); - return res; - } - template < typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9 > - Dart_handle create_dart(const T1 &t1, const T2 &t2, const T3 &t3, - const T4 &t4, const T5 &t5, const T6 &t6, - const T7 &t7, const T8 &t8, const T9 &t9) - { - Dart_handle res=mdarts.emplace(t1, t2, t3, t4, t5, t6, t7, t8, t9); - init_dart(res); - return res; - } -#endif /** Erase a dart from the list of darts. * @param adart the dart to erase. @@ -731,8 +646,6 @@ namespace CGAL { /// @return the betas of ADart (beta are used in the same order than /// they are given as parameters) - -#ifndef CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES template Dart_handle beta(Dart_handle ADart, Betas... betas) { return CGAL::internal::Beta_functor:: @@ -749,119 +662,6 @@ namespace CGAL { Dart_const_handle beta(Dart_const_handle ADart) const { return CGAL::internal::Beta_functor_static:: run(*this, ADart); } -#else - Dart_handle beta(Dart_handle ADart, int B1) - { return this->get_beta(ADart, B1); } - Dart_handle beta(Dart_handle ADart, int B1, int B2) - { return beta(beta(ADart, B1), B2); } - Dart_handle beta(Dart_handle ADart, int B1, int B2, int B3) - { return beta(beta(ADart, B1), B2, B3); } - Dart_handle beta(Dart_handle ADart, int B1, int B2, int B3, - int B4) - { return beta(beta(ADart, B1), B2, B3, B4); } - Dart_handle beta(Dart_handle ADart, int B1, int B2, int B3, - int B4, int B5) - { return beta(beta(ADart, B1), B2, B3, B4, B5); } - Dart_handle beta(Dart_handle ADart, int B1, int B2, int B3, - int B4, int B5, int B6) - { return beta(beta(ADart, B1), B2, B3, B4, B5, B6); } - Dart_handle beta(Dart_handle ADart, int B1, int B2, int B3, - int B4, int B5, int B6, int B7) - { return beta(beta(ADart, B1), B2, B3, B4, B5, B6, B7); } - Dart_handle beta(Dart_handle ADart, int B1, int B2, int B3, - int B4, int B5, int B6, int B7, int B8) - { return beta(beta(ADart, B1), B2, B3, B4, B5, B6, B7, B8); } - Dart_handle beta(Dart_handle ADart, int B1, int B2, int B3, - int B4, int B5, int B6, int B7, int B8, int B9) - { return beta(beta(ADart, B1), B2, B3, B4, B5, B6, B7, B8, B9); } - - template - Dart_handle beta(Dart_handle ADart) - { return this->template get_beta(ADart); } - template - Dart_handle beta(Dart_handle ADart) - { return beta(beta(ADart)); } - template - Dart_handle beta(Dart_handle ADart) - { return beta(beta(ADart)); } - template - Dart_handle beta(Dart_handle ADart) - { return beta(beta(ADart)); } - template - Dart_handle beta(Dart_handle ADart) - { return beta(beta(ADart)); } - template - Dart_handle beta(Dart_handle ADart) - { return beta(beta(ADart)); } - template - Dart_handle beta(Dart_handle ADart) - { return beta(beta(ADart)); } - template - Dart_handle beta(Dart_handle ADart) - { return beta(beta(ADart)); } - template - Dart_handle beta(Dart_handle ADart) - { return beta(beta(ADart)); } - - Dart_const_handle beta(Dart_const_handle ADart, int B1) const - { return this->get_beta(ADart, B1); } - Dart_const_handle beta(Dart_const_handle ADart, int B1, int B2) const - { return beta(beta(ADart, B1), B2); } - Dart_const_handle beta(Dart_const_handle ADart, int B1, int B2, int B3) const - { return beta(beta(ADart, B1), B2, B3); } - Dart_const_handle beta(Dart_const_handle ADart, int B1, int B2, int B3, - int B4) const - { return beta(beta(ADart, B1), B2, B3, B4); } - Dart_const_handle beta(Dart_const_handle ADart, int B1, int B2, int B3, - int B4, int B5) const - { return beta(beta(ADart, B1), B2, B3, B4, B5); } - Dart_const_handle beta(Dart_const_handle ADart, int B1, int B2, int B3, - int B4, int B5, int B6) const - { return beta(beta(ADart, B1), B2, B3, B4, B5, B6); } - Dart_const_handle beta(Dart_const_handle ADart, int B1, int B2, int B3, - int B4, int B5, int B6, int B7) const - { return beta(beta(ADart, B1), B2, B3, B4, B5, B6, B7); } - Dart_const_handle beta(Dart_const_handle ADart, int B1, int B2, int B3, - int B4, int B5, int B6, int B7, int B8) const - { return beta(beta(ADart, B1), B2, B3, B4, B5, B6, B7, B8); } - Dart_const_handle beta(Dart_const_handle ADart, int B1, int B2, int B3, - int B4, int B5, int B6, int B7, int B8, int B9) const - { return beta(beta(ADart, B1), B2, B3, B4, B5, B6, B7, B8, B9); } - - template - Dart_const_handle beta(Dart_const_handle ADart) const - { return this->template get_beta(ADart); } - template - Dart_const_handle beta(Dart_const_handle ADart) const - { return beta(beta(ADart)); } - template - Dart_const_handle beta(Dart_const_handle ADart) const - { return beta(beta(ADart)); } - template - Dart_const_handle beta(Dart_const_handle ADart) const - { return beta(beta(ADart)); } - template - Dart_const_handle beta(Dart_const_handle ADart) const - { return beta(beta(ADart)); } - template - Dart_const_handle beta(Dart_const_handle ADart) const - { return beta(beta(ADart)); } - template - Dart_const_handle beta(Dart_const_handle ADart) const - { return beta(beta(ADart)); } - template - Dart_const_handle beta(Dart_const_handle ADart) const - { return beta(beta(ADart)); } - template - Dart_const_handle beta(Dart_const_handle ADart) const - { return beta(beta(ADart)); } -#endif // Generic function to iterate on CMap or GMap in a generic way bool is_previous_exist(Dart_const_handle ADart) const @@ -1505,7 +1305,6 @@ namespace CGAL { /// Create a new attribute. /// @return a handle on the new attribute. -#ifndef CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES template typename Attribute_handle::type create_attribute(const Args&... args) { @@ -1521,152 +1320,6 @@ namespace CGAL { (this->template attributes(), res); return res; } -#else - template - typename Attribute_handle::type - create_attribute() - { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, - "create_attribute but i-attributes are disabled"); - typename Attribute_handle::type res= - CGAL::cpp11::get::value> - (mattribute_containers).emplace(); - internal::Init_id::type>::run - (this->template attributes(), res); - return res; - } - template - typename Attribute_handle::type - create_attribute(const T1 &t1) - { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, - "create_attribute but i-attributes are disabled"); - typename Attribute_handle::type res= - CGAL::cpp11::get::value> - (mattribute_containers).emplace(t1); - // Reinitialize the ref counting of the new attribute. This is normally - // not required except if create_attribute is used as "copy contructor". - this->template init_attribute_ref_counting(res); - internal::Init_id::type>::run - (this->template attributes(), res); - return res; - } - template - typename Attribute_handle::type - create_attribute(const T1 &t1, const T2 &t2) - { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, - "create_attribute but i-attributes are disabled"); - typename Attribute_handle::type res= - CGAL::cpp11::get::value> - (mattribute_containers).emplace(t1, t2); - internal::Init_id::type>::run - (this->template attributes(), res); - return res; - } - template - typename Attribute_handle::type - create_attribute(const T1 &t1, const T2 &t2, const T3 &t3) - { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, - "create_attribute but i-attributes are disabled"); - typename Attribute_handle::type res= - CGAL::cpp11::get::value> - (mattribute_containers).emplace(t1, t2, t3); - internal::Init_id::type>::run - (this->template attributes(), res); - return res; - } - template - typename Attribute_handle::type - create_attribute(const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4) - { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, - "create_attribute but i-attributes are disabled"); - typename Attribute_handle::type res= - CGAL::cpp11::get::value> - (mattribute_containers).emplace(t1, t2, t3, t4); - internal::Init_id::type>::run - (this->template attributes(), res); - return res; - } - template - typename Attribute_handle::type - create_attribute(const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4, - const T5 &t5) - { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, - "create_attribute but i-attributes are disabled"); - typename Attribute_handle::type res= - CGAL::cpp11::get::value> - (mattribute_containers).emplace(t1, t2, t3, t4, t5); - internal::Init_id::type>::run - (this->template attributes(), res); - return res; - } - template - typename Attribute_handle::type - create_attribute(const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4, - const T5 &t5, const T6 &t6) - { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, - "create_attribute but i-attributes are disabled"); - typename Attribute_handle::type res= - CGAL::cpp11::get::value> - (mattribute_containers).emplace(t1, t2, t3, t4, t5, t6); - internal::Init_id::type>::run - (this->template attributes(), res); - return res; - } - template - typename Attribute_handle::type - create_attribute(const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4, - const T5 &t5, const T6 &t6, const T7 &t7) - { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, - "create_attribute but i-attributes are disabled"); - typename Attribute_handle::type res= - CGAL::cpp11::get::value> - (mattribute_containers).emplace(t1, t2, t3, t4, t5, t6, t7); - internal::Init_id::type>::run - (this->template attributes(), res); - return res; - } - template - typename Attribute_handle::type - create_attribute(const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4, - const T5 &t5, const T6 &t6, const T7 &t7, const T8 &t8) - { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, - "create_attribute but i-attributes are disabled"); - typename Attribute_handle::type res= - CGAL::cpp11::get::value> - (mattribute_containers).emplace(t1, t2, t3, t4, t5, t6, t7, t8); - internal::Init_id::type>::run - (this->template attributes(), res); - return res; - } - template - typename Attribute_handle::type - create_attribute(const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4, - const T5 &t5, const T6 &t6, const T7 &t7, const T8 &t8, - const T9 &t9) - { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, - "create_attribute but i-attributes are disabled"); - typename Attribute_handle::type res= - CGAL::cpp11::get::value> - (mattribute_containers).emplace(t1, t2, t3, t4, t5, t6, t7, t8, t9); - internal::Init_id::type>::run - (this->template attributes(), res); - return res; - } -#endif /// Erase an attribute. /// @param h a handle to the attribute to erase. @@ -2815,7 +2468,6 @@ namespace CGAL { return res; } -#ifndef CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES //************************************************************************** // Dart_of_orbit_basic_range template @@ -2894,307 +2546,6 @@ namespace CGAL { darts_of_orbit_basic(Dart_const_handle adart, size_type amark=INVALID_MARK) const { return Dart_of_orbit_basic_const_range(*this,adart,amark); } //************************************************************************** -#else - //************************************************************************** - // Dart_of_orbit_basic_range - template - struct Dart_of_orbit_basic_range: public CGAL::CMap_range - , - CGAL::CMap_dart_const_iterator_basic_of_orbit > - { - typedef CGAL::CMap_range - , - CGAL::CMap_dart_const_iterator_basic_of_orbit > Base; - - Dart_of_orbit_basic_range(Self &amap, Dart_handle adart, - size_type /*amark*/=INVALID_MARK): - Base(amap, adart) - {} - }; - //************************************************************************** - // Dart_of_orbit_basic_const_range - template - struct Dart_of_orbit_basic_const_range: public CMap_const_range - > - { - typedef CMap_const_range - > Base; - - Dart_of_orbit_basic_const_range(const Self &amap, - Dart_const_handle adart, size_type amark=INVALID_MARK): - Base(amap, adart, amark) - {} - }; - //************************************************************************** - // Dart_of_orbit_range - template - struct Dart_of_orbit_range: public CGAL::CMap_range - , - CGAL::CMap_dart_const_iterator_of_orbit > - { - typedef CGAL::CMap_range - , - CGAL::CMap_dart_const_iterator_of_orbit > - Base; - - Dart_of_orbit_range(Self &amap, Dart_handle adart): - Base(amap, adart) - {} - }; - //************************************************************************** - // Dart_of_orbit_const_range - template - struct Dart_of_orbit_const_range: public CMap_const_range - > - { - typedef CMap_const_range - > Base; - - Dart_of_orbit_const_range(const Self &amap, Dart_const_handle adart): - Base(amap, adart) - {} - }; - //************************************************************************** - /// @return a range on all the darts of the given orbit - Dart_of_orbit_range<> darts_of_orbit(Dart_handle adart) - { return Dart_of_orbit_range<>(*this,adart); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_range darts_of_orbit(Dart_handle adart) - { return Dart_of_orbit_range(*this,adart); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_range darts_of_orbit(Dart_handle adart) - { return Dart_of_orbit_range(*this,adart); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_range darts_of_orbit(Dart_handle adart) - { return Dart_of_orbit_range(*this,adart); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_range darts_of_orbit(Dart_handle adart) - { return Dart_of_orbit_range(*this,adart); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_range darts_of_orbit(Dart_handle adart) - { return Dart_of_orbit_range(*this,adart); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_range darts_of_orbit(Dart_handle adart) - { return Dart_of_orbit_range(*this,adart); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_range darts_of_orbit(Dart_handle adart) - { return Dart_of_orbit_range(*this,adart); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_range darts_of_orbit - (Dart_handle adart) - { return Dart_of_orbit_range(*this,adart); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_range - darts_of_orbit(Dart_handle adart) - { return Dart_of_orbit_range(*this,adart); } - //-------------------------------------------------------------------------- - // Const versions. - Dart_of_orbit_const_range<> darts_of_orbit(Dart_const_handle adart) const - { return Dart_of_orbit_const_range<>(*this,adart); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_const_range darts_of_orbit(Dart_const_handle - adart) const - { return Dart_of_orbit_const_range(*this,adart); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_const_range darts_of_orbit(Dart_const_handle - adart) const - { return Dart_of_orbit_const_range(*this,adart); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_const_range darts_of_orbit - (Dart_const_handle adart) const - { return Dart_of_orbit_const_range(*this,adart); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_const_range - darts_of_orbit(Dart_const_handle adart) const - { return Dart_of_orbit_const_range(*this,adart); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_const_range - darts_of_orbit(Dart_const_handle adart) const - { return Dart_of_orbit_const_range(*this,adart); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_const_range - darts_of_orbit(Dart_const_handle adart) const - { return Dart_of_orbit_const_range(*this,adart); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_const_range - darts_of_orbit(Dart_const_handle adart) const - { return Dart_of_orbit_const_range(*this,adart); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_const_range - darts_of_orbit(Dart_const_handle adart) const - { return Dart_of_orbit_const_range(*this,adart); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_const_range - darts_of_orbit(Dart_const_handle adart) const - { return Dart_of_orbit_const_range - (*this,adart); } - //-------------------------------------------------------------------------- - // Basic versions - Dart_of_orbit_basic_range<> darts_of_orbit_basic(Dart_handle adart, - size_type amark=INVALID_MARK) - { return Dart_of_orbit_basic_range<>(*this,adart,amark); } - //-------------------------------------------------------------------------- - Dart_of_orbit_basic_const_range<> darts_of_orbit_basic - (Dart_const_handle adart,size_type amark=INVALID_MARK) const - { return Dart_of_orbit_basic_const_range<>(*this,adart,amark); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_basic_range darts_of_orbit_basic(Dart_handle adart, - size_type amark=INVALID_MARK) - { return Dart_of_orbit_basic_range(*this,adart,amark); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_basic_const_range darts_of_orbit_basic - (Dart_const_handle adart, size_type amark=INVALID_MARK) const - { return Dart_of_orbit_basic_const_range(*this,adart,amark); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_basic_range darts_of_orbit_basic(Dart_handle adart, - size_type amark=INVALID_MARK) - { return Dart_of_orbit_basic_range(*this,adart,amark); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_basic_const_range darts_of_orbit_basic - (Dart_const_handle adart, size_type amark=INVALID_MARK) const - { return Dart_of_orbit_basic_const_range(*this,adart,amark); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_basic_range darts_of_orbit_basic(Dart_handle adart, - size_type amark=INVALID_MARK) - { return Dart_of_orbit_basic_range(*this,adart,amark); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_basic_const_range darts_of_orbit_basic - (Dart_const_handle adart, size_type amark=INVALID_MARK) const - { return Dart_of_orbit_basic_const_range(*this,adart,amark); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_basic_range darts_of_orbit_basic - (Dart_handle adart, size_type amark=INVALID_MARK) - { return Dart_of_orbit_basic_range(*this,adart,amark); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_basic_const_range - darts_of_orbit_basic(Dart_const_handle adart, size_type amark=INVALID_MARK) const - { return Dart_of_orbit_basic_const_range(*this,adart,amark); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_basic_range darts_of_orbit_basic - (Dart_handle adart, size_type amark=INVALID_MARK) - { return Dart_of_orbit_basic_range(*this,adart,amark); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_basic_const_range - darts_of_orbit_basic(Dart_const_handle adart, size_type amark=INVALID_MARK) const - { return Dart_of_orbit_basic_const_range - (*this,adart,amark); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_basic_range darts_of_orbit_basic - (Dart_handle adart, size_type amark=INVALID_MARK) - { return Dart_of_orbit_basic_range(*this,adart,amark); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_basic_const_range - darts_of_orbit_basic(Dart_const_handle adart, size_type amark=INVALID_MARK) const - { return Dart_of_orbit_basic_const_range - (*this,adart,amark); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_basic_range darts_of_orbit_basic - (Dart_handle adart, size_type amark=INVALID_MARK) - { return Dart_of_orbit_basic_range - (*this,adart,amark); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_basic_const_range - darts_of_orbit_basic(Dart_const_handle adart, size_type amark=INVALID_MARK) const - { return Dart_of_orbit_basic_const_range - (*this,adart,amark); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_basic_range darts_of_orbit - (Dart_handle adart, size_type amark=INVALID_MARK) - { return Dart_of_orbit_basic_range - (*this,adart,amark); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_basic_const_range - darts_of_orbit_basic(Dart_const_handle adart, size_type amark=INVALID_MARK) const - { return Dart_of_orbit_basic_const_range - (*this,adart,amark); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_basic_range - darts_of_orbit_basic(Dart_handle adart, size_type amark=INVALID_MARK) - { return Dart_of_orbit_basic_range - (*this,adart,amark); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_basic_const_range - darts_of_orbit_basic(Dart_const_handle adart, size_type amark=INVALID_MARK) const - { return Dart_of_orbit_basic_const_range - (*this,adart,amark); } - //************************************************************************** -#endif //CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES - //************************************************************************** // Dart_of_cell_basic_range template struct Dart_of_cell_basic_range: public CGAL::CMap_range diff --git a/Combinatorial_map/include/CGAL/Dart_const_iterators.h b/Combinatorial_map/include/CGAL/Dart_const_iterators.h index 389081b2f5a..40ec329ac14 100644 --- a/Combinatorial_map/include/CGAL/Dart_const_iterators.h +++ b/Combinatorial_map/include/CGAL/Dart_const_iterators.h @@ -38,7 +38,7 @@ namespace CGAL { * - CMap_dart_const_iterator_basic_of_involution_inv */ //**************************************************************************** -#ifndef CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES + template class CMap_dart_const_iterator_basic_of_orbit: public CMap_dart_iterator_basic_of_orbit_generic @@ -92,71 +92,6 @@ namespace CGAL { it.get_first_dart()) {} }; -#else - //**************************************************************************** - template - class CMap_dart_const_iterator_basic_of_orbit: - public CMap_dart_iterator_basic_of_orbit_generic - { - public: - typedef CMap_dart_const_iterator_basic_of_orbit Self; - typedef CMap_dart_iterator_basic_of_orbit_generic Base; - - typedef typename Map_::Dart_const_handle Dart_const_handle; - typedef typename Map_::size_type size_type; - - /// Main constructor. - CMap_dart_const_iterator_basic_of_orbit(const Map_& amap, - Dart_const_handle adart): - Base(amap,adart) - {} - /// Main constructor. - CMap_dart_const_iterator_basic_of_orbit(const Map_& amap, - Dart_const_handle adart, - size_type amark): - Base(amap,adart,amark) - {} - /// Constructor from non const version. - CMap_dart_const_iterator_basic_of_orbit - (const CMap_dart_iterator_basic_of_orbit& it): - Base(*const_cast(it.get_combinatorial_map()), - it.get_first_dart(), - it.mmark_number) - {} - }; - //**************************************************************************** - template - class CMap_dart_const_iterator_of_orbit: - public CMap_dart_iterator_of_orbit_generic - { - public: - typedef CMap_dart_const_iterator_of_orbit Self; - typedef CMap_dart_iterator_of_orbit_generic Base; - - typedef typename Map_::Dart_const_handle Dart_const_handle; - - /// Main constructor. - CMap_dart_const_iterator_of_orbit(const Map_& amap, - Dart_const_handle adart): - Base(amap,adart) - {} - /// Constructor from non const version. - CMap_dart_const_iterator_of_orbit - (const CMap_dart_iterator_of_orbit& it): - Base(*const_cast(it.get_combinatorial_map()), - it.get_first_dart()) - {} - }; -#endif // CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES //**************************************************************************** template class CMap_dart_const_iterator_basic_of_all: diff --git a/Combinatorial_map/include/CGAL/Dart_iterators.h b/Combinatorial_map/include/CGAL/Dart_iterators.h index c8172f0038f..d9b6b3607bd 100644 --- a/Combinatorial_map/include/CGAL/Dart_iterators.h +++ b/Combinatorial_map/include/CGAL/Dart_iterators.h @@ -45,97 +45,8 @@ namespace CGAL { /* Class CMap_dart_iterator_basic_of_orbit: to iterate * on the darts of the orbit */ -#ifndef CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES template class CMap_dart_iterator_basic_of_orbit_generic; -#else - template - class CMap_dart_iterator_basic_of_orbit_generic; - - template - struct Get_CMap_dart_iterator_basic_of_orbit; - - template - struct Get_CMap_dart_iterator_basic_of_orbit - { - typedef CMap_dart_iterator_basic_of_orbit_generic type; - }; - - template - struct Get_CMap_dart_iterator_basic_of_orbit - { - typedef CMap_dart_iterator_basic_of_orbit_generic type; - }; - - template - struct Get_CMap_dart_iterator_basic_of_orbit - { - typedef CMap_dart_iterator_basic_of_orbit_generic type; - }; - - template - struct Get_CMap_dart_iterator_basic_of_orbit - { - typedef CMap_dart_iterator_basic_of_orbit_generic type; - }; - - template - struct Get_CMap_dart_iterator_basic_of_orbit - { - typedef CMap_dart_iterator_basic_of_orbit_generic type; - }; - - template - struct Get_CMap_dart_iterator_basic_of_orbit - { - typedef CMap_dart_iterator_basic_of_orbit_generic type; - }; - - template - struct Get_CMap_dart_iterator_basic_of_orbit - { - typedef CMap_dart_iterator_basic_of_orbit_generic type; - }; - - template - struct Get_CMap_dart_iterator_basic_of_orbit - { - typedef CMap_dart_iterator_basic_of_orbit_generic type; - }; - - template - struct Get_CMap_dart_iterator_basic_of_orbit - { - typedef CMap_dart_iterator_basic_of_orbit_generic type; - }; - - template - struct Get_CMap_dart_iterator_basic_of_orbit - { - typedef CMap_dart_iterator_basic_of_orbit_generic type; - }; -#endif //CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES //**************************************************************************** // Case when Beta... is empty: iterator of self template @@ -994,7 +905,6 @@ namespace CGAL { //**************************************************************************** /* Generic nD version. */ -#ifndef CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES template class CMap_dart_iterator_basic_of_orbit_generic: public CMap_extend_iterator - class CMap_dart_iterator_basic_of_orbit_generic: - public CMap_extend_iterator - ::type, B3> - { - public: - typedef typename Get_CMap_dart_iterator_basic_of_orbit - ::type Self; - - typedef CMap_extend_iterator - ::type, B3> Base; - - typedef typename Base::Dart_handle Dart_handle; - typedef typename Base::Map Map; - typedef typename Map::size_type size_type; - - /// True iff this iterator is basic - typedef Tag_true Basic_iterator; - - public: - /// Main constructor. - CMap_dart_iterator_basic_of_orbit_generic(Map& amap, Dart_handle adart, - size_type amark): - Base(amap, adart, amark) - {} - }; -#endif //CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES //**************************************************************************** // TODO? we can optimize the iterators when // 1 class CMap_dart_iterator_basic_of_orbit: public CMap_dart_iterator_basic_of_orbit_generic @@ -1080,33 +958,6 @@ namespace CGAL { Base(amap,adart,amark) {} }; -#else - //**************************************************************************** - template - class CMap_dart_iterator_basic_of_orbit: - public Get_CMap_dart_iterator_basic_of_orbit::type - { - public: - typedef CMap_dart_iterator_basic_of_orbit - Self; - typedef typename Get_CMap_dart_iterator_basic_of_orbit - ::type Base; - - typedef typename Map::Dart_handle Dart_handle; - typedef typename Map::size_type size_type; - - /// Main constructor. - CMap_dart_iterator_basic_of_orbit(Map& amap,Dart_handle adart): - Base(amap,adart) - {} - /// Main constructor. - CMap_dart_iterator_basic_of_orbit(Map& amap,Dart_handle adart,size_type amark): - Base(amap,adart,amark) - {} - }; -#endif // CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES //**************************************************************************** /* Class CMap_dart_iterator_basic_of_all: to iterate onto all the * darts of the map. @@ -1789,7 +1640,6 @@ namespace CGAL { //*************************ITERATORS*NON*BASIC******************************** //**************************************************************************** //**************************************************************************** -#ifndef CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES template class CMap_dart_iterator_of_orbit_generic: public CMap_non_basic_iterator - class CMap_dart_iterator_of_orbit_generic: - public CMap_non_basic_iterator::type> - { - public: - typedef CMap_dart_iterator_of_orbit_generic Self; - typedef CMap_non_basic_iterator::type> Base; - - typedef typename Base::Map Map; - typedef typename Base::Dart_handle Dart_handle; - - /// Main constructor. - CMap_dart_iterator_of_orbit_generic(Map& amap, Dart_handle adart1): - Base(amap, adart1) - {} - }; - //**************************************************************************** - template - class CMap_dart_iterator_of_orbit: - public CMap_dart_iterator_of_orbit_generic - { - public: - typedef CMap_dart_iterator_of_orbit Self; - typedef CMap_dart_iterator_of_orbit_generic Base; - - typedef typename Base::Dart_handle Dart_handle; - - /// Main constructor. - CMap_dart_iterator_of_orbit(Map& amap, Dart_handle adart): - Base(amap, adart) - {} - }; -#endif // CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES //**************************************************************************** template class CMap_dart_iterator_of_cell: diff --git a/Combinatorial_map/include/CGAL/internal/Combinatorial_map_internal_functors.h b/Combinatorial_map/include/CGAL/internal/Combinatorial_map_internal_functors.h index 26286c5f5c7..8e1e4098fa5 100644 --- a/Combinatorial_map/include/CGAL/internal/Combinatorial_map_internal_functors.h +++ b/Combinatorial_map/include/CGAL/internal/Combinatorial_map_internal_functors.h @@ -984,7 +984,6 @@ struct Reverse_orientation_of_connected_component_functor }; // **************************************************************************** // Beta functor, used to combine several beta. -#ifndef CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES template struct Beta_functor; @@ -1036,7 +1035,6 @@ struct Beta_functor_static { return Beta_functor_static:: run(AMap, AMap.template get_beta(ADart)); } }; -#endif //CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES // **************************************************************************** template diff --git a/Combinatorial_map/include/CGAL/internal/Combinatorial_map_utility.h b/Combinatorial_map/include/CGAL/internal/Combinatorial_map_utility.h index 3ffbdec6657..9d3c9b2d792 100644 --- a/Combinatorial_map/include/CGAL/internal/Combinatorial_map_utility.h +++ b/Combinatorial_map/include/CGAL/internal/Combinatorial_map_utility.h @@ -81,8 +81,6 @@ namespace CGAL struct Get_attributes_tuple { typedef typename T::Attributes type; }; -#if ! defined(CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES) && \ - ! defined(CGAL_CFG_NO_CPP0X_TUPLE) // Convert a tuple in a same tuple where each void type was replaced into // CGAL::Void. template @@ -377,10 +375,6 @@ namespace CGAL template static void run(T& ... ){} }; -#else - // Definitions of structs are moved to another file. -#include -#endif //CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES //Apply a functor to each element of a tuple template { typedef CGAL::Void type; }; -#ifndef CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES // To iterate onto each enabled attributes template struct Foreach_enabled_attributes @@ -619,118 +612,6 @@ namespace CGAL static void run(Ts& ... t) { Foreach_static_restricted_except::run(t...); } }; -#else - // This one cannot be moved in Combinatorial_map_utility_novariadic.h - // because this is an inner struct which uses inner type Attributes. - template - struct Foreach_enabled_attributes - { - static void run() - {Foreach_static_restricted::run();} - - template - static void run(T1& t1) - {Foreach_static_restricted::run(t1);} - - template - static void run(T1& t1,T2& t2) - {Foreach_static_restricted::run(t1,t2);} - - template - static void run(T1& t1,T2& t2,T3& t3) - {Foreach_static_restricted::run(t1,t2,t3);} - - template - static void run(T1& t1,T2& t2,T3& t3,T4& t4) - {Foreach_static_restricted::run(t1,t2,t3,t4);} - - template - static void run(T1& t1,T2& t2,T3& t3,T4& t4, - T5& t5) - {Foreach_static_restricted::run(t1,t2,t3,t4,t5);} - - template - static void run(T1& t1,T2& t2,T3& t3,T4& t4, - T5& t5,T6& t6) - {Foreach_static_restricted::run(t1,t2,t3,t4,t5,t6);} - - template - static void run(T1& t1,T2& t2,T3& t3,T4& t4, - T5& t5,T6& t6,T7& t7) - {Foreach_static_restricted::run(t1,t2,t3,t4,t5, - t6,t7);} - - template - static void run(T1& t1,T2& t2,T3& t3,T4& t4, - T5& t5,T6& t6,T7& t7,T8& t8) - {Foreach_static_restricted::run(t1,t2,t3,t4,t5,t6, - t7,t8);} - - template - static void run(T1& t1,T2& t2,T3& t3,T4& t4, - T5& t5,T6& t6,T7& t7,T8& t8, - T9& t9) - {Foreach_static_restricted::run(t1,t2,t3,t4, - t5,t6,t7,t8,t9);} - }; - // This one cannot be moved in Combinatorial_map_utility_novariadic.h - // because this is an inner struct which uses inner type Attributes. - template - struct Foreach_enabled_attributes_except - { - static void run() - {Foreach_static_restricted_except::run();} - - template - static void run(T1& t1) - {Foreach_static_restricted_except::run(t1);} - - template - static void run(T1& t1,T2& t2) - {Foreach_static_restricted_except::run(t1,t2);} - - template - static void run(T1& t1,T2& t2,T3& t3) - {Foreach_static_restricted_except::run(t1,t2,t3);} - - template - static void run(T1& t1,T2& t2,T3& t3,T4& t4) - {Foreach_static_restricted_except::run(t1,t2,t3,t4);} - - template - static void run(T1& t1,T2& t2,T3& t3,T4& t4, - T5& t5) - {Foreach_static_restricted_except::run(t1,t2,t3,t4,t5);} - - template - static void run(T1& t1,T2& t2,T3& t3,T4& t4, - T5& t5,T6& t6) - {Foreach_static_restricted_except::run(t1,t2,t3,t4,t5,t6);} - - template - static void run(T1& t1,T2& t2,T3& t3,T4& t4, - T5& t5,T6& t6,T7& t7) - {Foreach_static_restricted_except::run(t1,t2,t3,t4,t5, - t6,t7);} - - template - static void run(T1& t1,T2& t2,T3& t3,T4& t4, - T5& t5,T6& t6,T7& t7,T8& t8) - {Foreach_static_restricted_except::run(t1,t2,t3,t4,t5,t6, - t7,t8);} - - template - static void run(T1& t1,T2& t2,T3& t3,T4& t4, - T5& t5,T6& t6,T7& t7,T8& t8, - T9& t9) - {Foreach_static_restricted_except::run(t1,t2,t3,t4, - t5,t6,t7,t8,t9);} - }; -#endif //CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES }; } //namespace internal diff --git a/Combinatorial_map/include/CGAL/internal/Combinatorial_map_utility_novariadic.h b/Combinatorial_map/include/CGAL/internal/Combinatorial_map_utility_novariadic.h deleted file mode 100644 index d5110578a1f..00000000000 --- a/Combinatorial_map/include/CGAL/internal/Combinatorial_map_utility_novariadic.h +++ /dev/null @@ -1,2574 +0,0 @@ -// Copyright (c) 2010-2011 CNRS and LIRIS' Establishments (France). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org); you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation; either version 3 of the License, -// or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// SPDX-License-Identifier: LGPL-3.0+ -// -// Author(s) : Guillaume Damiand -// -#ifndef CGAL_INTERNAL_COMBINATORIAL_MAP_UTILITY_NOVARIADIC_H -#define CGAL_INTERNAL_COMBINATORIAL_MAP_UTILITY_NOVARIADIC_H 1 - -#if defined(CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES) || defined(CGAL_CFG_NO_CPP0X_TUPLE) -#include -#include - -// This file is included in Combinatorial_map_utility.h, in the namespace -// CGAL::internal -//------------------------------------------------------------------------------ -template -struct Convert_tuple_with_void; - -template <> -struct Convert_tuple_with_void > -{ - typedef CGAL::cpp11::tuple<> type; -}; -template -struct Convert_tuple_with_void > -{ - typedef CGAL::cpp11::tuple::type > type; -}; -template -struct Convert_tuple_with_void > -{ - typedef CGAL::cpp11::tuple::type, - typename Convert_void::type > type; -}; -template -struct Convert_tuple_with_void > -{ - typedef CGAL::cpp11::tuple::type, - typename Convert_void::type, - typename Convert_void::type > type; -}; -template -struct Convert_tuple_with_void > -{ - typedef CGAL::cpp11::tuple::type, - typename Convert_void::type, - typename Convert_void::type, - typename Convert_void::type > type; -}; -template -struct Convert_tuple_with_void > -{ - typedef CGAL::cpp11::tuple::type, - typename Convert_void::type, - typename Convert_void::type, - typename Convert_void::type, - typename Convert_void::type > type; -}; -template -struct Convert_tuple_with_void > -{ - typedef CGAL::cpp11::tuple::type, - typename Convert_void::type, - typename Convert_void::type, - typename Convert_void::type, - typename Convert_void::type, - typename Convert_void::type > type; -}; -template -struct Convert_tuple_with_void > -{ - typedef CGAL::cpp11::tuple::type, - typename Convert_void::type, - typename Convert_void::type, - typename Convert_void::type, - typename Convert_void::type, - typename Convert_void::type, - typename Convert_void::type > type; -}; -template -struct Convert_tuple_with_void > -{ - typedef CGAL::cpp11::tuple::type, - typename Convert_void::type, - typename Convert_void::type, - typename Convert_void::type, - typename Convert_void::type, - typename Convert_void::type, - typename Convert_void::type, - typename Convert_void::type > type; -}; -template -struct Convert_tuple_with_void > -{ - typedef CGAL::cpp11::tuple::type, - typename Convert_void::type, - typename Convert_void::type, - typename Convert_void::type, - typename Convert_void::type, - typename Convert_void::type, - typename Convert_void::type, - typename Convert_void::type, - typename Convert_void::type > type; -}; -//------------------------------------------------------------------------------ -template -struct My_length; - -template <> -struct My_length > -{ - static const int value = 0; -}; -template -struct My_length > -{ - static const int value = 1; -}; -template -struct My_length > -{ - static const int value = 2; -}; -template -struct My_length > -{ - static const int value = 3; -}; -template -struct My_length > -{ - static const int value = 4; -}; -template -struct My_length > -{ - static const int value = 5; -}; -template -struct My_length > -{ - static const int value = 6; -}; -template -struct My_length > -{ - static const int value = 7; -}; -template -struct My_length > -{ - static const int value = 8; -}; -template -struct My_length > -{ - static const int value = 9; -}; -//------------------------------------------------------------------------------ -template -struct Number_of_different_type_in_tuple; - -template -struct Number_of_different_type_in_tuple > -{ - static const int value=0; -}; - -template -struct Number_of_different_type_in_tuple > -{ - static const int value=boost::is_same::value?0:1; -}; - -template -struct Number_of_different_type_in_tuple > -{ - static const int value= (boost::is_same::value?0:1) + - Number_of_different_type_in_tuple >::value; -}; - -template -struct Number_of_different_type_in_tuple > -{ - static const int value= (boost::is_same::value?0:1) + - Number_of_different_type_in_tuple >::value; -}; - -template -struct Number_of_different_type_in_tuple > -{ - static const int value= (boost::is_same::value?0:1) + - Number_of_different_type_in_tuple - >::value; -}; - -template -struct Number_of_different_type_in_tuple > -{ - static const int value= (boost::is_same::value?0:1) + - Number_of_different_type_in_tuple - >::value; -}; - -template -struct Number_of_different_type_in_tuple > -{ - static const int value= (boost::is_same::value?0:1) + - Number_of_different_type_in_tuple - >::value; -}; - -template -struct Number_of_different_type_in_tuple > -{ - static const int value= (boost::is_same::value?0:1) + - Number_of_different_type_in_tuple >::value; -}; - -template -struct Number_of_different_type_in_tuple > -{ - static const int value= (boost::is_same::value?0:1) + - Number_of_different_type_in_tuple - >::value; -}; - -template -struct Number_of_different_type_in_tuple > -{ - static const int value= (boost::is_same::value?0:1) + - Number_of_different_type_in_tuple - >::value; -}; -//------------------------------------------------------------------------------ -template ::value-1> -struct Nb_type_different_in_tuple_up_to_k; - -template -struct Nb_type_different_in_tuple_up_to_k,dim > -{ - static const int pos=dim; - static const int value= pos==k? - boost::is_same::value?-dim-1:0 : 0; -}; - -template -struct Nb_type_different_in_tuple_up_to_k,dim > -{ - static const int pos= Nb_type_different_in_tuple_up_to_k - ,dim >::pos - 1; - - static const int value = - ( pos==k ) ? ( boost::is_same::value ? -dim-1 : 0 ) - : ( ( pos::value ? 0:1 ) - + Nb_type_different_in_tuple_up_to_k - ,dim >::value) - :0 - ); -}; - -template -struct Nb_type_different_in_tuple_up_to_k,dim > -{ - static const int pos = Nb_type_different_in_tuple_up_to_k - ,dim >::pos - 1; - - static const int value = - ( pos==k ) ? ( boost::is_same::value ? -dim-1 : 0 ) - : ( ( pos::value ? 0:1 ) - + Nb_type_different_in_tuple_up_to_k,dim >::value) - :0 - ); -}; - - -template -struct Nb_type_different_in_tuple_up_to_k,dim > -{ - static const int pos= Nb_type_different_in_tuple_up_to_k - ,dim >::pos - 1; - - static const int value = - ( pos==k ) ? ( boost::is_same::value ? -dim-1 : 0 ) - : ( ( pos::value ? 0:1 ) - + Nb_type_different_in_tuple_up_to_k - ,dim >::value) - :0 - ); -}; - -template -struct Nb_type_different_in_tuple_up_to_k -,dim > -{ - static const int pos=Nb_type_different_in_tuple_up_to_k - ,dim >::pos - 1; - - static const int value = - ( pos==k ) ? ( boost::is_same::value ? -dim-1 : 0 ) - : ( ( pos::value ? 0:1 ) - + Nb_type_different_in_tuple_up_to_k - ,dim >::value) - :0 - ); -}; - -template -struct Nb_type_different_in_tuple_up_to_k -,dim > -{ - static const int pos=Nb_type_different_in_tuple_up_to_k - ,dim >::pos - 1; - - static const int value = - ( pos==k ) ? ( boost::is_same::value ? -dim-1 : 0 ) - : ( ( pos::value ? 0:1 ) - + Nb_type_different_in_tuple_up_to_k - ,dim >::value) - :0 - ); -}; - -template -struct Nb_type_different_in_tuple_up_to_k -,dim >{ - static const int pos=Nb_type_different_in_tuple_up_to_k - ,dim >::pos - 1; - - static const int value = - ( pos==k ) ? ( boost::is_same::value ? -dim-1 : 0 ) - : ( ( pos::value ? 0:1 ) - + Nb_type_different_in_tuple_up_to_k - , - dim >::value) - :0 - ); -}; - -template -struct Nb_type_different_in_tuple_up_to_k -,dim > -{ - static const int pos=Nb_type_different_in_tuple_up_to_k - ,dim >::pos - 1; - - static const int value = - ( pos==k ) ? ( boost::is_same::value ? -dim-1 : 0 ) - : ( ( pos::value ? 0:1 ) - + Nb_type_different_in_tuple_up_to_k - , - dim >::value) - :0 - ); -}; - -template -struct Nb_type_different_in_tuple_up_to_k -,dim > -{ - static const int pos=Nb_type_different_in_tuple_up_to_k - ,dim >::pos - 1; - - static const int value = - ( pos==k ) ? ( boost::is_same::value ? -dim-1 : 0 ) - : ( ( pos::value ? 0:1 ) - + Nb_type_different_in_tuple_up_to_k - , - dim >::value) - :0 - ); -}; -//------------------------------------------------------------------------------ -//Convert a tuple of T... to a tuple of Functor::type... -template