From 223277873153af56f9028ac82220cb5a2b7dbd90 Mon Sep 17 00:00:00 2001 From: bolero-MURAKAMI Date: Thu, 31 Oct 2013 12:37:38 +0900 Subject: [PATCH] remove slipped file --- .../algorithm/set_intersection_iterator.hpp | 209 ------------------ sprout/functional/ref.hpp | 7 +- sprout/iterator/clamp_iterator.hpp | 21 +- sprout/iterator/size_enum_iterator.hpp | 2 +- sprout/range/range_container.hpp | 9 +- sprout/tuple/tuple/ignore.hpp | 2 +- 6 files changed, 22 insertions(+), 228 deletions(-) delete mode 100644 sprout/algorithm/set_intersection_iterator.hpp diff --git a/sprout/algorithm/set_intersection_iterator.hpp b/sprout/algorithm/set_intersection_iterator.hpp deleted file mode 100644 index 6430b05f..00000000 --- a/sprout/algorithm/set_intersection_iterator.hpp +++ /dev/null @@ -1,209 +0,0 @@ -/*============================================================================= - Copyright (c) 2011-2013 Bolero MURAKAMI - https://github.com/bolero-MURAKAMI/Sprout - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -=============================================================================*/ -#ifndef SPROUT_ITERATOR_SET_INTERSECTION_ITERATOR_HPP -#define SPROUT_ITERATOR_SET_INTERSECTION_ITERATOR_HPP - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace sprout { - // - // set_intersection_iterator - // - template< - typename LIterator, typename RIterator, - typename Compare = sprout::less<> - > - class set_intersection_iterator - : public std::iterator< - typename sprout::min_iterator_category< - typename sprout::common_iterator_category::type, - std::forward_iterator_tag - >::type, - typename sprout::common_iterator_value_type::type, - typename sprout::common_iterator_difference_type::type, - typename sprout::common_iterator_pointer::type, - typename sprout::common_iterator_reference::type - > - { - public: - typedef LIterator iterator_type; - typedef RIterator iterator2_type; - typedef Compare compare_type; - typedef typename sprout::min_iterator_category< - typename sprout::common_iterator_category::type, - std::forward_iterator_tag - >::type iterator_category; - typedef typename sprout::common_iterator_value_type::type value_type; - typedef typename sprout::common_iterator_difference_type::type difference_type; - typedef typename sprout::common_iterator_pointer::type pointer; - typedef typename sprout::common_iterator_reference::type reference; - protected: - typedef sprout::pair pair_type; - protected: - pair_type current; - iterator_type lst1; - iterator2_type lst2; - Compare comp; - private: - SPROUT_CONSTEXPR set_intersection_iterator(set_intersection_iterator const& other, pair_type const& next) - : current(next) - , lst1(other.lst1), lst2(other.lst2) - , comp(other.comp) - {} - public: - set_intersection_iterator() - : current(), lst1(), lst2(), comp() - {} - set_intersection_iterator(set_intersection_iterator const&) = default; - SPROUT_CONSTEXPR set_intersection_iterator( - iterator_type it1, iterator_type lst1, - iterator2_type it2, iterator2_type lst2, - Compare comp = Compare() - ) - : current(sprout::find_intersection(it1, lst1, it2, lst2, comp)) - , lst1(lst1), lst2(lst2) - , comp(comp) - {} - template - SPROUT_CONSTEXPR set_intersection_iterator(set_intersection_iterator const& it) - : current(it.base(), it.base2()) - , lst1(it.last1()), lst2(it.last2()) - , comp(it.compare()) - {} - template - set_intersection_iterator& operator=(set_intersection_iterator const& it) { - set_intersection_iterator temp(it); - temp.swap(*this); - return *this; - } - SPROUT_CONSTEXPR iterator_type base() const { - return current.first; - } - SPROUT_CONSTEXPR iterator_type last1() const { - return lst1; - } - SPROUT_CONSTEXPR iterator2_type base2() const { - return current.second; - } - SPROUT_CONSTEXPR iterator2_type last2() const { - return lst2; - } - SPROUT_CONSTEXPR Compare compare() const { - return comp; - } - SPROUT_CONSTEXPR bool is_in_left() const { - return true; - } - SPROUT_CONSTEXPR reference operator*() const { - return *current.first; - } - SPROUT_CONSTEXPR pointer operator->() const { - return &*(*this); - } - set_intersection_iterator& operator++() { - current = sprout::next_intersection(current.first, lst1, current.second, lst2, comp); - return *this; - } - set_intersection_iterator operator++(int) { - set_intersection_iterator result(*this); - current = sprout::next_intersection(current.first, lst1, current.second, lst2, comp); - return result; - } - SPROUT_CONSTEXPR set_intersection_iterator next() const { - return set_intersection_iterator( - *this, - sprout::next_intersection(current.first, lst1, current.second, lst2, comp) - ); - } - void swap(set_intersection_iterator& other) - SPROUT_NOEXCEPT_EXPR( - SPROUT_NOEXCEPT_EXPR(sprout::swap(current, other.current)) - && SPROUT_NOEXCEPT_EXPR(sprout::swap(lst1, other.lst1)) - && SPROUT_NOEXCEPT_EXPR(sprout::swap(lst2, other.lst2)) - && SPROUT_NOEXCEPT_EXPR(sprout::swap(comp, other.comp)) - ) - { - sprout::swap(current, other.current); - sprout::swap(lst1, other.lst1); - sprout::swap(lst2, other.lst2); - sprout::swap(comp, other.comp); - } - }; - - template< - typename LIterator1, typename RIterator1, typename Compare1, - typename LIterator2, typename RIterator2, typename Compare2 - > - inline SPROUT_CONSTEXPR bool operator==( - sprout::set_intersection_iterator const& lhs, - sprout::set_intersection_iterator const& rhs - ) - { - return lhs.base() == rhs.base() && lhs.base2() == rhs.base2(); - } - template< - typename LIterator1, typename RIterator1, typename Compare1, - typename LIterator2, typename RIterator2, typename Compare2 - > - inline SPROUT_CONSTEXPR bool operator!=( - sprout::set_intersection_iterator const& lhs, - sprout::set_intersection_iterator const& rhs - ) - { - return !(lhs == rhs); - } - - // - // make_set_intersection_iterator - // - template - inline SPROUT_CONSTEXPR sprout::set_intersection_iterator - make_set_intersection_iterator(LIterator it1, LIterator lst1, RIterator it2, RIterator lst2, Compare comp) { - return sprout::set_intersection_iterator(it1, lst1, it2, lst2, comp); - } - template - inline SPROUT_CONSTEXPR sprout::set_intersection_iterator - make_set_intersection_iterator(LIterator it1, LIterator lst1, RIterator it2, RIterator lst2) { - return sprout::set_intersection_iterator(it1, lst1, it2, lst2); - } - - // - // swap - // - template - inline void - swap( - sprout::set_intersection_iterator& lhs, - sprout::set_intersection_iterator& rhs - ) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) - { - lhs.swap(rhs); - } - - // - // iterator_next - // - template - inline SPROUT_CONSTEXPR sprout::set_intersection_iterator - iterator_next(sprout::set_intersection_iterator const& it) { - return it.next(); - } -} // namespace sprout - -#endif // #ifndef SPROUT_ITERATOR_SET_INTERSECTION_ITERATOR_HPP diff --git a/sprout/functional/ref.hpp b/sprout/functional/ref.hpp index 8573b91f..5b73095c 100644 --- a/sprout/functional/ref.hpp +++ b/sprout/functional/ref.hpp @@ -152,9 +152,12 @@ namespace sprout { SPROUT_CONSTEXPR reference_wrapper(T& t) SPROUT_NOEXCEPT : t_(&t) {} - reference_wrapper(reference_wrapper const&) SPROUT_NOEXCEPT = default; + reference_wrapper(reference_wrapper const&) = default; // assignment - reference_wrapper& operator=(reference_wrapper const&) SPROUT_NOEXCEPT = default; + SPROUT_CXX14_CONSTEXPR reference_wrapper& operator=(reference_wrapper const& rhs) { + t_ = rhs.t_; + return *this; + } // access SPROUT_CONSTEXPR operator T& () const SPROUT_NOEXCEPT { return *t_; diff --git a/sprout/iterator/clamp_iterator.hpp b/sprout/iterator/clamp_iterator.hpp index 4e110aa1..886d9fbb 100644 --- a/sprout/iterator/clamp_iterator.hpp +++ b/sprout/iterator/clamp_iterator.hpp @@ -44,8 +44,7 @@ namespace sprout { Compare comp; value_type low; value_type up; - private: - public: + public: clamp_iterator() = default; clamp_iterator(clamp_iterator const&) = default; SPROUT_CONSTEXPR clamp_iterator(iterator_type it, value_type const& low, value_type const& up, Compare comp = Compare()) @@ -56,7 +55,7 @@ namespace sprout { : current(it.current), comp(it.comp), low(it.low), up(it.up) {} template - clamp_iterator& operator=(clamp_iterator const& it) { + SPROUT_CXX14_CONSTEXPR clamp_iterator& operator=(clamp_iterator const& it) { clamp_iterator temp(it); temp.swap(*this); return *this; @@ -80,20 +79,20 @@ namespace sprout { return &sprout::clamp(*current, low, up, comp); } - clamp_iterator& operator++() { + SPROUT_CXX14_CONSTEXPR clamp_iterator& operator++() { ++current; return *this; } - clamp_iterator operator++(int) { + SPROUT_CXX14_CONSTEXPR clamp_iterator operator++(int) { clamp_iterator result(*this); ++current; return result; } - clamp_iterator& operator--() { + SPROUT_CXX14_CONSTEXPR clamp_iterator& operator--() { --current; return *this; } - clamp_iterator operator--(int) { + SPROUT_CXX14_CONSTEXPR clamp_iterator operator--(int) { clamp_iterator temp(*this); --current; return temp; @@ -104,12 +103,12 @@ namespace sprout { SPROUT_CONSTEXPR clamp_iterator operator-(difference_type n) const { return clamp_iterator(sprout::prev(current, n), low, up, comp); } - clamp_iterator& operator+=(difference_type n) { + SPROUT_CXX14_CONSTEXPR clamp_iterator& operator+=(difference_type n) { clamp_iterator temp(sprout::next(current, n), low, up, comp); temp.swap(*this); return *this; } - clamp_iterator& operator-=(difference_type n) { + SPROUT_CXX14_CONSTEXPR clamp_iterator& operator-=(difference_type n) { clamp_iterator temp(sprout::prev(current, n), low, up, comp); temp.swap(*this); return *this; @@ -123,7 +122,7 @@ namespace sprout { SPROUT_CONSTEXPR clamp_iterator prev() const { return clamp_iterator(sprout::prev(current), low, up, comp); } - void swap(clamp_iterator& other) + SPROUT_CXX14_CONSTEXPR void swap(clamp_iterator& other) SPROUT_NOEXCEPT_EXPR( SPROUT_NOEXCEPT_EXPR(sprout::swap(current, other.current)) && SPROUT_NOEXCEPT_EXPR(sprout::swap(comp, other.comp)) @@ -215,7 +214,7 @@ namespace sprout { // swap // template - inline void + inline SPROUT_CXX14_CONSTEXPR void swap(sprout::clamp_iterator& lhs, sprout::clamp_iterator& rhs) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) { diff --git a/sprout/iterator/size_enum_iterator.hpp b/sprout/iterator/size_enum_iterator.hpp index 6f172e55..d9ecc96b 100644 --- a/sprout/iterator/size_enum_iterator.hpp +++ b/sprout/iterator/size_enum_iterator.hpp @@ -178,7 +178,7 @@ namespace sprout { , is_sep(it.is_sep) {} template - size_enum_iterator& operator=(size_enum_iterator const& it) { + SPROUT_CXX14_CONSTEXPR size_enum_iterator& operator=(size_enum_iterator const& it) { size_enum_iterator temp(it); temp.swap(*this); return *this; diff --git a/sprout/range/range_container.hpp b/sprout/range/range_container.hpp index fb7aad26..c21631c8 100644 --- a/sprout/range/range_container.hpp +++ b/sprout/range/range_container.hpp @@ -48,7 +48,7 @@ namespace sprout { {} template - void swap(range_container& other) + SPROUT_CXX14_CONSTEXPR void swap(range_container& other) SPROUT_NOEXCEPT_EXPR( SPROUT_NOEXCEPT_EXPR(sprout::swap(other.first_, first_)) && SPROUT_NOEXCEPT_EXPR(sprout::swap(other.last_, last_)) @@ -88,13 +88,13 @@ namespace sprout { } // others: template - range_container& operator=(range_container const& rhs) { + SPROUT_CXX14_CONSTEXPR range_container& operator=(range_container const& rhs) { first_ = rhs.first_; last_ = rhs.last_; return *this; } template - range_container& operator=(range_container&& rhs) { + SPROUT_CXX14_CONSTEXPR range_container& operator=(range_container&& rhs) { first_ = std::move(rhs.first_); last_ = std::move(rhs.last_); return *this; @@ -105,7 +105,8 @@ namespace sprout { // swap // template - inline void swap(sprout::range::range_container& lhs, sprout::range::range_container& rhs) { + inline SPROUT_CXX14_CONSTEXPR void + swap(sprout::range::range_container& lhs, sprout::range::range_container& rhs) { lhs.swap(rhs); } diff --git a/sprout/tuple/tuple/ignore.hpp b/sprout/tuple/tuple/ignore.hpp index f392fa3d..3fa01638 100644 --- a/sprout/tuple/tuple/ignore.hpp +++ b/sprout/tuple/tuple/ignore.hpp @@ -18,7 +18,7 @@ namespace sprout { struct ignore_t { public: template - ignore_t const& operator=(T const&) const { + SPROUT_CXX14_CONSTEXPR ignore_t const& operator=(T const&) const { return *this; } };