fix for constexpr disabled

add sprout::adaptors::sized
This commit is contained in:
bolero-MURAKAMI 2012-06-16 00:08:42 +09:00
parent 2b8a8662af
commit bcd7674cc0
84 changed files with 1758 additions and 1365 deletions

View file

@ -142,13 +142,13 @@ namespace sprout {
}
bytes_iterator& operator+=(difference_type n) {
bytes_iterator temp(it_, i_ + n, ra_tag());
temp.swap(this);
return this;
temp.swap(*this);
return *this;
}
bytes_iterator& operator-=(difference_type n) {
bytes_iterator temp(it_, i_ - n, ra_tag());
temp.swap(this);
return this;
temp.swap(*this);
return *this;
}
SPROUT_CONSTEXPR reference operator[](difference_type n) const {
return *(*this + n);
@ -207,6 +207,19 @@ namespace sprout {
return it - n;
}
//
// distance
//
template<typename Iterator, typename Traits>
SPROUT_CONSTEXPR typename std::iterator_traits<sprout::bytes_iterator<Iterator, Traits> >::difference_type
distance(
sprout::bytes_iterator<Iterator, Traits> first,
sprout::bytes_iterator<Iterator, Traits> last
)
{
return last - first;
}
//
// make_bytes_iterator
//