1
0
Fork 0
mirror of https://github.com/bolero-MURAKAMI/Sprout synced 2024-11-12 21:09:01 +00:00

[sprout.iterator] fix predefined iterators: support c++14 constexpr

This commit is contained in:
bolero-MURAKAMI 2013-10-09 23:44:25 +09:00
parent 40b95948a9
commit 9e678c517d
29 changed files with 290 additions and 271 deletions

View file

@ -68,7 +68,9 @@ namespace sprout {
, pred(pred)
{}
public:
adjacent_filter_iterator() = default;
SPROUT_CONSTEXPR adjacent_filter_iterator()
: current(), last(), pred()
{}
adjacent_filter_iterator(adjacent_filter_iterator const&) = default;
SPROUT_CONSTEXPR adjacent_filter_iterator(Predicate pred, iterator_type it, iterator_type last = iterator_type())
: current(find_next(it, last, pred))
@ -82,7 +84,7 @@ namespace sprout {
, pred(it.pred)
{}
template<typename U>
adjacent_filter_iterator& operator=(adjacent_filter_iterator<Predicate, U> const& it) {
SPROUT_CXX14_CONSTEXPR adjacent_filter_iterator& operator=(adjacent_filter_iterator<Predicate, U> const& it) {
adjacent_filter_iterator temp(it);
temp.swap(*this);
return *this;
@ -103,14 +105,14 @@ namespace sprout {
return &*current;
}
adjacent_filter_iterator& operator++() {
SPROUT_CXX14_CONSTEXPR adjacent_filter_iterator& operator++() {
satisfy_predicate();
if (current != last) {
++current;
}
return *this;
}
adjacent_filter_iterator operator++(int) {
SPROUT_CXX14_CONSTEXPR adjacent_filter_iterator operator++(int) {
adjacent_filter_iterator result(*this);
satisfy_predicate();
if (current != last) {
@ -121,7 +123,7 @@ namespace sprout {
SPROUT_CONSTEXPR adjacent_filter_iterator next() const {
return adjacent_filter_iterator(pred, checked_next(find_next(current, last, pred), last), last, private_construct_t());
}
void swap(adjacent_filter_iterator& other)
SPROUT_CXX14_CONSTEXPR void swap(adjacent_filter_iterator& other)
SPROUT_NOEXCEPT_EXPR(
SPROUT_NOEXCEPT_EXPR(sprout::swap(current, other.current))
&& SPROUT_NOEXCEPT_EXPR(sprout::swap(last, other.last))
@ -164,7 +166,7 @@ namespace sprout {
// swap
//
template<typename Predicate, typename Iterator>
inline void
inline SPROUT_CXX14_CONSTEXPR void
swap(sprout::adjacent_filter_iterator<Predicate, Iterator>& lhs, sprout::adjacent_filter_iterator<Predicate, Iterator>& rhs)
SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs)))
{

View file

@ -56,7 +56,7 @@ namespace sprout {
: current1(it1), current2(it2), in_left(in_left)
{}
public:
alternate_iterator()
SPROUT_CONSTEXPR alternate_iterator()
: current1(), current2(), in_left(true)
{}
alternate_iterator(alternate_iterator const&) = default;
@ -68,7 +68,7 @@ namespace sprout {
: current1(it.base()), current2(it.base2()), in_left(it.is_in_left())
{}
template<typename U, typename V>
alternate_iterator& operator=(alternate_iterator<U, V> const& it) {
SPROUT_CXX14_CONSTEXPR alternate_iterator& operator=(alternate_iterator<U, V> const& it) {
alternate_iterator temp(it);
temp.swap(*this);
return *this;
@ -88,7 +88,7 @@ namespace sprout {
SPROUT_CONSTEXPR pointer operator->() const {
return &*(*this);
}
alternate_iterator& operator++() {
SPROUT_CXX14_CONSTEXPR alternate_iterator& operator++() {
if (is_in_left()) {
in_left = false;
} else {
@ -98,7 +98,7 @@ namespace sprout {
}
return *this;
}
alternate_iterator operator++(int) {
SPROUT_CXX14_CONSTEXPR alternate_iterator operator++(int) {
alternate_iterator result(*this);
if (is_in_left()) {
in_left = false;
@ -109,7 +109,7 @@ namespace sprout {
}
return result;
}
alternate_iterator& operator--() {
SPROUT_CXX14_CONSTEXPR alternate_iterator& operator--() {
if (is_in_left()) {
in_left = false;
--current1;
@ -119,7 +119,7 @@ namespace sprout {
}
return *this;
}
alternate_iterator operator--(int) {
SPROUT_CXX14_CONSTEXPR alternate_iterator operator--(int) {
alternate_iterator temp(*this);
if (is_in_left()) {
in_left = false;
@ -136,12 +136,12 @@ namespace sprout {
SPROUT_CONSTEXPR alternate_iterator operator-(difference_type n) const {
return advance_impl(-n);
}
alternate_iterator& operator+=(difference_type n) {
SPROUT_CXX14_CONSTEXPR alternate_iterator& operator+=(difference_type n) {
alternate_iterator temp(*this + n);
temp.swap(*this);
return *this;
}
alternate_iterator& operator-=(difference_type n) {
SPROUT_CXX14_CONSTEXPR alternate_iterator& operator-=(difference_type n) {
alternate_iterator temp(*this - n);
temp.swap(*this);
return *this;
@ -159,7 +159,7 @@ namespace sprout {
: alternate_iterator(current1, current2, true)
;
}
void swap(alternate_iterator& other)
SPROUT_CXX14_CONSTEXPR void swap(alternate_iterator& other)
SPROUT_NOEXCEPT_EXPR(
SPROUT_NOEXCEPT_EXPR(sprout::swap(current1, other.current1))
&& SPROUT_NOEXCEPT_EXPR(sprout::swap(current2, other.current2))
@ -275,7 +275,7 @@ namespace sprout {
// swap
//
template<typename LIterator, typename RIterator>
inline void
inline SPROUT_CXX14_CONSTEXPR void
swap(
sprout::alternate_iterator<LIterator, RIterator>& lhs,
sprout::alternate_iterator<LIterator, RIterator>& rhs

View file

@ -50,33 +50,30 @@ namespace sprout {
protected:
using base_type::container;
public:
SPROUT_CONSTEXPR back_insert_iterator() = default;
back_insert_iterator() = default;
explicit SPROUT_CONSTEXPR back_insert_iterator(param_type x)
: base_type(x)
{}
SPROUT_CONSTEXPR back_insert_iterator(back_insert_iterator const&) = default;
back_insert_iterator& operator=(typename container_type::value_type const& value) {
SPROUT_CXX14_CONSTEXPR back_insert_iterator& operator=(typename container_type::value_type const& value) {
container->push_back(value);
return *this;
}
back_insert_iterator& operator=(typename container_type::value_type&& value) {
SPROUT_CXX14_CONSTEXPR back_insert_iterator& operator=(typename container_type::value_type&& value) {
container->push_back(sprout::move(value));
return *this;
}
SPROUT_CONSTEXPR back_insert_iterator const& operator*() const {
SPROUT_CXX14_CONSTEXPR back_insert_iterator& operator*() {
return *this;
}
back_insert_iterator& operator*() {
SPROUT_CXX14_CONSTEXPR back_insert_iterator& operator++() {
return *this;
}
back_insert_iterator& operator++() {
return *this;
}
back_insert_iterator operator++(int) {
SPROUT_CXX14_CONSTEXPR back_insert_iterator operator++(int) {
return *this;
}
void swap(back_insert_iterator& other)
SPROUT_CXX14_CONSTEXPR void swap(back_insert_iterator& other)
SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(base_type::swap(other)))
{
base_type::swap(other);
@ -87,7 +84,7 @@ namespace sprout {
// swap
//
template<typename Container>
inline void
inline SPROUT_CXX14_CONSTEXPR void
swap(sprout::back_insert_iterator<Container>& lhs, sprout::back_insert_iterator<Container>& rhs)
SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs)))
{

View file

@ -60,8 +60,7 @@ namespace sprout {
difference_type i_;
private:
SPROUT_CONSTEXPR bytes_iterator(iterator_type it, difference_type i)
: it_(it)
, i_(i)
: it_(it) , i_(i)
{}
SPROUT_CONSTEXPR bytes_iterator(iterator_type it, difference_type i, next_tag)
: it_(i / traits_type::size() == 0 ? it : sprout::next(it))
@ -101,7 +100,7 @@ namespace sprout {
SPROUT_CONSTEXPR bytes_iterator prev() const {
return bytes_iterator(it_, i_ - 1, prev_tag());
}
void swap(bytes_iterator& other)
SPROUT_CXX14_CONSTEXPR void swap(bytes_iterator& other)
SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::swap(it_, other.it_)))
{
sprout::swap(it_, other.it_);
@ -110,22 +109,22 @@ namespace sprout {
SPROUT_CONSTEXPR reference operator*() const {
return traits_type::get_byte(*it_, i_);
}
bytes_iterator& operator++() {
SPROUT_CXX14_CONSTEXPR bytes_iterator& operator++() {
bytes_iterator temp(next());
temp.swap(*this);
return *this;
}
bytes_iterator operator++(int) {
SPROUT_CXX14_CONSTEXPR bytes_iterator operator++(int) {
bytes_iterator result(*this);
++*this;
return result;
}
bytes_iterator& operator--() {
SPROUT_CXX14_CONSTEXPR bytes_iterator& operator--() {
bytes_iterator temp(prev());
temp.swap(*this);
return *this;
}
bytes_iterator operator--(int) {
SPROUT_CXX14_CONSTEXPR bytes_iterator operator--(int) {
bytes_iterator result(*this);
--*this;
return result;
@ -136,12 +135,12 @@ namespace sprout {
SPROUT_CONSTEXPR bytes_iterator operator-(difference_type n) const {
return bytes_iterator(it_, i_ - n, ra_tag());
}
bytes_iterator& operator+=(difference_type n) {
SPROUT_CXX14_CONSTEXPR bytes_iterator& operator+=(difference_type n) {
bytes_iterator temp(it_, i_ + n, ra_tag());
temp.swap(*this);
return *this;
}
bytes_iterator& operator-=(difference_type n) {
SPROUT_CXX14_CONSTEXPR bytes_iterator& operator-=(difference_type n) {
bytes_iterator temp(it_, i_ - n, ra_tag());
temp.swap(*this);
return *this;
@ -196,7 +195,7 @@ namespace sprout {
// swap
//
template<typename Iterator, typename Traits>
inline void
inline SPROUT_CXX14_CONSTEXPR void
swap(sprout::bytes_iterator<Iterator, Traits>& lhs, sprout::bytes_iterator<Iterator, Traits>& rhs)
SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs)))
{

View file

@ -74,7 +74,7 @@ namespace sprout {
SPROUT_CONSTEXPR dft_iterator prev() const {
return dft_iterator(first_, last_, index_, index_ - 1, size_);
}
void swap(dft_iterator& other)
SPROUT_CXX14_CONSTEXPR void swap(dft_iterator& other)
SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::swap(first_, other.first_)) && SPROUT_NOEXCEPT_EXPR(sprout::swap(last_, other.last_)))
{
sprout::swap(first_, other.first_);
@ -85,22 +85,22 @@ namespace sprout {
SPROUT_CONSTEXPR reference operator*() const {
return sprout::detail::dft_element_impl(first_, last_, index_, size_);
}
dft_iterator& operator++() {
SPROUT_CXX14_CONSTEXPR dft_iterator& operator++() {
dft_iterator temp(next());
temp.swap(*this);
return *this;
}
dft_iterator operator++(int) {
SPROUT_CXX14_CONSTEXPR dft_iterator operator++(int) {
dft_iterator result(*this);
++*this;
return result;
}
dft_iterator& operator--() {
SPROUT_CXX14_CONSTEXPR dft_iterator& operator--() {
dft_iterator temp(prev());
temp.swap(*this);
return *this;
}
dft_iterator operator--(int) {
SPROUT_CXX14_CONSTEXPR dft_iterator operator--(int) {
dft_iterator result(*this);
--*this;
return result;
@ -111,12 +111,12 @@ namespace sprout {
SPROUT_CONSTEXPR dft_iterator operator-(difference_type n) const {
return dft_iterator(first_, last_, index_, index_ - n, size_);
}
dft_iterator& operator+=(difference_type n) {
SPROUT_CXX14_CONSTEXPR dft_iterator& operator+=(difference_type n) {
dft_iterator temp(first_, last_, index_, index_ + n, size_);
temp.swap(*this);
return *this;
}
dft_iterator& operator-=(difference_type n) {
SPROUT_CXX14_CONSTEXPR dft_iterator& operator-=(difference_type n) {
dft_iterator temp(first_, last_, index_, index_ - n, size_);
temp.swap(*this);
return *this;
@ -180,7 +180,7 @@ namespace sprout {
// swap
//
template<typename Iterator>
inline void
inline SPROUT_CXX14_CONSTEXPR void
swap(sprout::dft_iterator<Iterator>& lhs, sprout::dft_iterator<Iterator>& rhs)
SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs)))
{

View file

@ -60,10 +60,10 @@ namespace sprout {
iterator_type last;
Predicate pred;
private:
void satisfy_predicate() {
SPROUT_CXX14_CONSTEXPR void satisfy_predicate() {
current = sprout::find_if(current, last, pred);
}
void satisfy_predicate_backward() {
SPROUT_CXX14_CONSTEXPR void satisfy_predicate_backward() {
while (!pred(*current)) {
--current;
}
@ -74,7 +74,9 @@ namespace sprout {
, pred(pred)
{}
public:
filter_iterator() = default;
SPROUT_CONSTEXPR filter_iterator()
: current(), last(), pred()
{}
filter_iterator(filter_iterator const&) = default;
SPROUT_CONSTEXPR filter_iterator(Predicate pred, iterator_type it, iterator_type last = iterator_type())
: current(find_next(it, last, pred))
@ -88,7 +90,7 @@ namespace sprout {
, pred(it.pred)
{}
template<typename U>
filter_iterator& operator=(filter_iterator<Predicate, U> const& it) {
SPROUT_CXX14_CONSTEXPR filter_iterator& operator=(filter_iterator<Predicate, U> const& it) {
filter_iterator temp(it);
temp.swap(*this);
return *this;
@ -109,23 +111,23 @@ namespace sprout {
return &*current;
}
filter_iterator& operator++() {
SPROUT_CXX14_CONSTEXPR filter_iterator& operator++() {
++current;
satisfy_predicate();
return *this;
}
filter_iterator operator++(int) {
SPROUT_CXX14_CONSTEXPR filter_iterator operator++(int) {
filter_iterator result(*this);
++current;
satisfy_predicate();
return result;
}
filter_iterator& operator--() {
SPROUT_CXX14_CONSTEXPR filter_iterator& operator--() {
--current;
satisfy_predicate_backward();
return *this;
}
filter_iterator operator--(int) {
SPROUT_CXX14_CONSTEXPR filter_iterator operator--(int) {
filter_iterator temp(*this);
--current;
satisfy_predicate_backward();
@ -137,7 +139,7 @@ namespace sprout {
SPROUT_CONSTEXPR filter_iterator prev() const {
return filter_iterator(pred, find_prev(sprout::prev(current), pred), last, private_construct_t());
}
void swap(filter_iterator& other)
SPROUT_CXX14_CONSTEXPR void swap(filter_iterator& other)
SPROUT_NOEXCEPT_EXPR(
SPROUT_NOEXCEPT_EXPR(sprout::swap(current, other.current))
&& SPROUT_NOEXCEPT_EXPR(sprout::swap(last, other.last))
@ -180,7 +182,7 @@ namespace sprout {
// swap
//
template<typename Predicate, typename Iterator>
inline void
inline SPROUT_CXX14_CONSTEXPR void
swap(sprout::filter_iterator<Predicate, Iterator>& lhs, sprout::filter_iterator<Predicate, Iterator>& rhs)
SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs)))
{

View file

@ -50,29 +50,26 @@ namespace sprout {
protected:
using base_type::container;
public:
SPROUT_CONSTEXPR front_insert_iterator() = default;
front_insert_iterator() = default;
explicit SPROUT_CONSTEXPR front_insert_iterator(param_type x)
: base_type(x)
{}
SPROUT_CONSTEXPR front_insert_iterator(front_insert_iterator const&) = default;
front_insert_iterator& operator=(typename container_type::value_type const& value) {
SPROUT_CXX14_CONSTEXPR front_insert_iterator& operator=(typename container_type::value_type const& value) {
container->push_front(value);
return *this;
}
front_insert_iterator& operator=(typename container_type::value_type&& value) {
SPROUT_CXX14_CONSTEXPR front_insert_iterator& operator=(typename container_type::value_type&& value) {
container->push_front(sprout::move(value));
return *this;
}
SPROUT_CONSTEXPR front_insert_iterator const& operator*() const {
SPROUT_CXX14_CONSTEXPR front_insert_iterator& operator*() {
return *this;
}
front_insert_iterator& operator*() {
SPROUT_CXX14_CONSTEXPR front_insert_iterator& operator++() {
return *this;
}
front_insert_iterator& operator++() {
return *this;
}
front_insert_iterator operator++(int) {
SPROUT_CXX14_CONSTEXPR front_insert_iterator operator++(int) {
return *this;
}
@ -87,7 +84,7 @@ namespace sprout {
// swap
//
template<typename Container>
inline void
inline SPROUT_CXX14_CONSTEXPR void
swap(sprout::front_insert_iterator<Container>& lhs, sprout::front_insert_iterator<Container>& rhs)
SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs)))
{

View file

@ -74,7 +74,7 @@ namespace sprout {
SPROUT_CONSTEXPR idft_iterator prev() const {
return idft_iterator(first_, last_, index_, index_ - 1, size_);
}
void swap(idft_iterator& other)
SPROUT_CXX14_CONSTEXPR void swap(idft_iterator& other)
SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::swap(first_, other.first_)) && SPROUT_NOEXCEPT_EXPR(sprout::swap(last_, other.last_)))
{
sprout::swap(first_, other.first_);
@ -85,22 +85,22 @@ namespace sprout {
SPROUT_CONSTEXPR reference operator*() const {
return sprout::detail::idft_element_impl(first_, last_, index_, size_);
}
idft_iterator& operator++() {
SPROUT_CXX14_CONSTEXPR idft_iterator& operator++() {
idft_iterator temp(next());
temp.swap(*this);
return *this;
}
idft_iterator operator++(int) {
SPROUT_CXX14_CONSTEXPR idft_iterator operator++(int) {
idft_iterator result(*this);
++*this;
return result;
}
idft_iterator& operator--() {
SPROUT_CXX14_CONSTEXPR idft_iterator& operator--() {
idft_iterator temp(prev());
temp.swap(*this);
return *this;
}
idft_iterator operator--(int) {
SPROUT_CXX14_CONSTEXPR idft_iterator operator--(int) {
idft_iterator result(*this);
--*this;
return result;
@ -111,12 +111,12 @@ namespace sprout {
SPROUT_CONSTEXPR idft_iterator operator-(difference_type n) const {
return idft_iterator(first_, last_, index_, index_ - n, size_);
}
idft_iterator& operator+=(difference_type n) {
SPROUT_CXX14_CONSTEXPR idft_iterator& operator+=(difference_type n) {
idft_iterator temp(first_, last_, index_, index_ + n, size_);
temp.swap(*this);
return *this;
}
idft_iterator& operator-=(difference_type n) {
SPROUT_CXX14_CONSTEXPR idft_iterator& operator-=(difference_type n) {
idft_iterator temp(first_, last_, index_, index_ - n, size_);
temp.swap(*this);
return *this;
@ -180,7 +180,7 @@ namespace sprout {
// swap
//
template<typename Iterator>
inline void
inline SPROUT_CXX14_CONSTEXPR void
swap(sprout::idft_iterator<Iterator>& lhs, sprout::idft_iterator<Iterator>& rhs)
SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs)))
{

View file

@ -42,7 +42,9 @@ namespace sprout {
iterator_type current;
index_type idx;
public:
indexed_iterator() = default;
SPROUT_CONSTEXPR indexed_iterator()
: current(), idx()
{}
SPROUT_CONSTEXPR indexed_iterator(indexed_iterator const& other)
: current(other.current)
, idx(other.idx)
@ -57,7 +59,7 @@ namespace sprout {
, idx(it.index())
{}
template<typename U>
indexed_iterator& operator=(indexed_iterator<U> const& it) {
SPROUT_CXX14_CONSTEXPR indexed_iterator& operator=(indexed_iterator<U> const& it) {
indexed_iterator temp(it);
temp.swap(*this);
return *this;
@ -74,23 +76,23 @@ namespace sprout {
SPROUT_CONSTEXPR pointer operator->() const {
return &*current;
}
indexed_iterator& operator++() {
SPROUT_CXX14_CONSTEXPR indexed_iterator& operator++() {
++current;
++idx;
return *this;
}
indexed_iterator operator++(int) {
SPROUT_CXX14_CONSTEXPR indexed_iterator operator++(int) {
indexed_iterator result(*this);
++current;
++idx;
return result;
}
indexed_iterator& operator--() {
SPROUT_CXX14_CONSTEXPR indexed_iterator& operator--() {
--current;
--idx;
return *this;
}
indexed_iterator operator--(int) {
SPROUT_CXX14_CONSTEXPR indexed_iterator operator--(int) {
indexed_iterator temp(*this);
--current;
--idx;
@ -102,12 +104,12 @@ namespace sprout {
SPROUT_CONSTEXPR indexed_iterator operator-(difference_type n) const {
return indexed_iterator(current - n, idx - n);
}
indexed_iterator& operator+=(difference_type n) {
SPROUT_CXX14_CONSTEXPR indexed_iterator& operator+=(difference_type n) {
indexed_iterator temp(current + n, idx + n);
temp.swap(*this);
return *this;
}
indexed_iterator& operator-=(difference_type n) {
SPROUT_CXX14_CONSTEXPR indexed_iterator& operator-=(difference_type n) {
indexed_iterator temp(current - n, idx - n);
temp.swap(*this);
return *this;
@ -121,7 +123,7 @@ namespace sprout {
SPROUT_CONSTEXPR indexed_iterator prev() const {
return indexed_iterator(sprout::prev(current), idx - 1);
}
void swap(indexed_iterator& other)
SPROUT_CXX14_CONSTEXPR void swap(indexed_iterator& other)
SPROUT_NOEXCEPT_EXPR(
SPROUT_NOEXCEPT_EXPR(swap(current, other.current))
&& SPROUT_NOEXCEPT_EXPR(swap(idx, other.idx))
@ -190,7 +192,7 @@ namespace sprout {
// swap
//
template<typename Iterator>
inline void
inline SPROUT_CXX14_CONSTEXPR void
swap(sprout::indexed_iterator<Iterator>& lhs, sprout::indexed_iterator<Iterator>& rhs)
SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs)))
{

View file

@ -52,7 +52,9 @@ namespace sprout {
using base_type::container;
iterator iter;
public:
SPROUT_CONSTEXPR insert_iterator() = default;
SPROUT_CONSTEXPR insert_iterator()
: base_type(), iter()
{}
SPROUT_CONSTEXPR insert_iterator(param_type x, iterator pos)
: base_type(x), iter(pos)
{}
@ -60,28 +62,25 @@ namespace sprout {
SPROUT_CONSTEXPR iterator position() const {
return iter;
}
insert_iterator& operator=(typename container_type::value_type const& value) {
SPROUT_CXX14_CONSTEXPR insert_iterator& operator=(typename container_type::value_type const& value) {
container->insert(iter, value);
return *this;
}
insert_iterator& operator=(typename container_type::value_type&& value) {
SPROUT_CXX14_CONSTEXPR insert_iterator& operator=(typename container_type::value_type&& value) {
container->insert(iter, sprout::move(value));
return *this;
}
SPROUT_CONSTEXPR insert_iterator const& operator*() const {
SPROUT_CXX14_CONSTEXPR insert_iterator& operator*() {
return *this;
}
insert_iterator& operator*() {
SPROUT_CXX14_CONSTEXPR insert_iterator& operator++() {
return *this;
}
insert_iterator& operator++() {
return *this;
}
insert_iterator operator++(int) {
SPROUT_CXX14_CONSTEXPR insert_iterator operator++(int) {
return *this;
}
void swap(insert_iterator& other)
SPROUT_CXX14_CONSTEXPR void swap(insert_iterator& other)
SPROUT_NOEXCEPT_EXPR(
SPROUT_NOEXCEPT_EXPR(base_type::swap(other))
&& SPROUT_NOEXCEPT_EXPR(sprout::swap(other.iter, iter))
@ -96,7 +95,7 @@ namespace sprout {
// swap
//
template<typename Container>
inline void
inline SPROUT_CXX14_CONSTEXPR void
swap(sprout::insert_iterator<Container>& lhs, sprout::insert_iterator<Container>& rhs)
SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs)))
{

View file

@ -70,7 +70,9 @@ namespace sprout {
;
}
public:
insert_range_iterator() = default;
SPROUT_CONSTEXPR insert_range_iterator()
: current1(), pos1(), current2(), first2(), last2()
{}
insert_range_iterator(insert_range_iterator const&) = default;
SPROUT_CONSTEXPR insert_range_iterator(iterator_type it1, iterator_type pos1, iterator2_type it2, iterator2_type first2, iterator2_type last2)
: current1(it1), pos1(pos1)
@ -82,7 +84,7 @@ namespace sprout {
, current2(it.base2()), first2(it.first()), last2(it.last())
{}
template<typename U, typename V>
insert_range_iterator& operator=(insert_range_iterator<U, V> const& it) {
SPROUT_CXX14_CONSTEXPR insert_range_iterator& operator=(insert_range_iterator<U, V> const& it) {
insert_range_iterator temp(it);
temp.swap(*this);
return *this;
@ -111,7 +113,7 @@ namespace sprout {
SPROUT_CONSTEXPR pointer operator->() const {
return &*(*this);
}
insert_range_iterator& operator++() {
SPROUT_CXX14_CONSTEXPR insert_range_iterator& operator++() {
if (is_in_base()) {
++current1;
} else {
@ -119,7 +121,7 @@ namespace sprout {
}
return *this;
}
insert_range_iterator operator++(int) {
SPROUT_CXX14_CONSTEXPR insert_range_iterator operator++(int) {
insert_range_iterator result(*this);
if (is_in_base()) {
++current1;
@ -128,7 +130,7 @@ namespace sprout {
}
return result;
}
insert_range_iterator& operator--() {
SPROUT_CXX14_CONSTEXPR insert_range_iterator& operator--() {
if (current1 != pos1 || current2 == first2) {
--current1;
} else {
@ -136,7 +138,7 @@ namespace sprout {
}
return *this;
}
insert_range_iterator operator--(int) {
SPROUT_CXX14_CONSTEXPR insert_range_iterator operator--(int) {
insert_range_iterator temp(*this);
if (current1 != pos1 || current2 == first2) {
--current1;
@ -151,12 +153,12 @@ namespace sprout {
SPROUT_CONSTEXPR insert_range_iterator operator-(difference_type n) const {
return advance_impl(-n);
}
insert_range_iterator& operator+=(difference_type n) {
SPROUT_CXX14_CONSTEXPR insert_range_iterator& operator+=(difference_type n) {
insert_range_iterator temp(*this + n);
temp.swap(*this);
return *this;
}
insert_range_iterator& operator-=(difference_type n) {
SPROUT_CXX14_CONSTEXPR insert_range_iterator& operator-=(difference_type n) {
insert_range_iterator temp(*this - n);
temp.swap(*this);
return *this;
@ -174,7 +176,7 @@ namespace sprout {
: insert_range_iterator(current1, pos1, sprout::prev(current2), first2, last2)
;
}
void swap(insert_range_iterator& other)
SPROUT_CXX14_CONSTEXPR void swap(insert_range_iterator& other)
SPROUT_NOEXCEPT_EXPR(
SPROUT_NOEXCEPT_EXPR(sprout::swap(current1, other.current1))
&& SPROUT_NOEXCEPT_EXPR(sprout::swap(pos1, other.pos1))
@ -297,7 +299,7 @@ namespace sprout {
// swap
//
template<typename DstIterator, typename SrcIterator>
inline void
inline SPROUT_CXX14_CONSTEXPR void
swap(
sprout::insert_range_iterator<DstIterator, SrcIterator>& lhs,
sprout::insert_range_iterator<DstIterator, SrcIterator>& rhs

View file

@ -69,13 +69,13 @@ namespace sprout {
;
}
public:
joint_iterator() = default;
SPROUT_CONSTEXPR joint_iterator()
: current1(), last1(), first2(), current2()
{}
joint_iterator(joint_iterator const&) = default;
SPROUT_CONSTEXPR joint_iterator(iterator_type it1, iterator_type last1, iterator2_type first2, iterator2_type it2)
: current1(it1)
, last1(last1)
, first2(first2)
, current2(it2)
: current1(it1) , last1(last1)
, first2(first2) , current2(it2)
{}
template<typename U, typename V>
SPROUT_CONSTEXPR joint_iterator(joint_iterator<U, V> const& it)
@ -85,7 +85,7 @@ namespace sprout {
, current2(it.base2())
{}
template<typename U, typename V>
joint_iterator& operator=(joint_iterator<U, V> const& it) {
SPROUT_CXX14_CONSTEXPR joint_iterator& operator=(joint_iterator<U, V> const& it) {
joint_iterator temp(it);
temp.swap(*this);
return *this;
@ -111,7 +111,7 @@ namespace sprout {
SPROUT_CONSTEXPR pointer operator->() const {
return &*(*this);
}
joint_iterator& operator++() {
SPROUT_CXX14_CONSTEXPR joint_iterator& operator++() {
if (is_in_left()) {
++current1;
} else {
@ -119,7 +119,7 @@ namespace sprout {
}
return *this;
}
joint_iterator operator++(int) {
SPROUT_CXX14_CONSTEXPR joint_iterator operator++(int) {
joint_iterator result(*this);
if (is_in_left()) {
++current1;
@ -128,7 +128,7 @@ namespace sprout {
}
return result;
}
joint_iterator& operator--() {
SPROUT_CXX14_CONSTEXPR joint_iterator& operator--() {
if (first2 == current2) {
--current1;
} else {
@ -136,7 +136,7 @@ namespace sprout {
}
return *this;
}
joint_iterator operator--(int) {
SPROUT_CXX14_CONSTEXPR joint_iterator operator--(int) {
joint_iterator temp(*this);
if (first2 == current2) {
--current1;
@ -151,12 +151,12 @@ namespace sprout {
SPROUT_CONSTEXPR joint_iterator operator-(difference_type n) const {
return advance_impl(-n);
}
joint_iterator& operator+=(difference_type n) {
SPROUT_CXX14_CONSTEXPR joint_iterator& operator+=(difference_type n) {
joint_iterator temp(*this + n);
temp.swap(*this);
return *this;
}
joint_iterator& operator-=(difference_type n) {
SPROUT_CXX14_CONSTEXPR joint_iterator& operator-=(difference_type n) {
joint_iterator temp(*this - n);
temp.swap(*this);
return *this;
@ -174,7 +174,7 @@ namespace sprout {
: joint_iterator(current1, last1, first2, sprout::prev(current2))
;
}
void swap(joint_iterator& other)
SPROUT_CXX14_CONSTEXPR void swap(joint_iterator& other)
SPROUT_NOEXCEPT_EXPR(
SPROUT_NOEXCEPT_EXPR(sprout::swap(current1, other.current1))
&& SPROUT_NOEXCEPT_EXPR(sprout::swap(last1, other.last1))
@ -309,7 +309,7 @@ namespace sprout {
// swap
//
template<typename LIterator, typename RIterator>
inline void
inline SPROUT_CXX14_CONSTEXPR void
swap(
sprout::joint_iterator<LIterator, RIterator>& lhs,
sprout::joint_iterator<LIterator, RIterator>& rhs

View file

@ -68,7 +68,7 @@ namespace sprout {
Compare comp;
bool in_left;
public:
merge_iterator()
SPROUT_CONSTEXPR merge_iterator()
: current1(), lst1(), current2(), lst2(), comp(), in_left(true)
{}
merge_iterator(merge_iterator const&) = default;
@ -90,7 +90,7 @@ namespace sprout {
, in_left(it.is_in_left())
{}
template<typename U, typename V, typename W>
merge_iterator& operator=(merge_iterator<U, V, W> const& it) {
SPROUT_CXX14_CONSTEXPR merge_iterator& operator=(merge_iterator<U, V, W> const& it) {
merge_iterator temp(it);
temp.swap(*this);
return *this;
@ -119,7 +119,7 @@ namespace sprout {
SPROUT_CONSTEXPR pointer operator->() const {
return &*(*this);
}
merge_iterator& operator++() {
SPROUT_CXX14_CONSTEXPR merge_iterator& operator++() {
if (current1 != lst1) {
if (current2 != lst2) {
if (comp(*current2, *current1)) {
@ -136,7 +136,7 @@ namespace sprout {
in_left = check_in_left(current1, lst1, current2, lst2, comp);
return *this;
}
merge_iterator operator++(int) {
SPROUT_CXX14_CONSTEXPR merge_iterator operator++(int) {
merge_iterator result(*this);
if (current1 != lst1) {
if (current2 != lst2) {
@ -166,7 +166,7 @@ namespace sprout {
: *this
;
}
void swap(merge_iterator& other)
SPROUT_CXX14_CONSTEXPR void swap(merge_iterator& other)
SPROUT_NOEXCEPT_EXPR(
SPROUT_NOEXCEPT_EXPR(sprout::swap(current1, other.current1))
&& SPROUT_NOEXCEPT_EXPR(sprout::swap(lst1, other.lst1))
@ -226,7 +226,7 @@ namespace sprout {
// swap
//
template<typename LIterator, typename RIterator, typename Compare>
inline void
inline SPROUT_CXX14_CONSTEXPR void
swap(
sprout::merge_iterator<LIterator, RIterator, Compare>& lhs,
sprout::merge_iterator<LIterator, RIterator, Compare>& rhs

View file

@ -43,7 +43,9 @@ namespace sprout {
protected:
iterator_type current;
public:
next_iterator() = default;
SPROUT_CONSTEXPR next_iterator()
: holder_(), current()
{}
SPROUT_CONSTEXPR next_iterator(next_iterator const& other)
: holder_(other.holder_), current(other.current)
{}
@ -55,7 +57,7 @@ namespace sprout {
: holder_(*it), current(it.base())
{}
template<typename U>
next_iterator& operator=(next_iterator<U> const& it) {
SPROUT_CXX14_CONSTEXPR next_iterator& operator=(next_iterator<U> const& it) {
next_iterator temp(it);
temp.swap(*this);
return *this;
@ -69,12 +71,12 @@ namespace sprout {
SPROUT_CONSTEXPR pointer operator->() const {
return &*(*this);
}
next_iterator& operator++() {
SPROUT_CXX14_CONSTEXPR next_iterator& operator++() {
holder_ = holder_type(*current);
++current;
return *this;
}
next_iterator operator++(int) {
SPROUT_CXX14_CONSTEXPR next_iterator operator++(int) {
next_iterator result(*this);
holder_ = holder_type(*current);
++current;
@ -83,7 +85,7 @@ namespace sprout {
SPROUT_CONSTEXPR next_iterator next() const {
return next_iterator(current);
}
void swap(next_iterator& other)
SPROUT_CXX14_CONSTEXPR void swap(next_iterator& other)
SPROUT_NOEXCEPT_EXPR(
SPROUT_NOEXCEPT_EXPR(swap(holder_, other.holder_)) && SPROUT_NOEXCEPT_EXPR(swap(current, other.current))
)
@ -117,7 +119,7 @@ namespace sprout {
// swap
//
template<typename Iterator>
inline void
inline SPROUT_CXX14_CONSTEXPR void
swap(sprout::next_iterator<Iterator>& lhs, sprout::next_iterator<Iterator>& rhs)
SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs)))
{

View file

@ -75,7 +75,11 @@ namespace sprout {
difference_type begin_off;
difference_type end_off;
public:
remake_iterator() = default;
SPROUT_CONSTEXPR remake_iterator()
: current(), current2()
, fst(), lst()
, begin_off(), end_off()
{}
SPROUT_CONSTEXPR remake_iterator(remake_iterator const& other)
: current(other.current), current2(other.current2)
, fst(other.fst), lst(other.lst)
@ -93,7 +97,7 @@ namespace sprout {
, begin_off(it.begin_offset()), end_off(it.end_offset())
{}
template<typename U, typename V>
remake_iterator& operator=(remake_iterator<U, V> const& it) {
SPROUT_CXX14_CONSTEXPR remake_iterator& operator=(remake_iterator<U, V> const& it) {
remake_iterator temp(it);
temp.swap(*this);
return *this;
@ -125,7 +129,7 @@ namespace sprout {
SPROUT_CONSTEXPR pointer operator->() const {
return &*(*this);
}
remake_iterator& operator++() {
SPROUT_CXX14_CONSTEXPR remake_iterator& operator++() {
++current;
if (is_in_copying()) {
++current2;
@ -134,7 +138,7 @@ namespace sprout {
--end_off;
return *this;
}
remake_iterator operator++(int) {
SPROUT_CXX14_CONSTEXPR remake_iterator operator++(int) {
remake_iterator result(*this);
++current;
if (is_in_copying()) {
@ -144,7 +148,7 @@ namespace sprout {
--end_off;
return result;
}
remake_iterator& operator--() {
SPROUT_CXX14_CONSTEXPR remake_iterator& operator--() {
--current;
if (begin_off < 0 && end_off >= 0) {
--current2;
@ -153,7 +157,7 @@ namespace sprout {
++end_off;
return *this;
}
remake_iterator operator--(int) {
SPROUT_CXX14_CONSTEXPR remake_iterator operator--(int) {
remake_iterator temp(*this);
--current;
if (begin_off < 0 && end_off >= 0) {
@ -169,12 +173,12 @@ namespace sprout {
SPROUT_CONSTEXPR remake_iterator operator-(difference_type n) const {
return advance_impl(-n);
}
remake_iterator& operator+=(difference_type n) {
SPROUT_CXX14_CONSTEXPR remake_iterator& operator+=(difference_type n) {
remake_iterator temp(*this + n);
temp.swap(*this);
return *this;
}
remake_iterator& operator-=(difference_type n) {
SPROUT_CXX14_CONSTEXPR remake_iterator& operator-=(difference_type n) {
remake_iterator temp(*this - n);
temp.swap(*this);
return *this;
@ -196,7 +200,7 @@ namespace sprout {
begin_off + 1, end_off + 1
);
}
void swap(remake_iterator& other)
SPROUT_CXX14_CONSTEXPR void swap(remake_iterator& other)
SPROUT_NOEXCEPT_EXPR(
SPROUT_NOEXCEPT_EXPR(swap(current, other.current))
&& SPROUT_NOEXCEPT_EXPR(swap(current2, other.current2))
@ -321,7 +325,7 @@ namespace sprout {
// swap
//
template<typename DstIterator, typename SrcIterator>
inline void
inline SPROUT_CXX14_CONSTEXPR void
swap(sprout::remake_iterator<DstIterator, SrcIterator>& lhs, sprout::remake_iterator<DstIterator, SrcIterator>& rhs)
SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs)))
{

View file

@ -52,7 +52,7 @@ namespace sprout {
: current(it.base())
{}
template<typename U>
reverse_iterator& operator=(reverse_iterator<U> const& it) {
SPROUT_CXX14_CONSTEXPR reverse_iterator& operator=(reverse_iterator<U> const& it) {
reverse_iterator temp(it);
temp.swap(*this);
return *this;
@ -66,20 +66,20 @@ namespace sprout {
SPROUT_CONSTEXPR pointer operator->() const {
return &*(*this);
}
reverse_iterator& operator++() {
SPROUT_CXX14_CONSTEXPR reverse_iterator& operator++() {
--current;
return *this;
}
reverse_iterator operator++(int) {
SPROUT_CXX14_CONSTEXPR reverse_iterator operator++(int) {
reverse_iterator result(*this);
--current;
return result;
}
reverse_iterator& operator--() {
SPROUT_CXX14_CONSTEXPR reverse_iterator& operator--() {
++current;
return *this;
}
reverse_iterator operator--(int) {
SPROUT_CXX14_CONSTEXPR reverse_iterator operator--(int) {
reverse_iterator temp(*this);
++current;
return temp;
@ -90,12 +90,12 @@ namespace sprout {
SPROUT_CONSTEXPR reverse_iterator operator-(difference_type n) const {
return reverse_iterator(current + n);
}
reverse_iterator& operator+=(difference_type n) {
SPROUT_CXX14_CONSTEXPR reverse_iterator& operator+=(difference_type n) {
reverse_iterator temp(current - n);
temp.swap(*this);
return *this;
}
reverse_iterator& operator-=(difference_type n) {
SPROUT_CXX14_CONSTEXPR reverse_iterator& operator-=(difference_type n) {
reverse_iterator temp(current + n);
temp.swap(*this);
return *this;
@ -109,7 +109,7 @@ namespace sprout {
SPROUT_CONSTEXPR reverse_iterator prev() const {
return reverse_iterator(sprout::next(current));
}
void swap(reverse_iterator& other)
SPROUT_CXX14_CONSTEXPR void swap(reverse_iterator& other)
SPROUT_NOEXCEPT_EXPR(
SPROUT_NOEXCEPT_EXPR(swap(current, other.current))
)
@ -176,7 +176,7 @@ namespace sprout {
// swap
//
template<typename Iterator>
inline void
inline SPROUT_CXX14_CONSTEXPR void
swap(sprout::reverse_iterator<Iterator>& lhs, sprout::reverse_iterator<Iterator>& rhs)
SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs)))
{

View file

@ -78,7 +78,7 @@ namespace sprout {
, phase_(it.phase_)
{}
template<typename U>
sawtooth_iterator& operator=(sawtooth_iterator<U> const& it) {
SPROUT_CXX14_CONSTEXPR sawtooth_iterator& operator=(sawtooth_iterator<U> const& it) {
sawtooth_iterator temp(it);
temp.swap(*this);
return *this;
@ -103,20 +103,20 @@ namespace sprout {
SPROUT_CONSTEXPR pointer operator->() const {
return &operator*()();
}
sawtooth_iterator& operator++() {
SPROUT_CXX14_CONSTEXPR sawtooth_iterator& operator++() {
++index_;
return *this;
}
sawtooth_iterator operator++(int) {
SPROUT_CXX14_CONSTEXPR sawtooth_iterator operator++(int) {
sawtooth_iterator result(*this);
++index_;
return result;
}
sawtooth_iterator& operator--() {
SPROUT_CXX14_CONSTEXPR sawtooth_iterator& operator--() {
--index_;
return *this;
}
sawtooth_iterator operator--(int) {
SPROUT_CXX14_CONSTEXPR sawtooth_iterator operator--(int) {
sawtooth_iterator temp(*this);
--index_;
return temp;
@ -127,12 +127,12 @@ namespace sprout {
SPROUT_CONSTEXPR sawtooth_iterator operator-(difference_type n) const {
return sawtooth_iterator(*this, index_ - n);
}
sawtooth_iterator& operator+=(difference_type n) {
SPROUT_CXX14_CONSTEXPR sawtooth_iterator& operator+=(difference_type n) {
sawtooth_iterator temp(*this, index_ + n);
temp.swap(*this);
return *this;
}
sawtooth_iterator& operator-=(difference_type n) {
SPROUT_CXX14_CONSTEXPR sawtooth_iterator& operator-=(difference_type n) {
sawtooth_iterator temp(*this, index_ - n);
temp.swap(*this);
return *this;
@ -148,7 +148,7 @@ namespace sprout {
SPROUT_CONSTEXPR sawtooth_iterator prev() const {
return sawtooth_iterator(*this, index_ - 1);
}
void swap(sawtooth_iterator& other) SPROUT_NOEXCEPT {
SPROUT_CXX14_CONSTEXPR void swap(sawtooth_iterator& other) SPROUT_NOEXCEPT {
sprout::swap(index_, other.index_);
sprout::swap(frequency_, other.frequency_);
sprout::swap(amplitude_, other.amplitude_);
@ -201,7 +201,7 @@ namespace sprout {
// swap
//
template<typename Value>
inline void
inline SPROUT_CXX14_CONSTEXPR void
swap(sprout::sawtooth_iterator<Value>& lhs, sprout::sawtooth_iterator<Value>& rhs)
SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs)))
{

View file

@ -86,7 +86,7 @@ namespace sprout {
, comp(it.compare())
{}
template<typename U, typename V, typename W>
set_difference_iterator& operator=(set_difference_iterator<U, V, W> const& it) {
SPROUT_CXX14_CONSTEXPR set_difference_iterator& operator=(set_difference_iterator<U, V, W> const& it) {
set_difference_iterator temp(it);
temp.swap(*this);
return *this;
@ -115,11 +115,11 @@ namespace sprout {
SPROUT_CONSTEXPR pointer operator->() const {
return &*(*this);
}
set_difference_iterator& operator++() {
SPROUT_CXX14_CONSTEXPR set_difference_iterator& operator++() {
current = sprout::next_difference(current.first, lst1, current.second, lst2, comp);
return *this;
}
set_difference_iterator operator++(int) {
SPROUT_CXX14_CONSTEXPR set_difference_iterator operator++(int) {
set_difference_iterator result(*this);
current = sprout::next_difference(current.first, lst1, current.second, lst2, comp);
return result;
@ -130,7 +130,7 @@ namespace sprout {
sprout::next_difference(current.first, lst1, current.second, lst2, comp)
);
}
void swap(set_difference_iterator& other)
SPROUT_CXX14_CONSTEXPR void swap(set_difference_iterator& other)
SPROUT_NOEXCEPT_EXPR(
SPROUT_NOEXCEPT_EXPR(sprout::swap(current, other.current))
&& SPROUT_NOEXCEPT_EXPR(sprout::swap(lst1, other.lst1))
@ -186,7 +186,7 @@ namespace sprout {
// swap
//
template<typename LIterator, typename RIterator, typename Compare>
inline void
inline SPROUT_CXX14_CONSTEXPR void
swap(
sprout::set_difference_iterator<LIterator, RIterator, Compare>& lhs,
sprout::set_difference_iterator<LIterator, RIterator, Compare>& rhs

View file

@ -86,7 +86,7 @@ namespace sprout {
, comp(it.compare())
{}
template<typename U, typename V, typename W>
set_intersection_iterator& operator=(set_intersection_iterator<U, V, W> const& it) {
SPROUT_CXX14_CONSTEXPR set_intersection_iterator& operator=(set_intersection_iterator<U, V, W> const& it) {
set_intersection_iterator temp(it);
temp.swap(*this);
return *this;
@ -115,11 +115,11 @@ namespace sprout {
SPROUT_CONSTEXPR pointer operator->() const {
return &*(*this);
}
set_intersection_iterator& operator++() {
SPROUT_CXX14_CONSTEXPR set_intersection_iterator& operator++() {
current = sprout::next_intersection(current.first, lst1, current.second, lst2, comp);
return *this;
}
set_intersection_iterator operator++(int) {
SPROUT_CXX14_CONSTEXPR set_intersection_iterator operator++(int) {
set_intersection_iterator result(*this);
current = sprout::next_intersection(current.first, lst1, current.second, lst2, comp);
return result;
@ -130,7 +130,7 @@ namespace sprout {
sprout::next_intersection(current.first, lst1, current.second, lst2, comp)
);
}
void swap(set_intersection_iterator& other)
SPROUT_CXX14_CONSTEXPR 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))
@ -186,7 +186,7 @@ namespace sprout {
// swap
//
template<typename LIterator, typename RIterator, typename Compare>
inline void
inline SPROUT_CXX14_CONSTEXPR void
swap(
sprout::set_intersection_iterator<LIterator, RIterator, Compare>& lhs,
sprout::set_intersection_iterator<LIterator, RIterator, Compare>& rhs

View file

@ -151,7 +151,7 @@ namespace sprout {
: impl_type(pair_type(it.base(), it.base2()), it.last1(), it.last2(), it.compare(), it.is_in_left())
{}
template<typename U, typename V, typename W>
set_symmetric_difference_iterator& operator=(set_symmetric_difference_iterator<U, V, W> const& it) {
SPROUT_CXX14_CONSTEXPR set_symmetric_difference_iterator& operator=(set_symmetric_difference_iterator<U, V, W> const& it) {
set_symmetric_difference_iterator temp(it);
temp.swap(*this);
return *this;
@ -180,12 +180,12 @@ namespace sprout {
SPROUT_CONSTEXPR pointer operator->() const {
return &*(*this);
}
set_symmetric_difference_iterator& operator++() {
SPROUT_CXX14_CONSTEXPR set_symmetric_difference_iterator& operator++() {
current = sprout::next_symmetric_difference(current.first, lst1, current.second, lst2, comp);
in_left = check_in_left(current.first, lst1, current.second, lst2, comp);
return *this;
}
set_symmetric_difference_iterator operator++(int) {
SPROUT_CXX14_CONSTEXPR set_symmetric_difference_iterator operator++(int) {
set_symmetric_difference_iterator result(*this);
current = sprout::next_symmetric_difference(current.first, lst1, current.second, lst2, comp);
in_left = check_in_left(current.first, lst1, current.second, lst2, comp);
@ -197,7 +197,7 @@ namespace sprout {
sprout::next_symmetric_difference(current.first, lst1, current.second, lst2, comp)
);
}
void swap(set_symmetric_difference_iterator& other)
SPROUT_CXX14_CONSTEXPR void swap(set_symmetric_difference_iterator& other)
SPROUT_NOEXCEPT_EXPR(
SPROUT_NOEXCEPT_EXPR(sprout::swap(current, other.current))
&& SPROUT_NOEXCEPT_EXPR(sprout::swap(lst1, other.lst1))
@ -254,7 +254,7 @@ namespace sprout {
// swap
//
template<typename LIterator, typename RIterator, typename Compare>
inline void
inline SPROUT_CXX14_CONSTEXPR void
swap(
sprout::set_symmetric_difference_iterator<LIterator, RIterator, Compare>& lhs,
sprout::set_symmetric_difference_iterator<LIterator, RIterator, Compare>& rhs

View file

@ -101,7 +101,7 @@ namespace sprout {
, in_left(it.is_in_left())
{}
template<typename U, typename V, typename W>
set_union_iterator& operator=(set_union_iterator<U, V, W> const& it) {
SPROUT_CXX14_CONSTEXPR set_union_iterator& operator=(set_union_iterator<U, V, W> const& it) {
set_union_iterator temp(it);
temp.swap(*this);
return *this;
@ -130,12 +130,12 @@ namespace sprout {
SPROUT_CONSTEXPR pointer operator->() const {
return &*(*this);
}
set_union_iterator& operator++() {
SPROUT_CXX14_CONSTEXPR set_union_iterator& operator++() {
current = sprout::next_union(current.first, lst1, current.second, lst2, comp);
in_left = check_in_left(current.first, lst1, current.second, lst2, comp);
return *this;
}
set_union_iterator operator++(int) {
SPROUT_CXX14_CONSTEXPR set_union_iterator operator++(int) {
set_union_iterator result(*this);
current = sprout::next_union(current.first, lst1, current.second, lst2, comp);
in_left = check_in_left(current.first, lst1, current.second, lst2, comp);
@ -147,7 +147,7 @@ namespace sprout {
sprout::next_union(current.first, lst1, current.second, lst2, comp)
);
}
void swap(set_union_iterator& other)
SPROUT_CXX14_CONSTEXPR void swap(set_union_iterator& other)
SPROUT_NOEXCEPT_EXPR(
SPROUT_NOEXCEPT_EXPR(sprout::swap(current, other.current))
&& SPROUT_NOEXCEPT_EXPR(sprout::swap(lst1, other.lst1))
@ -204,7 +204,7 @@ namespace sprout {
// swap
//
template<typename LIterator, typename RIterator, typename Compare>
inline void
inline SPROUT_CXX14_CONSTEXPR void
swap(
sprout::set_union_iterator<LIterator, RIterator, Compare>& lhs,
sprout::set_union_iterator<LIterator, RIterator, Compare>& rhs

View file

@ -84,7 +84,7 @@ namespace sprout {
, d_(it.d_)
{}
template<typename U>
sinusoid_iterator& operator=(sinusoid_iterator<U> const& it) {
SPROUT_CXX14_CONSTEXPR sinusoid_iterator& operator=(sinusoid_iterator<U> const& it) {
sinusoid_iterator temp(it);
temp.swap(*this);
return *this;
@ -110,20 +110,20 @@ namespace sprout {
SPROUT_CONSTEXPR pointer operator->() const {
return &operator*()();
}
sinusoid_iterator& operator++() {
SPROUT_CXX14_CONSTEXPR sinusoid_iterator& operator++() {
++index_;
return *this;
}
sinusoid_iterator operator++(int) {
SPROUT_CXX14_CONSTEXPR sinusoid_iterator operator++(int) {
sinusoid_iterator result(*this);
++index_;
return result;
}
sinusoid_iterator& operator--() {
SPROUT_CXX14_CONSTEXPR sinusoid_iterator& operator--() {
--index_;
return *this;
}
sinusoid_iterator operator--(int) {
SPROUT_CXX14_CONSTEXPR sinusoid_iterator operator--(int) {
sinusoid_iterator temp(*this);
--index_;
return temp;
@ -134,12 +134,12 @@ namespace sprout {
SPROUT_CONSTEXPR sinusoid_iterator operator-(difference_type n) const {
return sinusoid_iterator(*this, index_ - n);
}
sinusoid_iterator& operator+=(difference_type n) {
SPROUT_CXX14_CONSTEXPR sinusoid_iterator& operator+=(difference_type n) {
sinusoid_iterator temp(*this, index_ + n);
temp.swap(*this);
return *this;
}
sinusoid_iterator& operator-=(difference_type n) {
SPROUT_CXX14_CONSTEXPR sinusoid_iterator& operator-=(difference_type n) {
sinusoid_iterator temp(*this, index_ - n);
temp.swap(*this);
return *this;
@ -156,7 +156,7 @@ namespace sprout {
SPROUT_CONSTEXPR sinusoid_iterator prev() const {
return sinusoid_iterator(*this, index_ - 1);
}
void swap(sinusoid_iterator& other) SPROUT_NOEXCEPT {
SPROUT_CXX14_CONSTEXPR void swap(sinusoid_iterator& other) SPROUT_NOEXCEPT {
sprout::swap(index_, other.index_);
sprout::swap(frequency_, other.frequency_);
sprout::swap(amplitude_, other.amplitude_);
@ -210,7 +210,7 @@ namespace sprout {
// swap
//
template<typename Value>
inline void
inline SPROUT_CXX14_CONSTEXPR void
swap(sprout::sinusoid_iterator<Value>& lhs, sprout::sinusoid_iterator<Value>& rhs)
SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs)))
{

View file

@ -50,7 +50,9 @@ namespace sprout {
protected:
iterator_type current;
public:
size_enum_iterator() = default;
SPROUT_CONSTEXPR size_enum_iterator()
: current()
{}
size_enum_iterator(size_enum_iterator const&) = default;
explicit SPROUT_CONSTEXPR size_enum_iterator(iterator_type it)
: current(it)
@ -60,7 +62,7 @@ namespace sprout {
: current(it.current)
{}
template<typename U>
size_enum_iterator& operator=(size_enum_iterator<U> const& it) {
SPROUT_CXX14_CONSTEXPR size_enum_iterator& operator=(size_enum_iterator<U> const& it) {
size_enum_iterator temp(it);
temp.swap(*this);
return *this;
@ -77,20 +79,20 @@ namespace sprout {
SPROUT_CONSTEXPR pointer operator->() const {
return &sprout::size(*current);
}
size_enum_iterator& operator++() {
SPROUT_CXX14_CONSTEXPR size_enum_iterator& operator++() {
++current;
return *this;
}
size_enum_iterator operator++(int) {
SPROUT_CXX14_CONSTEXPR size_enum_iterator operator++(int) {
size_enum_iterator result(*this);
++current;
return result;
}
size_enum_iterator& operator--() {
SPROUT_CXX14_CONSTEXPR size_enum_iterator& operator--() {
--current;
return *this;
}
size_enum_iterator operator--(int) {
SPROUT_CXX14_CONSTEXPR size_enum_iterator operator--(int) {
size_enum_iterator temp(*this);
--current;
return temp;
@ -101,12 +103,12 @@ namespace sprout {
SPROUT_CONSTEXPR size_enum_iterator operator-(difference_type n) const {
return size_enum_iterator(current - n);
}
size_enum_iterator& operator+=(difference_type n) {
SPROUT_CXX14_CONSTEXPR size_enum_iterator& operator+=(difference_type n) {
size_enum_iterator temp(current + n);
temp.swap(*this);
return *this;
}
size_enum_iterator& operator-=(difference_type n) {
SPROUT_CXX14_CONSTEXPR size_enum_iterator& operator-=(difference_type n) {
size_enum_iterator temp(current - n);
temp.swap(*this);
return *this;
@ -120,7 +122,7 @@ namespace sprout {
SPROUT_CONSTEXPR size_enum_iterator prev() const {
return size_enum_iterator(sprout::prev(current));
}
void swap(size_enum_iterator& other)
SPROUT_CXX14_CONSTEXPR void swap(size_enum_iterator& other)
SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::swap(current, other.current)))
{
sprout::swap(current, other.current);
@ -160,7 +162,9 @@ namespace sprout {
value_type sep_size;
bool is_sep;
public:
size_enum_iterator() = default;
SPROUT_CONSTEXPR size_enum_iterator()
: current(), sep_size(), is_sep()
{}
size_enum_iterator(size_enum_iterator const&) = default;
explicit SPROUT_CONSTEXPR size_enum_iterator(iterator_type it, value_type size = 0, bool sep = false)
: current(it)
@ -194,7 +198,7 @@ namespace sprout {
SPROUT_CONSTEXPR pointer operator->() const {
return &(is_sep ? sep_size : sprout::size(*current));
}
size_enum_iterator& operator++() {
SPROUT_CXX14_CONSTEXPR size_enum_iterator& operator++() {
if (is_sep) {
++current;
is_sep = false;
@ -203,7 +207,7 @@ namespace sprout {
}
return *this;
}
size_enum_iterator operator++(int) {
SPROUT_CXX14_CONSTEXPR size_enum_iterator operator++(int) {
size_enum_iterator result(*this);
if (is_sep) {
++current;
@ -213,7 +217,7 @@ namespace sprout {
}
return result;
}
size_enum_iterator& operator--() {
SPROUT_CXX14_CONSTEXPR size_enum_iterator& operator--() {
if (is_sep) {
is_sep = false;
} else {
@ -222,7 +226,7 @@ namespace sprout {
}
return *this;
}
size_enum_iterator operator--(int) {
SPROUT_CXX14_CONSTEXPR size_enum_iterator operator--(int) {
size_enum_iterator temp(*this);
if (is_sep) {
is_sep = false;
@ -238,12 +242,12 @@ namespace sprout {
SPROUT_CONSTEXPR size_enum_iterator operator-(difference_type n) const {
return size_enum_iterator(current - (n - is_sep) / 2, sep_size, (n - is_sep) % 2);
}
size_enum_iterator& operator+=(difference_type n) {
SPROUT_CXX14_CONSTEXPR size_enum_iterator& operator+=(difference_type n) {
size_enum_iterator temp(current + (n + is_sep) / 2, sep_size, (n + is_sep) % 2);
temp.swap(*this);
return *this;
}
size_enum_iterator& operator-=(difference_type n) {
SPROUT_CXX14_CONSTEXPR size_enum_iterator& operator-=(difference_type n) {
size_enum_iterator temp(current - (n - is_sep) / 2, sep_size, (n - is_sep) % 2);
temp.swap(*this);
return *this;
@ -263,7 +267,7 @@ namespace sprout {
: size_enum_iterator(sprout::prev(current), sep_size, true)
;
}
void swap(size_enum_iterator& other)
SPROUT_CXX14_CONSTEXPR void swap(size_enum_iterator& other)
SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::swap(current, other.current)))
{
sprout::swap(current, other.current);
@ -402,7 +406,8 @@ namespace sprout {
// swap
//
template<typename Iterator, bool Separated>
void swap(sprout::size_enum_iterator<Iterator, Separated>& lhs, sprout::size_enum_iterator<Iterator, Separated>& rhs)
inline SPROUT_CXX14_CONSTEXPR void
swap(sprout::size_enum_iterator<Iterator, Separated>& lhs, sprout::size_enum_iterator<Iterator, Separated>& rhs)
SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs)))
{
lhs.swap(rhs);

View file

@ -84,7 +84,7 @@ namespace sprout {
, duty_(it.duty_)
{}
template<typename U>
square_iterator& operator=(square_iterator<U> const& it) {
SPROUT_CXX14_CONSTEXPR square_iterator& operator=(square_iterator<U> const& it) {
square_iterator temp(it);
temp.swap(*this);
return *this;
@ -112,20 +112,20 @@ namespace sprout {
SPROUT_CONSTEXPR pointer operator->() const {
return &operator*()();
}
square_iterator& operator++() {
SPROUT_CXX14_CONSTEXPR square_iterator& operator++() {
++index_;
return *this;
}
square_iterator operator++(int) {
SPROUT_CXX14_CONSTEXPR square_iterator operator++(int) {
square_iterator result(*this);
++index_;
return result;
}
square_iterator& operator--() {
SPROUT_CXX14_CONSTEXPR square_iterator& operator--() {
--index_;
return *this;
}
square_iterator operator--(int) {
SPROUT_CXX14_CONSTEXPR square_iterator operator--(int) {
square_iterator temp(*this);
--index_;
return temp;
@ -136,12 +136,12 @@ namespace sprout {
SPROUT_CONSTEXPR square_iterator operator-(difference_type n) const {
return square_iterator(*this, index_ - n);
}
square_iterator& operator+=(difference_type n) {
SPROUT_CXX14_CONSTEXPR square_iterator& operator+=(difference_type n) {
square_iterator temp(*this, index_ + n);
temp.swap(*this);
return *this;
}
square_iterator& operator-=(difference_type n) {
SPROUT_CXX14_CONSTEXPR square_iterator& operator-=(difference_type n) {
square_iterator temp(*this, index_ - n);
temp.swap(*this);
return *this;
@ -157,7 +157,7 @@ namespace sprout {
SPROUT_CONSTEXPR square_iterator prev() const {
return square_iterator(*this, index_ - 1);
}
void swap(square_iterator& other) SPROUT_NOEXCEPT {
SPROUT_CXX14_CONSTEXPR void swap(square_iterator& other) SPROUT_NOEXCEPT {
sprout::swap(index_, other.index_);
sprout::swap(frequency_, other.frequency_);
sprout::swap(amplitude_, other.amplitude_);
@ -211,7 +211,7 @@ namespace sprout {
// swap
//
template<typename Value>
inline void
inline SPROUT_CXX14_CONSTEXPR void
swap(sprout::square_iterator<Value>& lhs, sprout::square_iterator<Value>& rhs)
SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs)))
{

View file

@ -79,7 +79,7 @@ namespace sprout {
, back(get_back(it.base(), it.width(), it.end())), is_last(it.is_end())
{}
template<typename U>
step_iterator& operator=(step_iterator<U> const& it) {
SPROUT_CXX14_CONSTEXPR step_iterator& operator=(step_iterator<U> const& it) {
step_iterator temp(it);
temp.swap(*this);
return *this;
@ -102,14 +102,14 @@ namespace sprout {
SPROUT_CONSTEXPR pointer operator->() const {
return &*current;
}
step_iterator& operator++() {
SPROUT_CXX14_CONSTEXPR step_iterator& operator++() {
if (current == back) {
is_last = true;
}
current += next_distance(*this, 1);
return *this;
}
step_iterator operator++(int) {
SPROUT_CXX14_CONSTEXPR step_iterator operator++(int) {
step_iterator result(*this);
if (current == back) {
is_last = true;
@ -117,14 +117,14 @@ namespace sprout {
current += next_distance(*this, 1);
return result;
}
step_iterator& operator--() {
SPROUT_CXX14_CONSTEXPR step_iterator& operator--() {
current += next_distance(*this, -1);
if (current != back) {
is_last = false;
}
return *this;
}
step_iterator operator--(int) {
SPROUT_CXX14_CONSTEXPR step_iterator operator--(int) {
step_iterator temp(*this);
current += next_distance(*this, -1);
if (current != back) {
@ -138,12 +138,12 @@ namespace sprout {
SPROUT_CONSTEXPR step_iterator operator-(difference_type n) const {
return step_iterator(*this, -n);
}
step_iterator& operator+=(difference_type n) {
SPROUT_CXX14_CONSTEXPR step_iterator& operator+=(difference_type n) {
step_iterator temp(*this, n);
temp.swap(*this);
return *this;
}
step_iterator& operator-=(difference_type n) {
SPROUT_CXX14_CONSTEXPR step_iterator& operator-=(difference_type n) {
step_iterator temp(*this, -n);
temp.swap(*this);
return *this;
@ -157,7 +157,7 @@ namespace sprout {
SPROUT_CONSTEXPR step_iterator prev() const {
return step_iterator(*this, -1);
}
void swap(step_iterator& other)
SPROUT_CXX14_CONSTEXPR void swap(step_iterator& other)
SPROUT_NOEXCEPT_EXPR(
SPROUT_NOEXCEPT_EXPR(swap(current, other.current))
&& SPROUT_NOEXCEPT_EXPR(swap(last, other.last))
@ -233,7 +233,7 @@ namespace sprout {
// swap
//
template<typename Iterator>
inline void
inline SPROUT_CXX14_CONSTEXPR void
swap(sprout::step_iterator<Iterator>& lhs, sprout::step_iterator<Iterator>& rhs)
SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs)))
{

View file

@ -70,7 +70,9 @@ namespace sprout {
iterator2_type current2;
BinaryFunction func;
public:
transform_iterator() = default;
SPROUT_CONSTEXPR transform_iterator()
: current(), current2(), func()
{}
transform_iterator(transform_iterator const&) = default;
SPROUT_CONSTEXPR transform_iterator(iterator_type it, iterator2_type it2)
: current(it)
@ -88,7 +90,7 @@ namespace sprout {
, func(it.func)
{}
template<typename U, typename V, typename W>
transform_iterator& operator=(transform_iterator<U, V, W> const& it) {
SPROUT_CXX14_CONSTEXPR transform_iterator& operator=(transform_iterator<U, V, W> const& it) {
transform_iterator temp(it);
temp.swap(*this);
return *this;
@ -108,23 +110,23 @@ namespace sprout {
SPROUT_CONSTEXPR pointer operator->() const {
return &func(*current, *current2);
}
transform_iterator& operator++() {
SPROUT_CXX14_CONSTEXPR transform_iterator& operator++() {
++current;
++current2;
return *this;
}
transform_iterator operator++(int) {
SPROUT_CXX14_CONSTEXPR transform_iterator operator++(int) {
transform_iterator result(*this);
++current;
++current2;
return result;
}
transform_iterator& operator--() {
SPROUT_CXX14_CONSTEXPR transform_iterator& operator--() {
--current;
--current2;
return *this;
}
transform_iterator operator--(int) {
SPROUT_CXX14_CONSTEXPR transform_iterator operator--(int) {
transform_iterator temp(*this);
--current;
--current2;
@ -136,12 +138,12 @@ namespace sprout {
SPROUT_CONSTEXPR transform_iterator operator-(difference_type n) const {
return transform_iterator(current - n, current2 - n, func);
}
transform_iterator& operator+=(difference_type n) {
SPROUT_CXX14_CONSTEXPR transform_iterator& operator+=(difference_type n) {
transform_iterator temp(current + n, current2 + n, func);
temp.swap(*this);
return *this;
}
transform_iterator& operator-=(difference_type n) {
SPROUT_CXX14_CONSTEXPR transform_iterator& operator-=(difference_type n) {
transform_iterator temp(current - n, current2 - n, func);
temp.swap(*this);
return *this;
@ -155,7 +157,7 @@ namespace sprout {
SPROUT_CONSTEXPR transform_iterator prev() const {
return transform_iterator(sprout::prev(current), sprout::prev(current2), func);
}
void swap(transform_iterator& other)
SPROUT_CXX14_CONSTEXPR void swap(transform_iterator& other)
SPROUT_NOEXCEPT_EXPR(
SPROUT_NOEXCEPT_EXPR(sprout::swap(current, other.current))
&& SPROUT_NOEXCEPT_EXPR(sprout::swap(current2, other.current2))
@ -205,7 +207,9 @@ namespace sprout {
iterator_type current;
UnaryFunction func;
public:
transform_iterator() = default;
SPROUT_CONSTEXPR transform_iterator()
: current(), func()
{}
transform_iterator(transform_iterator const&) = default;
explicit SPROUT_CONSTEXPR transform_iterator(iterator_type it)
: current(it)
@ -220,7 +224,7 @@ namespace sprout {
, func(it.func)
{}
template<typename U, typename V>
transform_iterator& operator=(transform_iterator<U, V> const& it) {
SPROUT_CXX14_CONSTEXPR transform_iterator& operator=(transform_iterator<U, V> const& it) {
transform_iterator temp(it);
temp.swap(*this);
return *this;
@ -237,20 +241,20 @@ namespace sprout {
SPROUT_CONSTEXPR pointer operator->() const {
return &func(*current);
}
transform_iterator& operator++() {
SPROUT_CXX14_CONSTEXPR transform_iterator& operator++() {
++current;
return *this;
}
transform_iterator operator++(int) {
SPROUT_CXX14_CONSTEXPR transform_iterator operator++(int) {
transform_iterator result(*this);
++current;
return result;
}
transform_iterator& operator--() {
SPROUT_CXX14_CONSTEXPR transform_iterator& operator--() {
--current;
return *this;
}
transform_iterator operator--(int) {
SPROUT_CXX14_CONSTEXPR transform_iterator operator--(int) {
transform_iterator temp(*this);
--current;
return temp;
@ -261,12 +265,12 @@ namespace sprout {
SPROUT_CONSTEXPR transform_iterator operator-(difference_type n) const {
return transform_iterator(current - n, func);
}
transform_iterator& operator+=(difference_type n) {
SPROUT_CXX14_CONSTEXPR transform_iterator& operator+=(difference_type n) {
transform_iterator temp(current + n, func);
temp.swap(*this);
return *this;
}
transform_iterator& operator-=(difference_type n) {
SPROUT_CXX14_CONSTEXPR transform_iterator& operator-=(difference_type n) {
transform_iterator temp(current - n, func);
temp.swap(*this);
return *this;
@ -280,7 +284,7 @@ namespace sprout {
SPROUT_CONSTEXPR transform_iterator prev() const {
return transform_iterator(sprout::prev(current), func);
}
void swap(transform_iterator& other)
SPROUT_CXX14_CONSTEXPR void swap(transform_iterator& other)
SPROUT_NOEXCEPT_EXPR(
SPROUT_NOEXCEPT_EXPR(sprout::swap(current, other.current))
&& SPROUT_NOEXCEPT_EXPR(sprout::swap(func, other.func))
@ -395,7 +399,7 @@ namespace sprout {
// swap
//
template<typename UnaryOrBinaryFunction, typename LIterator, typename RIterator>
inline void
inline SPROUT_CXX14_CONSTEXPR void
swap(
sprout::transform_iterator<UnaryOrBinaryFunction, LIterator, RIterator>& lhs,
sprout::transform_iterator<UnaryOrBinaryFunction, LIterator, RIterator>& rhs

View file

@ -78,7 +78,7 @@ namespace sprout {
, phase_(it.phase_)
{}
template<typename U>
triangle_iterator& operator=(triangle_iterator<U> const& it) {
SPROUT_CXX14_CONSTEXPR triangle_iterator& operator=(triangle_iterator<U> const& it) {
triangle_iterator temp(it);
temp.swap(*this);
return *this;
@ -103,20 +103,20 @@ namespace sprout {
SPROUT_CONSTEXPR pointer operator->() const {
return &operator*()();
}
triangle_iterator& operator++() {
SPROUT_CXX14_CONSTEXPR triangle_iterator& operator++() {
++index_;
return *this;
}
triangle_iterator operator++(int) {
SPROUT_CXX14_CONSTEXPR triangle_iterator operator++(int) {
triangle_iterator result(*this);
++index_;
return result;
}
triangle_iterator& operator--() {
SPROUT_CXX14_CONSTEXPR triangle_iterator& operator--() {
--index_;
return *this;
}
triangle_iterator operator--(int) {
SPROUT_CXX14_CONSTEXPR triangle_iterator operator--(int) {
triangle_iterator temp(*this);
--index_;
return temp;
@ -127,12 +127,12 @@ namespace sprout {
SPROUT_CONSTEXPR triangle_iterator operator-(difference_type n) const {
return triangle_iterator(*this, index_ - n);
}
triangle_iterator& operator+=(difference_type n) {
SPROUT_CXX14_CONSTEXPR triangle_iterator& operator+=(difference_type n) {
triangle_iterator temp(*this, index_ + n);
temp.swap(*this);
return *this;
}
triangle_iterator& operator-=(difference_type n) {
SPROUT_CXX14_CONSTEXPR triangle_iterator& operator-=(difference_type n) {
triangle_iterator temp(*this, index_ - n);
temp.swap(*this);
return *this;
@ -148,7 +148,7 @@ namespace sprout {
SPROUT_CONSTEXPR triangle_iterator prev() const {
return triangle_iterator(*this, index_ - 1);
}
void swap(triangle_iterator& other) SPROUT_NOEXCEPT {
SPROUT_CXX14_CONSTEXPR void swap(triangle_iterator& other) SPROUT_NOEXCEPT {
sprout::swap(index_, other.index_);
sprout::swap(frequency_, other.frequency_);
sprout::swap(amplitude_, other.amplitude_);
@ -225,7 +225,7 @@ namespace sprout {
// swap
//
template<typename Value>
inline void
inline SPROUT_CXX14_CONSTEXPR void
swap(sprout::triangle_iterator<Value>& lhs, sprout::triangle_iterator<Value>& rhs)
SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs)))
{

View file

@ -46,7 +46,9 @@ namespace sprout {
iterator_type current;
holder_type holder;
public:
valued_iterator() = default;
SPROUT_CONSTEXPR valued_iterator()
: current(), holder()
{}
SPROUT_CONSTEXPR valued_iterator(valued_iterator const& other)
: current(other.current)
, holder(other.holder)
@ -69,7 +71,7 @@ namespace sprout {
, holder(it.get())
{}
template<typename U, typename V>
valued_iterator& operator=(valued_iterator<U, V> const& it) {
SPROUT_CXX14_CONSTEXPR valued_iterator& operator=(valued_iterator<U, V> const& it) {
valued_iterator temp(it);
temp.swap(*this);
return *this;
@ -86,20 +88,20 @@ namespace sprout {
SPROUT_CONSTEXPR pointer operator->() const {
return &*current;
}
valued_iterator& operator++() {
SPROUT_CXX14_CONSTEXPR valued_iterator& operator++() {
++current;
return *this;
}
valued_iterator operator++(int) {
SPROUT_CXX14_CONSTEXPR valued_iterator operator++(int) {
valued_iterator result(*this);
++current;
return result;
}
valued_iterator& operator--() {
SPROUT_CXX14_CONSTEXPR valued_iterator& operator--() {
--current;
return *this;
}
valued_iterator operator--(int) {
SPROUT_CXX14_CONSTEXPR valued_iterator operator--(int) {
valued_iterator temp(*this);
--current;
return temp;
@ -110,12 +112,12 @@ namespace sprout {
SPROUT_CONSTEXPR valued_iterator operator-(difference_type n) const {
return valued_iterator(current - n, holder);
}
valued_iterator& operator+=(difference_type n) {
SPROUT_CXX14_CONSTEXPR valued_iterator& operator+=(difference_type n) {
valued_iterator temp(current + n, holder);
temp.swap(*this);
return *this;
}
valued_iterator& operator-=(difference_type n) {
SPROUT_CXX14_CONSTEXPR valued_iterator& operator-=(difference_type n) {
valued_iterator temp(current - n, holder);
temp.swap(*this);
return *this;
@ -129,7 +131,7 @@ namespace sprout {
SPROUT_CONSTEXPR valued_iterator prev() const {
return valued_iterator(sprout::prev(current), holder);
}
void swap(valued_iterator& other)
SPROUT_CXX14_CONSTEXPR void swap(valued_iterator& other)
SPROUT_NOEXCEPT_EXPR(
SPROUT_NOEXCEPT_EXPR(swap(current, other.current))
&& SPROUT_NOEXCEPT_EXPR(swap(holder, other.holder))
@ -198,7 +200,7 @@ namespace sprout {
// swap
//
template<typename Iterator, typename T>
inline void
inline SPROUT_CXX14_CONSTEXPR void
swap(sprout::valued_iterator<Iterator, T>& lhs, sprout::valued_iterator<Iterator, T>& rhs)
SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs)))
{

View file

@ -64,12 +64,12 @@ namespace sprout {
iterator_type last;
Predicate pred;
private:
void satisfy_predicate() {
SPROUT_CXX14_CONSTEXPR void satisfy_predicate() {
if (!pred(*current)) {
current = last;
}
}
void satisfy_predicate_backward() {
SPROUT_CXX14_CONSTEXPR void satisfy_predicate_backward() {
while (!pred(*current)) {
--current;
}
@ -80,7 +80,9 @@ namespace sprout {
, pred(pred)
{}
public:
while_iterator() = default;
SPROUT_CONSTEXPR while_iterator()
: current(), last(), pred()
{}
while_iterator(while_iterator const&) = default;
SPROUT_CONSTEXPR while_iterator(Predicate pred, iterator_type it, iterator_type last = iterator_type())
: current(find_next(it, last, pred))
@ -94,7 +96,7 @@ namespace sprout {
, pred(it.pred)
{}
template<typename U>
while_iterator& operator=(while_iterator<Predicate, U> const& it) {
SPROUT_CXX14_CONSTEXPR while_iterator& operator=(while_iterator<Predicate, U> const& it) {
while_iterator temp(it);
temp.swap(*this);
return *this;
@ -115,23 +117,23 @@ namespace sprout {
return &*current;
}
while_iterator& operator++() {
SPROUT_CXX14_CONSTEXPR while_iterator& operator++() {
++current;
satisfy_predicate();
return *this;
}
while_iterator operator++(int) {
SPROUT_CXX14_CONSTEXPR while_iterator operator++(int) {
while_iterator result(*this);
++current;
satisfy_predicate();
return result;
}
while_iterator& operator--() {
SPROUT_CXX14_CONSTEXPR while_iterator& operator--() {
--current;
satisfy_predicate_backward();
return *this;
}
while_iterator operator--(int) {
SPROUT_CXX14_CONSTEXPR while_iterator operator--(int) {
while_iterator temp(*this);
--current;
satisfy_predicate_backward();
@ -143,7 +145,7 @@ namespace sprout {
SPROUT_CONSTEXPR while_iterator prev() const {
return while_iterator(pred, find_prev(sprout::prev(current), pred), last, private_construct_t());
}
void swap(while_iterator& other)
SPROUT_CXX14_CONSTEXPR void swap(while_iterator& other)
SPROUT_NOEXCEPT_EXPR(
SPROUT_NOEXCEPT_EXPR(sprout::swap(current, other.current))
&& SPROUT_NOEXCEPT_EXPR(sprout::swap(last, other.last))
@ -186,7 +188,7 @@ namespace sprout {
// swap
//
template<typename Predicate, typename Iterator>
inline void
inline SPROUT_CXX14_CONSTEXPR void
swap(sprout::while_iterator<Predicate, Iterator>& lhs, sprout::while_iterator<Predicate, Iterator>& rhs)
SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs)))
{