diff --git a/sprout/iterator/joint_iterator.hpp b/sprout/iterator/joint_iterator.hpp index 1fd636fb..79808cd9 100644 --- a/sprout/iterator/joint_iterator.hpp +++ b/sprout/iterator/joint_iterator.hpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT @@ -266,8 +267,8 @@ namespace sprout { { return lhs.is_in_left() && rhs.is_in_left() ? rhs.base() - lhs.base() : !lhs.is_in_left() && !rhs.is_in_left() ? rhs.base2() - lhs.base2() - : lhs.is_in_left() ? (lhs.left_end() - lhs.base()) + (rhs.base2() - rhs.right_begin()) - : (lhs.base2() - lhs.right_begin()) + (rhs.left_end() - rhs.base()) + : lhs.is_in_left() ? sprout::limited::plus(lhs.left_end() - lhs.base(), rhs.base2() - rhs.right_begin()) + : sprout::limited::plus(lhs.base2() - lhs.right_begin(), rhs.left_end() - rhs.base()) ; } template diff --git a/sprout/range/adaptor/alternated.hpp b/sprout/range/adaptor/alternated.hpp index 2a22792c..7f119b7e 100644 --- a/sprout/range/adaptor/alternated.hpp +++ b/sprout/range/adaptor/alternated.hpp @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include #include @@ -23,29 +23,29 @@ namespace sprout { // template class alternated_range - : public sprout::range::range_container< + : public sprout::adaptors::detail::jointed_range_default< + LRange, RRange, sprout::alternate_iterator< typename sprout::container_traits::iterator, typename sprout::container_traits::iterator > > - , public sprout::detail::container_nosy_static_size - , public sprout::detail::container_nosy_fixed_size { public: - typedef LRange range_type; - typedef RRange range2_type; - typedef sprout::range::range_container< + typedef sprout::adaptors::detail::jointed_range_default< + LRange, RRange, sprout::alternate_iterator< typename sprout::container_traits::iterator, typename sprout::container_traits::iterator > > base_type; + typedef typename base_type::range1_type range1_type; + typedef typename base_type::range2_type range2_type; typedef typename base_type::iterator iterator; public: alternated_range() = default; alternated_range(alternated_range const&) = default; - SPROUT_CONSTEXPR alternated_range(range_type& range1, range2_type& range2) + SPROUT_CONSTEXPR alternated_range(range1_type& range1, range2_type& range2) : base_type( iterator(sprout::begin(range1), sprout::begin(range2)), iterator( @@ -124,28 +124,9 @@ namespace sprout { // container_construct_traits // template - struct container_construct_traits > { - public: - typedef typename sprout::container_construct_traits::copied_type copied_type; - public: - template - static SPROUT_CONSTEXPR copied_type deep_copy(Cont&& cont) { - return sprout::range::fixed::copy(sprout::forward(cont), sprout::pit()); - } - template - static SPROUT_CONSTEXPR copied_type make(Args&&... args) { - return sprout::make(sprout::forward(args)...); - } - template - static SPROUT_CONSTEXPR copied_type remake( - Cont&& cont, - typename sprout::container_traits >::difference_type size, - Args&&... args - ) - { - return sprout::remake(sprout::forward(cont), size, sprout::forward(args)...); - } - }; + struct container_construct_traits > + : public sprout::container_construct_traits::base_type> + {}; } // namespace sprout #endif // #ifndef SPROUT_RANGE_ADAPTOR_ALTERNATED_HPP diff --git a/sprout/range/adaptor/blanked.hpp b/sprout/range/adaptor/blanked.hpp index d1776c53..35e0d0cf 100644 --- a/sprout/range/adaptor/blanked.hpp +++ b/sprout/range/adaptor/blanked.hpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -26,21 +27,20 @@ namespace sprout { // template class blanked_range - : public sprout::range::range_container< + : public sprout::adaptors::detail::adapted_range_default< + Range, sprout::value_iterator > - , public sprout::detail::container_nosy_static_size - , public sprout::detail::container_nosy_fixed_size { public: - typedef Range range_type; - typedef sprout::range::range_container< + typedef sprout::adaptors::detail::adapted_range_default< + Range, sprout::value_iterator > base_type; + typedef typename base_type::range_type range_type; typedef typename base_type::iterator iterator; typedef typename base_type::value_type value_type; typedef typename base_type::difference_type difference_type; - typedef typename base_type::size_type size_type; public: blanked_range() = default; blanked_range(blanked_range const&) = default; @@ -162,28 +162,9 @@ namespace sprout { // container_construct_traits // template - struct container_construct_traits > { - public: - typedef typename sprout::container_construct_traits::copied_type copied_type; - public: - template - static SPROUT_CONSTEXPR copied_type deep_copy(Cont&& cont) { - return sprout::range::fixed::copy(sprout::forward(cont), sprout::pit()); - } - template - static SPROUT_CONSTEXPR copied_type make(Args&&... args) { - return sprout::make(sprout::forward(args)...); - } - template - static SPROUT_CONSTEXPR copied_type remake( - Cont&& cont, - typename sprout::container_traits >::difference_type size, - Args&&... args - ) - { - return sprout::remake(sprout::forward(cont), size, sprout::forward(args)...); - } - }; + struct container_construct_traits > + : public sprout::container_construct_traits::base_type> + {}; } // namespace sprout #endif // #ifndef SPROUT_RANGE_ADAPTOR_BLANKED_HPP diff --git a/sprout/range/adaptor/counting.hpp b/sprout/range/adaptor/counting.hpp index c6217248..e22871ac 100644 --- a/sprout/range/adaptor/counting.hpp +++ b/sprout/range/adaptor/counting.hpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -20,20 +21,19 @@ namespace sprout { // template class counting_range - : public sprout::range::range_container< + : public sprout::adaptors::detail::adapted_range_default< + Range, sprout::counting_iterator > - , public sprout::detail::container_nosy_static_size - , public sprout::detail::container_nosy_fixed_size { public: - typedef Range range_type; - typedef sprout::range::range_container< + typedef sprout::adaptors::detail::adapted_range_default< + Range, sprout::counting_iterator > base_type; + typedef typename base_type::range_type range_type; typedef typename base_type::iterator iterator; typedef typename base_type::value_type value_type; - typedef typename base_type::difference_type difference_type; public: counting_range() = default; counting_range(counting_range const&) = default; @@ -77,7 +77,6 @@ namespace sprout { > base_type; typedef typename base_type::iterator iterator; typedef typename base_type::value_type value_type; - typedef typename base_type::difference_type difference_type; public: counting_range() = default; counting_range(counting_range const&) = default; @@ -146,28 +145,9 @@ namespace sprout { // container_construct_traits // template - struct container_construct_traits > { - public: - typedef typename sprout::container_construct_traits::copied_type copied_type; - public: - template - static SPROUT_CONSTEXPR copied_type deep_copy(Cont&& cont) { - return sprout::range::fixed::copy(sprout::forward(cont), sprout::pit()); - } - template - static SPROUT_CONSTEXPR copied_type make(Args&&... args) { - return sprout::make(sprout::forward(args)...); - } - template - static SPROUT_CONSTEXPR copied_type remake( - Cont&& cont, - typename sprout::container_traits >::difference_type size, - Args&&... args - ) - { - return sprout::remake(sprout::forward(cont), size, sprout::forward(args)...); - } - }; + struct container_construct_traits > + : public sprout::container_construct_traits::base_type> + {}; } // namespace sprout #endif // #ifndef SPROUT_RANGE_ADAPTOR_COUNTING_HPP diff --git a/sprout/range/adaptor/detail/jointed_range_default.hpp b/sprout/range/adaptor/detail/jointed_range_default.hpp new file mode 100644 index 00000000..90ed4c35 --- /dev/null +++ b/sprout/range/adaptor/detail/jointed_range_default.hpp @@ -0,0 +1,206 @@ +#ifndef SPROUT_RANGE_ADAPTOR_DETAIL_JOINTED_RANGE_DEFAULT_HPP +#define SPROUT_RANGE_ADAPTOR_DETAIL_JOINTED_RANGE_DEFAULT_HPP + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace sprout { + namespace adaptors { + namespace detail { + template + class jointed_range_size; + + template + class jointed_range_size< + LRange, RRange, + typename std::enable_if< + sprout::detail::has_static_size >::value + && sprout::detail::has_static_size >::value + >::type + > { + public: + typedef typename sprout::arithmetic_promote< + typename sprout::container_traits::size_type, + typename sprout::container_traits::size_type + >::type size_type; + SPROUT_STATIC_CONSTEXPR size_type static_size + = sprout::container_traits::static_size + sprout::container_traits::static_size + ; + static SPROUT_CONSTEXPR size_type fixed_size() { + return static_size; + } + }; + + template + class jointed_range_size< + LRange, RRange, + typename std::enable_if< + sprout::detail::has_static_size >::value + && !sprout::detail::has_static_size >::value + >::type + > { + public: + typedef typename sprout::container_traits::size_type size_type; + SPROUT_STATIC_CONSTEXPR size_type static_size = sprout::container_traits::static_size; + static SPROUT_CONSTEXPR size_type fixed_size() { + return static_size; + } + }; + template + SPROUT_CONSTEXPR_OR_CONST typename sprout::adaptors::detail::jointed_range_size< + LRange, RRange, + typename std::enable_if< + sprout::detail::has_static_size >::value + && !sprout::detail::has_static_size >::value + >::type + >::size_type + sprout::adaptors::detail::jointed_range_size< + LRange, RRange, + typename std::enable_if< + sprout::detail::has_static_size >::value + && !sprout::detail::has_static_size >::value + >::type + >::static_size; + + template + class jointed_range_size< + LRange, RRange, + typename std::enable_if< + !sprout::detail::has_static_size >::value + && sprout::detail::has_static_size >::value + >::type + > { + public: + typedef typename sprout::container_traits::size_type size_type; + SPROUT_STATIC_CONSTEXPR size_type static_size = sprout::container_traits::static_size; + static SPROUT_CONSTEXPR size_type fixed_size() { + return static_size; + } + }; + template + SPROUT_CONSTEXPR_OR_CONST typename sprout::adaptors::detail::jointed_range_size< + LRange, RRange, + typename std::enable_if< + !sprout::detail::has_static_size >::value + && sprout::detail::has_static_size >::value + >::type + >::size_type + sprout::adaptors::detail::jointed_range_size< + LRange, RRange, + typename std::enable_if< + !sprout::detail::has_static_size >::value + && sprout::detail::has_static_size >::value + >::type + >::static_size; + + template + class jointed_range_size< + LRange, RRange, + typename std::enable_if< + !sprout::detail::has_static_size >::value + && !sprout::detail::has_static_size >::value + >::type + > {}; + + template< + typename LRange, typename RRange, + typename Iterator = typename sprout::container_traits::iterator + > + class jointed_range_default + : public sprout::range::range_container + , public sprout::adaptors::detail::jointed_range_size + { + public: + typedef LRange range_type; + typedef LRange range1_type; + typedef RRange range2_type; + typedef sprout::range::range_container base_type; + typedef typename base_type::iterator iterator; + public: + jointed_range_default() = default; + jointed_range_default(jointed_range_default const&) = default; + explicit SPROUT_CONSTEXPR jointed_range_default(iterator const& first, iterator const& last) + : base_type(first, last) + {} + }; + + template + class jointed_range_copied_type; + + template + class jointed_range_copied_type< + LRange, RRange, + typename std::enable_if< + sprout::containers::is_rebindable_size::value + >::type + > { + public: + typedef typename sprout::containers::weak_rebind_size< + typename sprout::container_construct_traits::copied_type, + sprout::adaptors::detail::jointed_range_size::static_size + >::type copied_type; + }; + + template + class jointed_range_copied_type< + LRange, RRange, + typename std::enable_if< + !sprout::containers::is_rebindable_size::value && sprout::containers::is_rebindable_size::value + >::type + > { + public: + typedef typename sprout::containers::weak_rebind_size< + typename sprout::container_construct_traits::copied_type, + sprout::adaptors::detail::jointed_range_size::static_size + >::type type; + }; + + template + class jointed_range_copied_type< + LRange, RRange, + typename std::enable_if< + !sprout::containers::is_rebindable_size::value && !sprout::containers::is_rebindable_size::value + >::type + > { + public: + typedef typename sprout::container_construct_traits::copied_type type; + }; + } // namespace detail + } // namespace adaptors + + // + // container_construct_traits + // + template + struct container_construct_traits > { + public: + typedef typename sprout::adaptors::detail::jointed_range_copied_type::type copied_type; + public: + template + static SPROUT_CONSTEXPR copied_type deep_copy(Cont&& cont) { + return sprout::range::fixed::copy(sprout::forward(cont), sprout::pit()); + } + template + static SPROUT_CONSTEXPR copied_type make(Args&&... args) { + return sprout::make(sprout::forward(args)...); + } + template + static SPROUT_CONSTEXPR copied_type remake( + Cont&& cont, + typename sprout::container_traits >::difference_type size, + Args&&... args + ) + { + return sprout::remake(sprout::forward(cont), size, sprout::forward(args)...); + } + }; +} // namespace sprout + +#endif // #ifndef SPROUT_RANGE_ADAPTOR_DETAIL_JOINTED_RANGE_DEFAULT_HPP diff --git a/sprout/range/adaptor/detail/sized_range_default.hpp b/sprout/range/adaptor/detail/sized_range_default.hpp new file mode 100644 index 00000000..4074a8c4 --- /dev/null +++ b/sprout/range/adaptor/detail/sized_range_default.hpp @@ -0,0 +1,111 @@ +#ifndef SPROUT_RANGE_ADAPTOR_DETAIL_SIZED_RANGE_DEFAULT_HPP +#define SPROUT_RANGE_ADAPTOR_DETAIL_SIZED_RANGE_DEFAULT_HPP + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace sprout { + namespace adaptors { + namespace detail { + template::size_type Size, typename = void> + class sized_range_size; + + template::size_type Size> + class sized_range_size< + Range, Size, + typename std::enable_if >::value>::type + > { + public: + SPROUT_STATIC_CONSTEXPR typename sprout::container_traits::size_type static_size + = Size < sprout::container_traits::static_size ? Size + : sprout::container_traits::static_size + ; + static SPROUT_CONSTEXPR typename sprout::container_traits::size_type fixed_size() { + return static_size; + } + }; + template::size_type Size> + SPROUT_CONSTEXPR_OR_CONST typename sprout::container_traits::size_type + sprout::adaptors::detail::sized_range_size< + Range, Size, + typename std::enable_if >::value>::type + >::static_size; + + template::size_type Size> + class sized_range_size< + Range, Size, + typename std::enable_if >::value>::type + > { + public: + SPROUT_STATIC_CONSTEXPR typename sprout::container_traits::size_type static_size = Size; + static SPROUT_CONSTEXPR typename sprout::container_traits::size_type fixed_size() { + return static_size; + } + }; + template::size_type Size> + SPROUT_CONSTEXPR_OR_CONST typename sprout::container_traits::size_type + sprout::adaptors::detail::sized_range_size< + Range, Size, + typename std::enable_if >::value>::type + >::static_size; + + template< + typename Range, typename sprout::container_traits::size_type Size, + typename Iterator = typename sprout::container_traits::iterator + > + class sized_range_default + : public sprout::range::range_container + , public sprout::adaptors::detail::sized_range_size + { + public: + typedef Range range_type; + typedef sprout::range::range_container base_type; + typedef typename base_type::iterator iterator; + public: + sized_range_default() = default; + sized_range_default(sized_range_default const&) = default; + explicit SPROUT_CONSTEXPR sized_range_default(iterator const& first, iterator const& last) + : base_type(first, last) + {} + }; + } // namespace detail + } // namespace adaptors + + // + // container_construct_traits + // + template::size_type Size, typename Iterator> + struct container_construct_traits > { + public: + typedef typename sprout::containers::weak_rebind_size< + typename sprout::container_construct_traits::copied_type, + sprout::adaptors::detail::sized_range_default::static_size + >::type copied_type; + public: + template + static SPROUT_CONSTEXPR copied_type deep_copy(Cont&& cont) { + return sprout::range::fixed::copy(sprout::forward(cont), sprout::pit()); + } + template + static SPROUT_CONSTEXPR copied_type make(Args&&... args) { + return sprout::make(sprout::forward(args)...); + } + template + static SPROUT_CONSTEXPR copied_type remake( + Cont&& cont, + typename sprout::container_traits >::difference_type size, + Args&&... args + ) + { + return sprout::remake(sprout::forward(cont), size, sprout::forward(args)...); + } + }; +} // namespace sprout + +#endif // #ifndef SPROUT_RANGE_ADAPTOR_DETAIL_SIZED_RANGE_DEFAULT_HPP diff --git a/sprout/range/adaptor/filtered.hpp b/sprout/range/adaptor/filtered.hpp index fb9c9a2a..79053821 100644 --- a/sprout/range/adaptor/filtered.hpp +++ b/sprout/range/adaptor/filtered.hpp @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #include #include @@ -20,24 +20,24 @@ namespace sprout { // template class filtered_range - : public sprout::range::range_container< + : public sprout::adaptors::detail::adapted_range_default< + Range, sprout::filter_iterator< Predicate, typename sprout::container_traits::iterator > > - , public sprout::detail::container_nosy_static_size - , public sprout::detail::container_nosy_fixed_size { public: typedef Predicate predicate_type; - typedef Range range_type; - typedef sprout::range::range_container< + typedef sprout::adaptors::detail::adapted_range_default< + Range, sprout::filter_iterator< Predicate, typename sprout::container_traits::iterator > > base_type; + typedef typename base_type::range_type range_type; typedef typename base_type::iterator iterator; public: filtered_range() = default; @@ -112,28 +112,9 @@ namespace sprout { // container_construct_traits // template - struct container_construct_traits > { - public: - typedef typename sprout::container_construct_traits::copied_type copied_type; - public: - template - static SPROUT_CONSTEXPR copied_type deep_copy(Cont&& cont) { - return sprout::range::fixed::copy(sprout::forward(cont), sprout::pit()); - } - template - static SPROUT_CONSTEXPR copied_type make(Args&&... args) { - return sprout::make(sprout::forward(args)...); - } - template - static SPROUT_CONSTEXPR copied_type remake( - Cont&& cont, - typename sprout::container_traits >::difference_type size, - Args&&... args - ) - { - return sprout::remake(sprout::forward(cont), size, sprout::forward(args)...); - } - }; + struct container_construct_traits > + : public sprout::container_construct_traits::base_type> + {}; } // namespace sprout #endif // #ifndef SPROUT_RANGE_ADAPTOR_FILTERED_HPP diff --git a/sprout/range/adaptor/indexed.hpp b/sprout/range/adaptor/indexed.hpp index ec1a540a..3ccf4fce 100644 --- a/sprout/range/adaptor/indexed.hpp +++ b/sprout/range/adaptor/indexed.hpp @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #include #include @@ -20,19 +20,18 @@ namespace sprout { // template class indexed_range - : public sprout::range::range_container< + : public sprout::adaptors::detail::adapted_range_default< + Range, sprout::indexed_iterator::iterator> > - , public sprout::detail::container_nosy_static_size - , public sprout::detail::container_nosy_fixed_size { public: - typedef Range range_type; - typedef sprout::range::range_container< + typedef sprout::adaptors::detail::adapted_range_default< + Range, sprout::indexed_iterator::iterator> > base_type; + typedef typename base_type::range_type range_type; typedef typename base_type::iterator iterator; - typedef typename base_type::value_type value_type; typedef typename iterator::index_type index_type; public: indexed_range() = default; @@ -122,28 +121,9 @@ namespace sprout { // container_construct_traits // template - struct container_construct_traits > { - public: - typedef typename sprout::container_construct_traits::copied_type copied_type; - public: - template - static SPROUT_CONSTEXPR copied_type deep_copy(Cont&& cont) { - return sprout::range::fixed::copy(sprout::forward(cont), sprout::pit()); - } - template - static SPROUT_CONSTEXPR copied_type make(Args&&... args) { - return sprout::make(sprout::forward(args)...); - } - template - static SPROUT_CONSTEXPR copied_type remake( - Cont&& cont, - typename sprout::container_traits >::difference_type size, - Args&&... args - ) - { - return sprout::remake(sprout::forward(cont), size, sprout::forward(args)...); - } - }; + struct container_construct_traits > + : public sprout::container_construct_traits::base_type> + {}; } // namespace sprout #endif // #ifndef SPROUT_RANGE_ADAPTOR_INDEXED_HPP diff --git a/sprout/range/adaptor/jointed.hpp b/sprout/range/adaptor/jointed.hpp index fe55435e..5252cf8a 100644 --- a/sprout/range/adaptor/jointed.hpp +++ b/sprout/range/adaptor/jointed.hpp @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #include #include @@ -21,29 +21,29 @@ namespace sprout { // template class jointed_range - : public sprout::range::range_container< + : public sprout::adaptors::detail::jointed_range_default< + LRange, RRange, sprout::joint_iterator< typename sprout::container_traits::iterator, typename sprout::container_traits::iterator > > - , public sprout::detail::container_nosy_static_size - , public sprout::detail::container_nosy_fixed_size { public: - typedef LRange range_type; - typedef RRange range2_type; - typedef sprout::range::range_container< + typedef sprout::adaptors::detail::jointed_range_default< + LRange, RRange, sprout::joint_iterator< typename sprout::container_traits::iterator, typename sprout::container_traits::iterator > > base_type; + typedef typename base_type::range1_type range1_type; + typedef typename base_type::range2_type range2_type; typedef typename base_type::iterator iterator; public: jointed_range() = default; jointed_range(jointed_range const&) = default; - SPROUT_CONSTEXPR jointed_range(range_type& range1, range2_type& range2) + SPROUT_CONSTEXPR jointed_range(range1_type& range1, range2_type& range2) : base_type( iterator(sprout::begin(range1), sprout::end(range1), sprout::begin(range2), sprout::begin(range2)), iterator(sprout::end(range1), sprout::end(range1), sprout::begin(range2), sprout::end(range2)) @@ -119,28 +119,9 @@ namespace sprout { // container_construct_traits // template - struct container_construct_traits > { - public: - typedef typename sprout::container_construct_traits::copied_type copied_type; - public: - template - static SPROUT_CONSTEXPR copied_type deep_copy(Cont&& cont) { - return sprout::range::fixed::copy(sprout::forward(cont), sprout::pit()); - } - template - static SPROUT_CONSTEXPR copied_type make(Args&&... args) { - return sprout::make(sprout::forward(args)...); - } - template - static SPROUT_CONSTEXPR copied_type remake( - Cont&& cont, - typename sprout::container_traits >::difference_type size, - Args&&... args - ) - { - return sprout::remake(sprout::forward(cont), size, sprout::forward(args)...); - } - }; + struct container_construct_traits > + : public sprout::container_construct_traits::base_type> + {}; } // namespace sprout #endif // #ifndef SPROUT_RANGE_ADAPTOR_JOINTED_HPP diff --git a/sprout/range/adaptor/outdirected.hpp b/sprout/range/adaptor/outdirected.hpp index a431feb2..9734486b 100644 --- a/sprout/range/adaptor/outdirected.hpp +++ b/sprout/range/adaptor/outdirected.hpp @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #include #include @@ -20,19 +20,18 @@ namespace sprout { // template class outdirected_range - : public sprout::range::range_container< + : public sprout::adaptors::detail::adapted_range_default< + Range, sprout::counting_iterator::iterator> > - , public sprout::detail::container_nosy_static_size - , public sprout::detail::container_nosy_fixed_size { public: - typedef Range range_type; - typedef sprout::range::range_container< + typedef sprout::adaptors::detail::adapted_range_default< + Range, sprout::counting_iterator::iterator> > base_type; + typedef typename base_type::range_type range_type; typedef typename base_type::iterator iterator; - typedef typename base_type::value_type value_type; public: outdirected_range() = default; outdirected_range(outdirected_range const&) = default; @@ -76,28 +75,9 @@ namespace sprout { // container_construct_traits // template - struct container_construct_traits > { - public: - typedef typename sprout::container_construct_traits::copied_type copied_type; - public: - template - static SPROUT_CONSTEXPR copied_type deep_copy(Cont&& cont) { - return sprout::range::fixed::copy(sprout::forward(cont), sprout::pit()); - } - template - static SPROUT_CONSTEXPR copied_type make(Args&&... args) { - return sprout::make(sprout::forward(args)...); - } - template - static SPROUT_CONSTEXPR copied_type remake( - Cont&& cont, - typename sprout::container_traits >::difference_type size, - Args&&... args - ) - { - return sprout::remake(sprout::forward(cont), size, sprout::forward(args)...); - } - }; + struct container_construct_traits > + : public sprout::container_construct_traits::base_type> + {}; } // namespace sprout #endif // #ifndef SPROUT_RANGE_ADAPTOR_OUTDIRECTED_HPP diff --git a/sprout/range/adaptor/replaced.hpp b/sprout/range/adaptor/replaced.hpp index d3fee314..49ac513d 100644 --- a/sprout/range/adaptor/replaced.hpp +++ b/sprout/range/adaptor/replaced.hpp @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #include #include @@ -39,23 +39,23 @@ namespace sprout { // template class replaced_range - : public sprout::range::range_container< + : public sprout::adaptors::detail::adapted_range_default< + Range, sprout::transform_iterator< sprout::adaptors::detail::replace_value::value_type>, typename sprout::container_traits::iterator > > - , public sprout::detail::container_nosy_static_size - , public sprout::detail::container_nosy_fixed_size { public: - typedef Range range_type; - typedef sprout::range::range_container< + typedef sprout::adaptors::detail::adapted_range_default< + Range, sprout::transform_iterator< sprout::adaptors::detail::replace_value::value_type>, typename sprout::container_traits::iterator > > base_type; + typedef typename base_type::range_type range_type; typedef typename base_type::iterator iterator; typedef typename base_type::value_type value_type; public: @@ -133,28 +133,9 @@ namespace sprout { // container_construct_traits // template - struct container_construct_traits > { - public: - typedef typename sprout::container_construct_traits::copied_type copied_type; - public: - template - static SPROUT_CONSTEXPR copied_type deep_copy(Cont&& cont) { - return sprout::range::fixed::copy(sprout::forward(cont), sprout::pit()); - } - template - static SPROUT_CONSTEXPR copied_type make(Args&&... args) { - return sprout::make(sprout::forward(args)...); - } - template - static SPROUT_CONSTEXPR copied_type remake( - Cont&& cont, - typename sprout::container_traits >::difference_type size, - Args&&... args - ) - { - return sprout::remake(sprout::forward(cont), size, sprout::forward(args)...); - } - }; + struct container_construct_traits > + : public sprout::container_construct_traits::base_type> + {}; } // namespace sprout #endif // #ifndef SPROUT_RANGE_ADAPTOR_REPLACED_HPP diff --git a/sprout/range/adaptor/replaced_if.hpp b/sprout/range/adaptor/replaced_if.hpp index f59e08cd..1eca4714 100644 --- a/sprout/range/adaptor/replaced_if.hpp +++ b/sprout/range/adaptor/replaced_if.hpp @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #include #include @@ -40,29 +40,30 @@ namespace sprout { // template class replaced_if_range - : public sprout::range::range_container< + : public sprout::adaptors::detail::adapted_range_default< + Range, sprout::transform_iterator< sprout::adaptors::detail::replace_value_if::value_type>, typename sprout::container_traits::iterator > > - , public sprout::detail::container_nosy_static_size - , public sprout::detail::container_nosy_fixed_size { public: - typedef Range range_type; - typedef sprout::range::range_container< + typedef Predicate predicate_type; + typedef sprout::adaptors::detail::adapted_range_default< + Range, sprout::transform_iterator< sprout::adaptors::detail::replace_value_if::value_type>, typename sprout::container_traits::iterator > > base_type; + typedef typename base_type::range_type range_type; typedef typename base_type::iterator iterator; typedef typename base_type::value_type value_type; public: replaced_if_range() = default; replaced_if_range(replaced_if_range const&) = default; - explicit SPROUT_CONSTEXPR replaced_if_range(range_type& range, Predicate pred, value_type const& new_value) + explicit SPROUT_CONSTEXPR replaced_if_range(range_type& range, predicate_type pred, value_type const& new_value) : base_type( iterator(sprout::begin(range), typename iterator::functor_type(pred, new_value)), iterator(sprout::end(range), typename iterator::functor_type(pred, new_value)) @@ -137,28 +138,9 @@ namespace sprout { // container_construct_traits // template - struct container_construct_traits > { - public: - typedef typename sprout::container_construct_traits::copied_type copied_type; - public: - template - static SPROUT_CONSTEXPR copied_type deep_copy(Cont&& cont) { - return sprout::range::fixed::copy(sprout::forward(cont), sprout::pit()); - } - template - static SPROUT_CONSTEXPR copied_type make(Args&&... args) { - return sprout::make(sprout::forward(args)...); - } - template - static SPROUT_CONSTEXPR copied_type remake( - Cont&& cont, - typename sprout::container_traits >::difference_type size, - Args&&... args - ) - { - return sprout::remake(sprout::forward(cont), size, sprout::forward(args)...); - } - }; + struct container_construct_traits > + : public sprout::container_construct_traits::base_type> + {}; } // namespace sprout #endif // #ifndef SPROUT_RANGE_ADAPTOR_REPLACED_IF_HPP diff --git a/sprout/range/adaptor/sawtooth_wave.hpp b/sprout/range/adaptor/sawtooth_wave.hpp index 03a47ac9..a69e25b9 100644 --- a/sprout/range/adaptor/sawtooth_wave.hpp +++ b/sprout/range/adaptor/sawtooth_wave.hpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -20,20 +21,19 @@ namespace sprout { // template class sawtooth_wave_range - : public sprout::range::range_container< + : public sprout::adaptors::detail::adapted_range_default< + Range, sprout::sawtooth_iterator > - , public sprout::detail::container_nosy_static_size - , public sprout::detail::container_nosy_fixed_size { public: - typedef Range range_type; - typedef sprout::range::range_container< + typedef sprout::adaptors::detail::adapted_range_default< + Range, sprout::sawtooth_iterator > base_type; + typedef typename base_type::range_type range_type; typedef typename base_type::iterator iterator; typedef typename base_type::value_type value_type; - typedef typename base_type::difference_type difference_type; public: sawtooth_wave_range() = default; sawtooth_wave_range(sawtooth_wave_range const&) = default; @@ -71,7 +71,6 @@ namespace sprout { > base_type; typedef typename base_type::iterator iterator; typedef typename base_type::value_type value_type; - typedef typename base_type::difference_type difference_type; public: sawtooth_wave_range() = default; sawtooth_wave_range(sawtooth_wave_range const&) = default; @@ -144,29 +143,10 @@ namespace sprout { // // container_construct_traits // - template - struct container_construct_traits > { - public: - typedef typename sprout::container_construct_traits::copied_type copied_type; - public: - template - static SPROUT_CONSTEXPR copied_type deep_copy(Cont&& cont) { - return sprout::range::fixed::copy(sprout::forward(cont), sprout::pit()); - } - template - static SPROUT_CONSTEXPR copied_type make(Args&&... args) { - return sprout::make(sprout::forward(args)...); - } - template - static SPROUT_CONSTEXPR copied_type remake( - Cont&& cont, - typename sprout::container_traits >::difference_type size, - Args&&... args - ) - { - return sprout::remake(sprout::forward(cont), size, sprout::forward(args)...); - } - }; + template + struct container_construct_traits > + : public sprout::container_construct_traits::base_type> + {}; } // namespace sprout #endif // #ifndef SPROUT_RANGE_ADAPTOR_SAWTOOTH_WAVE_HPP diff --git a/sprout/range/adaptor/sinusoidal.hpp b/sprout/range/adaptor/sinusoidal.hpp index aa7a01c0..6553a55a 100644 --- a/sprout/range/adaptor/sinusoidal.hpp +++ b/sprout/range/adaptor/sinusoidal.hpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -20,20 +21,19 @@ namespace sprout { // template class sinusoidal_range - : public sprout::range::range_container< + : public sprout::adaptors::detail::adapted_range_default< + Range, sprout::sinusoid_iterator > - , public sprout::detail::container_nosy_static_size - , public sprout::detail::container_nosy_fixed_size { public: - typedef Range range_type; - typedef sprout::range::range_container< + typedef sprout::adaptors::detail::adapted_range_default< + Range, sprout::sinusoid_iterator > base_type; + typedef typename base_type::range_type range_type; typedef typename base_type::iterator iterator; typedef typename base_type::value_type value_type; - typedef typename base_type::difference_type difference_type; public: sinusoidal_range() = default; sinusoidal_range(sinusoidal_range const&) = default; @@ -71,7 +71,6 @@ namespace sprout { > base_type; typedef typename base_type::iterator iterator; typedef typename base_type::value_type value_type; - typedef typename base_type::difference_type difference_type; public: sinusoidal_range() = default; sinusoidal_range(sinusoidal_range const&) = default; @@ -144,29 +143,10 @@ namespace sprout { // // container_construct_traits // - template - struct container_construct_traits > { - public: - typedef typename sprout::container_construct_traits::copied_type copied_type; - public: - template - static SPROUT_CONSTEXPR copied_type deep_copy(Cont&& cont) { - return sprout::range::fixed::copy(sprout::forward(cont), sprout::pit()); - } - template - static SPROUT_CONSTEXPR copied_type make(Args&&... args) { - return sprout::make(sprout::forward(args)...); - } - template - static SPROUT_CONSTEXPR copied_type remake( - Cont&& cont, - typename sprout::container_traits >::difference_type size, - Args&&... args - ) - { - return sprout::remake(sprout::forward(cont), size, sprout::forward(args)...); - } - }; + template + struct container_construct_traits > + : public sprout::container_construct_traits::base_type> + {}; } // namespace sprout #endif // #ifndef SPROUT_RANGE_ADAPTOR_SINUSOIDAL_HPP diff --git a/sprout/range/adaptor/size_enumed.hpp b/sprout/range/adaptor/size_enumed.hpp index db0c2054..924f477e 100644 --- a/sprout/range/adaptor/size_enumed.hpp +++ b/sprout/range/adaptor/size_enumed.hpp @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #include #include @@ -20,21 +20,21 @@ namespace sprout { // template class size_enumed_range - : public sprout::range::range_container< + : public sprout::adaptors::detail::adapted_range_default< + Range, sprout::size_enum_iterator< typename sprout::container_traits::iterator > > - , public sprout::detail::container_nosy_static_size - , public sprout::detail::container_nosy_fixed_size { public: - typedef Range range_type; - typedef sprout::range::range_container< + typedef sprout::adaptors::detail::adapted_range_default< + Range, sprout::size_enum_iterator< typename sprout::container_traits::iterator > > base_type; + typedef typename base_type::range_type range_type; typedef typename base_type::iterator iterator; public: size_enumed_range() = default; @@ -49,21 +49,21 @@ namespace sprout { template class size_enumed_range - : public sprout::range::range_container< + : public sprout::adaptors::detail::adapted_range_default< + Range, sprout::size_enum_iterator< typename sprout::container_traits::iterator, true > > - , public sprout::detail::container_nosy_static_size - , public sprout::detail::container_nosy_fixed_size { public: - typedef Range range_type; - typedef sprout::range::range_container< + typedef sprout::adaptors::detail::adapted_range_default< + Range, sprout::size_enum_iterator< typename sprout::container_traits::iterator, true > > base_type; + typedef typename base_type::range_type range_type; typedef typename base_type::iterator iterator; typedef typename base_type::value_type value_type; public: @@ -164,28 +164,9 @@ namespace sprout { // container_construct_traits // template - struct container_construct_traits > { - public: - typedef typename sprout::container_construct_traits::copied_type copied_type; - public: - template - static SPROUT_CONSTEXPR copied_type deep_copy(Cont&& cont) { - return sprout::range::fixed::copy(sprout::forward(cont), sprout::pit()); - } - template - static SPROUT_CONSTEXPR copied_type make(Args&&... args) { - return sprout::make(sprout::forward(args)...); - } - template - static SPROUT_CONSTEXPR copied_type remake( - Cont&& cont, - typename sprout::container_traits >::difference_type size, - Args&&... args - ) - { - return sprout::remake(sprout::forward(cont), size, sprout::forward(args)...); - } - }; + struct container_construct_traits > + : public sprout::container_construct_traits::base_type> + {}; } // namespace sprout #endif // #ifndef SPROUT_RANGE_ADAPTOR_SIZE_ENUMED_HPP diff --git a/sprout/range/adaptor/sized.hpp b/sprout/range/adaptor/sized.hpp index d8aa4c54..1bbc92d7 100644 --- a/sprout/range/adaptor/sized.hpp +++ b/sprout/range/adaptor/sized.hpp @@ -7,8 +7,7 @@ #include #include #include -#include -#include +#include #include #include #include @@ -16,73 +15,25 @@ namespace sprout { namespace adaptors { - namespace detail { - template::size_type Size, typename = void> - class sized_impl; - - template::size_type Size> - class sized_impl< - Range, Size, - typename std::enable_if >::value>::type - > { - public: - SPROUT_STATIC_CONSTEXPR typename sprout::container_traits::size_type - static_size = Size < sprout::container_traits::static_size ? Size - : sprout::container_traits::static_size - ; - static SPROUT_CONSTEXPR typename sprout::container_traits::size_type fixed_size() { - return static_size; - } - }; - template::size_type Size> - SPROUT_CONSTEXPR_OR_CONST typename sprout::container_traits::size_type sized_impl< - Range, Size, - typename std::enable_if >::value>::type - >::static_size; - - template::size_type Size> - class sized_impl< - Range, Size, - typename std::enable_if >::value>::type - > { - public: - SPROUT_STATIC_CONSTEXPR typename sprout::container_traits::size_type static_size = Size; - static SPROUT_CONSTEXPR typename sprout::container_traits::size_type fixed_size() { - return static_size; - } - }; - template::size_type Size> - SPROUT_CONSTEXPR_OR_CONST typename sprout::container_traits::size_type sized_impl< - Range, Size, - typename std::enable_if >::value>::type - >::static_size; - } // namespace detail - // // sized_range // template::size_type Size> class sized_range - : public sprout::range::range_container< - typename sprout::container_traits::iterator - > - , public sprout::adaptors::detail::sized_impl + : public sprout::adaptors::detail::sized_range_default { public: - typedef Range range_type; - typedef sprout::range::range_container< - typename sprout::container_traits::iterator - > base_type; - private: - typedef sprout::adaptors::detail::sized_impl sized_impl_type; + typedef sprout::adaptors::detail::sized_range_default base_type; + typedef typename base_type::range_type range_type; + typedef typename base_type::size_type size_type; public: sized_range() = default; sized_range(sized_range const&) = default; explicit SPROUT_CONSTEXPR sized_range(range_type& range) : base_type( sprout::begin(range), - sized_impl_type::static_size < static_cast::size_type>(sprout::size(range)) - ? sprout::next(sprout::begin(range), sized_impl_type::static_size) + base_type::static_size < static_cast(sprout::size(range)) + ? sprout::next(sprout::begin(range), base_type::static_size) : sprout::end(range) ) {} @@ -126,33 +77,9 @@ namespace sprout { // container_construct_traits // template::size_type Size> - struct container_construct_traits > { - private: - typedef typename sprout::container_construct_traits::copied_type range_copied_type; - public: - typedef typename sprout::containers::weak_rebind_size< - range_copied_type, - sprout::adaptors::sized_range::static_size - >::type copied_type; - public: - template - static SPROUT_CONSTEXPR copied_type deep_copy(Cont&& cont) { - return sprout::range::fixed::copy(sprout::forward(cont), sprout::pit()); - } - template - static SPROUT_CONSTEXPR copied_type make(Args&&... args) { - return sprout::make(sprout::forward(args)...); - } - template - static SPROUT_CONSTEXPR copied_type remake( - Cont&& cont, - typename sprout::container_traits >::difference_type size, - Args&&... args - ) - { - return sprout::remake(sprout::forward(cont), size, sprout::forward(args)...); - } - }; + struct container_construct_traits > + : public sprout::container_construct_traits::base_type> + {}; } // namespace sprout #endif // #ifndef SPROUT_RANGE_ADAPTOR_SIZED_HPP diff --git a/sprout/range/adaptor/square_wave.hpp b/sprout/range/adaptor/square_wave.hpp index e0b6b540..0bdc7f51 100644 --- a/sprout/range/adaptor/square_wave.hpp +++ b/sprout/range/adaptor/square_wave.hpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -20,20 +21,19 @@ namespace sprout { // template class square_wave_range - : public sprout::range::range_container< + : public sprout::adaptors::detail::adapted_range_default< + Range, sprout::square_iterator > - , public sprout::detail::container_nosy_static_size - , public sprout::detail::container_nosy_fixed_size { public: - typedef Range range_type; - typedef sprout::range::range_container< + typedef sprout::adaptors::detail::adapted_range_default< + Range, sprout::square_iterator > base_type; + typedef typename base_type::range_type range_type; typedef typename base_type::iterator iterator; typedef typename base_type::value_type value_type; - typedef typename base_type::difference_type difference_type; public: square_wave_range() = default; square_wave_range(square_wave_range const&) = default; @@ -75,7 +75,6 @@ namespace sprout { > base_type; typedef typename base_type::iterator iterator; typedef typename base_type::value_type value_type; - typedef typename base_type::difference_type difference_type; public: square_wave_range() = default; square_wave_range(square_wave_range const&) = default; @@ -154,29 +153,10 @@ namespace sprout { // // container_construct_traits // - template - struct container_construct_traits > { - public: - typedef typename sprout::container_construct_traits::copied_type copied_type; - public: - template - static SPROUT_CONSTEXPR copied_type deep_copy(Cont&& cont) { - return sprout::range::fixed::copy(sprout::forward(cont), sprout::pit()); - } - template - static SPROUT_CONSTEXPR copied_type make(Args&&... args) { - return sprout::make(sprout::forward(args)...); - } - template - static SPROUT_CONSTEXPR copied_type remake( - Cont&& cont, - typename sprout::container_traits >::difference_type size, - Args&&... args - ) - { - return sprout::remake(sprout::forward(cont), size, sprout::forward(args)...); - } - }; + template + struct container_construct_traits > + : public sprout::container_construct_traits::base_type> + {}; } // namespace sprout #endif // #ifndef SPROUT_RANGE_ADAPTOR_SQUARE_WAVE_HPP diff --git a/sprout/range/adaptor/steps.hpp b/sprout/range/adaptor/steps.hpp index 84fbb442..895d491f 100644 --- a/sprout/range/adaptor/steps.hpp +++ b/sprout/range/adaptor/steps.hpp @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #include #include @@ -21,19 +21,18 @@ namespace sprout { // template class steps_range - : public sprout::range::range_container< + : public sprout::adaptors::detail::adapted_range_default< + Range, sprout::step_iterator::iterator> > - , public sprout::detail::container_nosy_static_size - , public sprout::detail::container_nosy_fixed_size { public: - typedef Range range_type; - typedef sprout::range::range_container< + typedef sprout::adaptors::detail::adapted_range_default< + Range, sprout::step_iterator::iterator> > base_type; + typedef typename base_type::range_type range_type; typedef typename base_type::iterator iterator; - typedef typename base_type::value_type value_type; typedef typename base_type::difference_type difference_type; public: steps_range() = default; @@ -127,28 +126,9 @@ namespace sprout { // container_construct_traits // template - struct container_construct_traits > { - public: - typedef typename sprout::container_construct_traits::copied_type copied_type; - public: - template - static SPROUT_CONSTEXPR copied_type deep_copy(Cont&& cont) { - return sprout::range::fixed::copy(sprout::forward(cont), sprout::pit()); - } - template - static SPROUT_CONSTEXPR copied_type make(Args&&... args) { - return sprout::make(sprout::forward(args)...); - } - template - static SPROUT_CONSTEXPR copied_type remake( - Cont&& cont, - typename sprout::container_traits >::difference_type size, - Args&&... args - ) - { - return sprout::remake(sprout::forward(cont), size, sprout::forward(args)...); - } - }; + struct container_construct_traits > + : public sprout::container_construct_traits::base_type> + {}; } // namespace sprout #endif // #ifndef SPROUT_RANGE_ADAPTOR_STEPS_HPP diff --git a/sprout/range/adaptor/triangle_wave.hpp b/sprout/range/adaptor/triangle_wave.hpp index 6c52cd7e..00d83976 100644 --- a/sprout/range/adaptor/triangle_wave.hpp +++ b/sprout/range/adaptor/triangle_wave.hpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -20,20 +21,19 @@ namespace sprout { // template class triangle_wave_range - : public sprout::range::range_container< + : public sprout::adaptors::detail::adapted_range_default< + Range, sprout::triangle_iterator > - , public sprout::detail::container_nosy_static_size - , public sprout::detail::container_nosy_fixed_size { public: - typedef Range range_type; - typedef sprout::range::range_container< + typedef sprout::adaptors::detail::adapted_range_default< + Range, sprout::triangle_iterator > base_type; + typedef typename base_type::range_type range_type; typedef typename base_type::iterator iterator; typedef typename base_type::value_type value_type; - typedef typename base_type::difference_type difference_type; public: triangle_wave_range() = default; triangle_wave_range(triangle_wave_range const&) = default; @@ -71,7 +71,6 @@ namespace sprout { > base_type; typedef typename base_type::iterator iterator; typedef typename base_type::value_type value_type; - typedef typename base_type::difference_type difference_type; public: triangle_wave_range() = default; triangle_wave_range(triangle_wave_range const&) = default; @@ -144,29 +143,10 @@ namespace sprout { // // container_construct_traits // - template - struct container_construct_traits > { - public: - typedef typename sprout::container_construct_traits::copied_type copied_type; - public: - template - static SPROUT_CONSTEXPR copied_type deep_copy(Cont&& cont) { - return sprout::range::fixed::copy(sprout::forward(cont), sprout::pit()); - } - template - static SPROUT_CONSTEXPR copied_type make(Args&&... args) { - return sprout::make(sprout::forward(args)...); - } - template - static SPROUT_CONSTEXPR copied_type remake( - Cont&& cont, - typename sprout::container_traits >::difference_type size, - Args&&... args - ) - { - return sprout::remake(sprout::forward(cont), size, sprout::forward(args)...); - } - }; + template + struct container_construct_traits > + : public sprout::container_construct_traits::base_type> + {}; } // namespace sprout #endif // #ifndef SPROUT_RANGE_ADAPTOR_TRIANGLE_WAVE_HPP diff --git a/sprout/range/adaptor/valued.hpp b/sprout/range/adaptor/valued.hpp index ebc8f94b..b154c2a1 100644 --- a/sprout/range/adaptor/valued.hpp +++ b/sprout/range/adaptor/valued.hpp @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #include #include @@ -20,19 +20,18 @@ namespace sprout { // template class valued_range - : public sprout::range::range_container< + : public sprout::adaptors::detail::adapted_range_default< + Range, sprout::valued_iterator::iterator, T> > - , public sprout::detail::container_nosy_static_size - , public sprout::detail::container_nosy_fixed_size { public: - typedef Range range_type; - typedef sprout::range::range_container< + typedef sprout::adaptors::detail::adapted_range_default< + Range, sprout::valued_iterator::iterator, T> > base_type; + typedef typename base_type::range_type range_type; typedef typename base_type::iterator iterator; - typedef typename base_type::value_type value_type; typedef typename iterator::param_type param_type; public: valued_range() = default; @@ -110,28 +109,9 @@ namespace sprout { // container_construct_traits // template - struct container_construct_traits > { - public: - typedef typename sprout::container_construct_traits::copied_type copied_type; - public: - template - static SPROUT_CONSTEXPR copied_type deep_copy(Cont&& cont) { - return sprout::range::fixed::copy(sprout::forward(cont), sprout::pit()); - } - template - static SPROUT_CONSTEXPR copied_type make(Args&&... args) { - return sprout::make(sprout::forward(args)...); - } - template - static SPROUT_CONSTEXPR copied_type remake( - Cont&& cont, - typename sprout::container_traits >::difference_type size, - Args&&... args - ) - { - return sprout::remake(sprout::forward(cont), size, sprout::forward(args)...); - } - }; + struct container_construct_traits > + : public sprout::container_construct_traits::base_type> + {}; } // namespace sprout #endif // #ifndef SPROUT_RANGE_ADAPTOR_VALUED_HPP