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] 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;}