fix index_range implementation

This commit is contained in:
bolero-MURAKAMI 2013-03-31 15:14:10 +09:00
parent 331aaa3559
commit 049d4592c2
78 changed files with 178 additions and 225 deletions

View file

@ -7,6 +7,7 @@
#include <sprout/index_tuple.hpp>
#include <sprout/container/traits.hpp>
#include <sprout/container/functions.hpp>
#include <sprout/container/indexes.hpp>
#include <sprout/iterator/operation.hpp>
#include <sprout/iterator/clamp_iterator.hpp>
#include <sprout/algorithm/fixed/result_of.hpp>
@ -52,7 +53,7 @@ namespace sprout {
{
return sprout::fixed::detail::clamp_range_copy_impl_ra(
first, last, result, low, high, comp,
sprout::index_range<0, sprout::container_traits<Result>::static_size>::make(),
sprout::container_indexes<Result>::make(),
sprout::internal_begin_offset(result),
sprout::size(result),
sprout::distance(first, last)

View file

@ -7,6 +7,7 @@
#include <sprout/index_tuple.hpp>
#include <sprout/container/traits.hpp>
#include <sprout/container/functions.hpp>
#include <sprout/container/indexes.hpp>
#include <sprout/iterator/operation.hpp>
#include <sprout/algorithm/fixed/result_of.hpp>
#include <sprout/pit/pit.hpp>
@ -43,7 +44,7 @@ namespace sprout {
{
return sprout::fixed::detail::copy_impl_ra(
first, last, result,
sprout::index_range<0, sprout::container_traits<Result>::static_size>::make(),
sprout::container_indexes<Result>::make(),
sprout::internal_begin_offset(result),
sprout::size(result),
sprout::distance(first, last)

View file

@ -7,6 +7,7 @@
#include <sprout/index_tuple.hpp>
#include <sprout/container/traits.hpp>
#include <sprout/container/functions.hpp>
#include <sprout/container/indexes.hpp>
#include <sprout/iterator/operation.hpp>
#include <sprout/algorithm/fixed/result_of.hpp>
#include <sprout/pit/pit.hpp>
@ -43,7 +44,7 @@ namespace sprout {
{
return sprout::fixed::detail::copy_backward_impl_ra(
first, last, result,
sprout::index_range<0, sprout::container_traits<Result>::static_size>::make(),
sprout::container_indexes<Result>::make(),
sprout::internal_end_offset(result),
sprout::size(result),
sprout::distance(first, last)

View file

@ -39,7 +39,7 @@ namespace sprout {
fill(Container const& cont, T const& value) {
return sprout::fixed::detail::fill_impl(
cont, value,
sprout::index_range<0, sprout::container_traits<Container>::static_size>::make(),
sprout::container_indexes<Container>::make(),
sprout::internal_begin_offset(cont),
sprout::size(cont)
);

View file

@ -5,6 +5,7 @@
#include <sprout/index_tuple.hpp>
#include <sprout/container/traits.hpp>
#include <sprout/container/functions.hpp>
#include <sprout/container/indexes.hpp>
#include <sprout/iterator/value_iterator.hpp>
#include <sprout/algorithm/fixed/result_of.hpp>
#include <sprout/algorithm/fixed/fill.hpp>
@ -21,7 +22,7 @@ namespace sprout {
fill_n(Container const& cont, Size n, T const& value) {
return sprout::fixed::detail::fill_impl(
cont, value,
sprout::index_range<0, sprout::container_traits<Container>::static_size>::make(),
sprout::container_indexes<Container>::make(),
sprout::internal_begin_offset(cont),
n
);

View file

@ -7,6 +7,7 @@
#include <sprout/index_tuple.hpp>
#include <sprout/container/traits.hpp>
#include <sprout/container/functions.hpp>
#include <sprout/container/indexes.hpp>
#include <sprout/iterator/operation.hpp>
#include <sprout/iterator/replace_iterator.hpp>
#include <sprout/algorithm/fixed/result_of.hpp>
@ -47,7 +48,7 @@ namespace sprout {
return sprout::fixed::detail::replace_copy_impl_ra(
first, last,
result, old_value, new_value,
sprout::index_range<0, sprout::container_traits<Result>::static_size>::make(),
sprout::container_indexes<Result>::make(),
sprout::internal_begin_offset(result),
sprout::size(result),
sprout::distance(first, last)

View file

@ -7,6 +7,7 @@
#include <sprout/index_tuple.hpp>
#include <sprout/container/traits.hpp>
#include <sprout/container/functions.hpp>
#include <sprout/container/indexes.hpp>
#include <sprout/iterator/operation.hpp>
#include <sprout/iterator/replace_if_iterator.hpp>
#include <sprout/algorithm/fixed/result_of.hpp>
@ -46,7 +47,7 @@ namespace sprout {
return sprout::fixed::detail::replace_copy_if_impl_ra(
first, last,
result, pred, new_value,
sprout::index_range<0, sprout::container_traits<Result>::static_size>::make(),
sprout::container_indexes<Result>::make(),
sprout::internal_begin_offset(result),
sprout::size(result),
sprout::distance(first, last)

View file

@ -7,6 +7,7 @@
#include <sprout/index_tuple.hpp>
#include <sprout/container/traits.hpp>
#include <sprout/container/functions.hpp>
#include <sprout/container/indexes.hpp>
#include <sprout/iterator/operation.hpp>
#include <sprout/iterator/reverse_iterator.hpp>
#include <sprout/algorithm/fixed/result_of.hpp>
@ -44,7 +45,7 @@ namespace sprout {
{
return sprout::fixed::detail::reverse_copy_impl_ra(
first, last, result,
sprout::index_range<0, sprout::container_traits<Result>::static_size>::make(),
sprout::container_indexes<Result>::make(),
sprout::internal_begin_offset(result),
sprout::size(result),
sprout::distance(first, last)

View file

@ -7,6 +7,7 @@
#include <sprout/index_tuple.hpp>
#include <sprout/container/traits.hpp>
#include <sprout/container/functions.hpp>
#include <sprout/container/indexes.hpp>
#include <sprout/iterator/operation.hpp>
#include <sprout/iterator/joint_iterator.hpp>
#include <sprout/algorithm/fixed/result_of.hpp>
@ -50,7 +51,7 @@ namespace sprout {
return sprout::fixed::detail::rotate_copy_impl_ra(
first, middle, last,
result,
sprout::index_range<0, sprout::container_traits<Result>::static_size>::make(),
sprout::container_indexes<Result>::make(),
sprout::internal_begin_offset(result),
sprout::size(result),
sprout::distance(first, last)

View file

@ -8,6 +8,7 @@
#include <sprout/pit/pit.hpp>
#include <sprout/container/traits.hpp>
#include <sprout/container/functions.hpp>
#include <sprout/container/indexes.hpp>
#include <sprout/iterator/operation.hpp>
#include <sprout/utility/forward.hpp>
#include <sprout/algorithm/fixed/result_of.hpp>
@ -95,7 +96,7 @@ namespace sprout {
shuffle(Container const& cont, UniformRandomNumberGenerator&& g) {
return sprout::fixed::detail::shuffle_impl(
cont,
sprout::index_range<0, sprout::container_traits<Container>::static_size>::make(),
sprout::container_indexes<Container>::make(),
sprout::forward<UniformRandomNumberGenerator>(g),
sprout::internal_begin_offset(cont),
sprout::size(cont)

View file

@ -9,6 +9,7 @@
#include <sprout/pit/pit.hpp>
#include <sprout/container/traits.hpp>
#include <sprout/container/functions.hpp>
#include <sprout/container/indexes.hpp>
#include <sprout/iterator/operation.hpp>
#include <sprout/utility/forward.hpp>
#include <sprout/utility/pair/pair.hpp>
@ -110,7 +111,7 @@ namespace sprout {
shuffle_result(Container const& cont, UniformRandomNumberGenerator&& g) {
return sprout::fixed::detail::shuffle_result_impl(
cont,
sprout::index_range<0, sprout::container_traits<Container>::static_size>::make(),
sprout::container_indexes<Container>::make(),
sprout::forward<UniformRandomNumberGenerator>(g),
sprout::internal_begin_offset(cont),
sprout::size(cont)

View file

@ -7,6 +7,7 @@
#include <sprout/index_tuple.hpp>
#include <sprout/container/traits.hpp>
#include <sprout/container/functions.hpp>
#include <sprout/container/indexes.hpp>
#include <sprout/iterator/operation.hpp>
#include <sprout/algorithm/fixed/result_of.hpp>
#include <sprout/pit/pit.hpp>
@ -53,7 +54,7 @@ namespace sprout {
first, last,
result,
pos1, pos2,
sprout::index_range<0, sprout::container_traits<Result>::static_size>::make(),
sprout::container_indexes<Result>::make(),
sprout::internal_begin_offset(result),
sprout::size(result),
sprout::distance(first, last)

View file

@ -7,6 +7,7 @@
#include <sprout/index_tuple.hpp>
#include <sprout/container/traits.hpp>
#include <sprout/container/functions.hpp>
#include <sprout/container/indexes.hpp>
#include <sprout/iterator/operation.hpp>
#include <sprout/iterator/transform_iterator.hpp>
#include <sprout/iterator/type_traits/common.hpp>
@ -47,7 +48,7 @@ namespace sprout {
return sprout::fixed::detail::transform_impl_ra(
first, last,
result, op,
sprout::index_range<0, sprout::container_traits<Result>::static_size>::make(),
sprout::container_indexes<Result>::make(),
sprout::internal_begin_offset(result),
sprout::size(result),
sprout::distance(first, last)
@ -165,7 +166,7 @@ namespace sprout {
return sprout::fixed::detail::transform_impl_ra(
first1, last1, first2,
result, op,
sprout::index_range<0, sprout::container_traits<Result>::static_size>::make(),
sprout::container_indexes<Result>::make(),
sprout::internal_begin_offset(result),
sprout::size(result),
sprout::distance(first1, last1)

View file

@ -5,6 +5,7 @@
#include <sprout/config.hpp>
#include <sprout/container/traits.hpp>
#include <sprout/container/functions.hpp>
#include <sprout/container/indexes.hpp>
#include <sprout/index_tuple.hpp>
#include <sprout/pit/pit.hpp>
#include <sprout/iterator/type_traits/category.hpp>
@ -134,7 +135,7 @@ namespace sprout {
> sizes_type;
return sprout::algorithm::detail::join_impl_ra_1<Result>(
sprout::begin(cont_cont),
sprout::index_range<0, sprout::container_traits<Result>::static_size>::make(),
sprout::container_indexes<Result>::make(),
sprout::range::partial_sum(
cont_cont | sprout::adaptors::size_enumed,
sprout::pit<sizes_type>()
@ -323,7 +324,7 @@ namespace sprout {
return sprout::algorithm::detail::join_impl_ra_1<Result>(
sprout::begin(cont_cont),
sprout::begin(separator),
sprout::index_range<0, sprout::container_traits<Result>::static_size>::make(),
sprout::container_indexes<Result>::make(),
sprout::range::partial_sum(
cont_cont | sprout::adaptors::size_enumed(sprout::algorithm::detail::str_size(separator), true),
sprout::pit<sizes_type>()

View file

@ -227,7 +227,7 @@ namespace sprout {
template<typename T, std::size_t N>
inline SPROUT_CONSTEXPR sprout::array<T, N>
to_array(T const (& arr)[N]) {
return sprout::detail::to_array_impl(arr, sprout::index_range<0, N>::make());
return sprout::detail::to_array_impl(arr, sprout::make_index_tuple<N>::make());
}
} // namespace sprout

View file

@ -165,11 +165,11 @@ namespace sprout {
return offset == 0
? do_left_shift_impl_1(
wshift, offset,
sprout::index_range<0, N>::make()
sprout::make_index_tuple<N>::make()
)
: do_left_shift_impl_2(
wshift, offset, (CHAR_BIT * sprout::detail::sizeof_<unsigned long>::value) - offset,
sprout::index_range<0, N>::make()
sprout::make_index_tuple<N>::make()
)
;
}
@ -209,11 +209,11 @@ namespace sprout {
return offset == 0
? do_right_shift_impl_1(
wshift, offset, limit,
sprout::index_range<0, N>::make()
sprout::make_index_tuple<N>::make()
)
: do_right_shift_impl_2(
wshift, offset, limit, (CHAR_BIT * sprout::detail::sizeof_<unsigned long>::value) - offset,
sprout::index_range<0, N>::make()
sprout::make_index_tuple<N>::make()
)
;
}

View file

@ -215,7 +215,7 @@ namespace sprout {
template<typename... Args>
struct deduce_domain
: public sprout::breed::detail::deduce_domain_impl<
typename sprout::index_range<0, sizeof...(Args)>::type,
typename sprout::make_index_tuple<sizeof...(Args)>::type,
Args...
>
{};

View file

@ -55,7 +55,7 @@ namespace sprout {
}
public:
static SPROUT_CONSTEXPR type call(src_type const& e) {
return call_impl(sprout::index_range<0, sizeof...(Args)>::make());
return call_impl(sprout::make_index_tuple<sizeof...(Args)>::make());
}
};
template<typename Tag, typename... Args>
@ -74,7 +74,7 @@ namespace sprout {
}
public:
static SPROUT_CONSTEXPR type call(src_type const& e) {
return call_impl(sprout::index_range<0, sizeof...(Args)>::make());
return call_impl(sprout::make_index_tuple<sizeof...(Args)>::make());
}
};
} // namespace detail

View file

@ -42,7 +42,7 @@ namespace sprout {
typedef typename sprout::breed::base_expr<
typename unref_expr::breed_domain,
typename unref_expr::breed_tag,
typename list_impl<typename sprout::index_range<0, Arity>::type>::type
typename list_impl<typename sprout::make_index_tuple<Arity>::type>::type
>::type expr_type;
typedef typename unref_expr::breed_generator breed_generator;
typedef typename sprout::breed::detail::std_result_of<
@ -74,7 +74,7 @@ namespace sprout {
typename pass_through_impl::data_param d
) const
{
return call_impl(e, s, d, sprout::index_range<0, Arity>::make());
return call_impl(e, s, d, sprout::make_index_tuple<Arity>::make());
}
};
template<typename Grammar, typename Expr, typename State, typename Data>

View file

@ -4,7 +4,7 @@
#include <sprout/config.hpp>
#include <sprout/index_tuple.hpp>
#include <sprout/index_tuple/detail/make_indexes_helper.hpp>
#include <sprout/container/container_construct_traits.hpp>
#include <sprout/container/container_traits.hpp>
namespace sprout {
namespace containers {
@ -14,7 +14,7 @@ namespace sprout {
template<typename Container>
struct container_indexes
: public sprout::detail::make_indexes_helper<
sprout::index_range<0, sprout::container_traits<Container>::static_size>
sprout::make_index_tuple<sprout::container_traits<Container>::static_size>
>
{};
} // namespace containers

View file

@ -51,7 +51,7 @@ namespace sprout {
template<typename Intersection, typename Objects>
SPROUT_CONSTEXPR color_type
operator()(Intersection const& inter, Objects const& objs) const {
return shade_1(inter, objs, sprout::index_range<0, sizeof...(Lights)>::make());
return shade_1(inter, objs, sprout::make_index_tuple<sizeof...(Lights)>::make());
}
};
//

View file

@ -7,6 +7,7 @@
#include <sprout/array/array.hpp>
#include <sprout/container/traits.hpp>
#include <sprout/container/functions.hpp>
#include <sprout/container/indexes.hpp>
#include <sprout/darkroom/colors/rgb.hpp>
namespace sprout {
@ -77,12 +78,7 @@ namespace sprout {
sprout::darkroom::pixels::detail::generate_impl_line<Pixels>(
raytracer, renderer, camera, objs, lights,
x, y + YIndexes, width, height, depth_max,
sprout::index_range<
0,
sprout::container_traits<
typename sprout::container_traits<Pixels>::value_type
>::static_size
>::make()
sprout::container_indexes<typename sprout::container_traits<Pixels>::value_type>::make()
)...
);
}
@ -115,10 +111,7 @@ namespace sprout {
return sprout::darkroom::pixels::detail::generate_impl<Pixels>(
raytracer, renderer, camera, objs, lights,
x, y, width, height, depth_max,
sprout::index_range<
0,
sprout::container_traits<Pixels>::static_size
>::make()
sprout::container_indexes<Pixels>::make()
);
}

View file

@ -181,7 +181,7 @@ namespace sprout {
SPROUT_CONSTEXPR auto operator()(CVArg& arg, sprout::tuples::tuple<Args...>& tuple) const volatile
-> decltype(arg(std::declval<Args>()...))
{
return call(arg, tuple, sprout::index_range<0, sizeof...(Args)>::make());
return call(arg, tuple, sprout::make_index_tuple<sizeof...(Args)>::make());
}
};
template<typename Arg>
@ -277,7 +277,7 @@ namespace sprout {
{
private:
typedef binder self_type;
typedef typename sprout::index_range<0, sizeof...(BoundArgs)>::type bound_indexes;
typedef typename sprout::make_index_tuple<sizeof...(BoundArgs)>::type bound_indexes;
private:
Functor f_;
sprout::tuples::tuple<BoundArgs...> bound_args_;
@ -385,7 +385,7 @@ namespace sprout {
class bind_result<Result, Functor(BoundArgs...)> {
private:
typedef bind_result self_type;
typedef typename sprout::index_range<0, sizeof...(BoundArgs)>::type bound_indexes;
typedef typename sprout::make_index_tuple<sizeof...(BoundArgs)>::type bound_indexes;
private:
template<typename Res>
struct enable_if_void

View file

@ -762,7 +762,7 @@ namespace sprout {
inline SPROUT_CONSTEXPR sprout::basic_string<Elem, N>
output_impl(Args const&... args) {
return sprout::io::detail::output_impl_1<Elem, N>(
sprout::index_range<0, N>::make(),
sprout::make_index_tuple<N>::make(),
sprout::range::partial_sum(
sprout::array<std::size_t, sizeof...(Args)>{{args.size()...}},
sprout::pit<sprout::array<std::size_t, sizeof...(Args)> >()
@ -786,7 +786,7 @@ namespace sprout {
output(Expression const& expr) {
return sprout::io::detail::output<Elem, N>(
expr,
sprout::index_range<0, sprout::io::leaf_count<Expression>::value>::make()
sprout::make_index_tuple<sprout::io::leaf_count<Expression>::value>::make()
);
}
} // namespace io

View file

@ -7,6 +7,7 @@
#include <sprout/index_tuple.hpp>
#include <sprout/container/traits.hpp>
#include <sprout/container/functions.hpp>
#include <sprout/container/indexes.hpp>
#include <sprout/iterator/operation.hpp>
#include <sprout/iterator/amplitude_spectrum_iterator.hpp>
#include <sprout/algorithm/fixed/result_of.hpp>
@ -45,7 +46,7 @@ namespace sprout {
{
return sprout::fixed::detail::amplitude_spectrum_impl_ra(
first, last, result,
sprout::index_range<0, sprout::container_traits<Result>::static_size>::make(),
sprout::container_indexes<Result>::make(),
sprout::internal_begin_offset(result),
sprout::size(result),
sprout::distance(first, last)

View file

@ -7,6 +7,7 @@
#include <sprout/index_tuple.hpp>
#include <sprout/container/traits.hpp>
#include <sprout/container/functions.hpp>
#include <sprout/container/indexes.hpp>
#include <sprout/iterator/operation.hpp>
#include <sprout/iterator/dft_iterator.hpp>
#include <sprout/algorithm/fixed/result_of.hpp>
@ -45,7 +46,7 @@ namespace sprout {
{
return sprout::fixed::detail::dft_impl_ra(
first, last, result,
sprout::index_range<0, sprout::container_traits<Result>::static_size>::make(),
sprout::container_indexes<Result>::make(),
sprout::internal_begin_offset(result),
sprout::size(result),
sprout::distance(first, last)

View file

@ -7,6 +7,7 @@
#include <sprout/index_tuple.hpp>
#include <sprout/container/traits.hpp>
#include <sprout/container/functions.hpp>
#include <sprout/container/indexes.hpp>
#include <sprout/iterator/operation.hpp>
#include <sprout/iterator/idft_iterator.hpp>
#include <sprout/algorithm/fixed/result_of.hpp>
@ -45,7 +46,7 @@ namespace sprout {
{
return sprout::fixed::detail::idft_impl_ra(
first, last, result,
sprout::index_range<0, sprout::container_traits<Result>::static_size>::make(),
sprout::container_indexes<Result>::make(),
sprout::internal_begin_offset(result),
sprout::size(result),
sprout::distance(first, last)

View file

@ -7,6 +7,7 @@
#include <sprout/index_tuple.hpp>
#include <sprout/container/traits.hpp>
#include <sprout/container/functions.hpp>
#include <sprout/container/indexes.hpp>
#include <sprout/iterator/operation.hpp>
#include <sprout/iterator/phase_spectrum_iterator.hpp>
#include <sprout/algorithm/fixed/result_of.hpp>
@ -45,7 +46,7 @@ namespace sprout {
{
return sprout::fixed::detail::phase_spectrum_impl_ra(
first, last, result,
sprout::index_range<0, sprout::container_traits<Result>::static_size>::make(),
sprout::container_indexes<Result>::make(),
sprout::internal_begin_offset(result),
sprout::size(result),
sprout::distance(first, last)

View file

@ -7,6 +7,7 @@
#include <sprout/index_tuple.hpp>
#include <sprout/container/traits.hpp>
#include <sprout/container/functions.hpp>
#include <sprout/container/indexes.hpp>
#include <sprout/iterator/operation.hpp>
#include <sprout/algorithm/fixed/result_of.hpp>
#include <sprout/bit/reverse.hpp>
@ -45,7 +46,7 @@ namespace sprout {
bitrev_table(Container const& cont) {
return sprout::fixed::detail::bitrev_table_impl(
cont,
sprout::index_range<0, sprout::container_traits<Container>::static_size>::make(),
sprout::container_indexes<Container>::make(),
sprout::empty(cont) ? 0
: sprout::bit_length(sprout::size(cont) - 1)
,

View file

@ -5,6 +5,7 @@
#include <sprout/index_tuple.hpp>
#include <sprout/container/traits.hpp>
#include <sprout/container/functions.hpp>
#include <sprout/container/indexes.hpp>
#include <sprout/iterator/operation.hpp>
#include <sprout/iterator/counting_iterator.hpp>
#include <sprout/algorithm/fixed/result_of.hpp>
@ -39,7 +40,7 @@ namespace sprout {
>::type
iota(Container const& cont, T value) {
return sprout::fixed::detail::iota_impl(
cont, sprout::index_range<0, sprout::container_traits<Container>::static_size>::make(),
cont, sprout::container_indexes<Container>::make(),
value,
sprout::internal_begin_offset(cont),
sprout::size(cont)

View file

@ -5,6 +5,7 @@
#include <sprout/index_tuple.hpp>
#include <sprout/container/traits.hpp>
#include <sprout/container/functions.hpp>
#include <sprout/container/indexes.hpp>
#include <sprout/iterator/operation.hpp>
namespace sprout {
@ -60,10 +61,7 @@ namespace sprout {
{
return sprout::fixed::detail::append_impl<typename sprout::fixed::result_of::append<Container, Input>::type>(
cont,
sprout::index_range<
0,
sprout::container_traits<typename sprout::fixed::result_of::append<Container, Input>::type>::static_size
>::make(),
sprout::container_indexes<typename sprout::fixed::result_of::append<Container, Input>::type>::make(),
sprout::distance(sprout::internal_begin(cont), pos),
sprout::size(input),
input
@ -78,10 +76,7 @@ namespace sprout {
{
return sprout::fixed::detail::append_impl<typename sprout::fixed::result_of::append<Container, Input>::type>(
cont,
sprout::index_range<
0,
sprout::container_traits<typename sprout::fixed::result_of::append<Container, Input>::type>::static_size
>::make(),
sprout::container_indexes<typename sprout::fixed::result_of::append<Container, Input>::type>::make(),
sprout::distance(sprout::internal_begin(cont), sprout::next(sprout::begin(cont), pos)),
sprout::size(input),
input

View file

@ -6,6 +6,7 @@
#include <sprout/index_tuple.hpp>
#include <sprout/container/traits.hpp>
#include <sprout/container/functions.hpp>
#include <sprout/container/indexes.hpp>
#include <sprout/operation/fixed/append.hpp>
namespace sprout {
@ -28,10 +29,7 @@ namespace sprout {
append_back(Container const& cont, Input const& input) {
return sprout::fixed::detail::append_impl<typename sprout::fixed::result_of::append_back<Container, Input>::type>(
cont,
sprout::index_range<
0,
sprout::container_traits<typename sprout::fixed::result_of::append_back<Container, Input>::type>::static_size
>::make(),
sprout::container_indexes<typename sprout::fixed::result_of::append_back<Container, Input>::type>::make(),
sprout::internal_end_offset(cont),
sprout::size(input),
input

View file

@ -6,6 +6,7 @@
#include <sprout/index_tuple.hpp>
#include <sprout/container/traits.hpp>
#include <sprout/container/functions.hpp>
#include <sprout/container/indexes.hpp>
#include <sprout/operation/fixed/append.hpp>
namespace sprout {
@ -28,10 +29,7 @@ namespace sprout {
append_front(Container const& cont, Input const& input) {
return sprout::fixed::detail::append_impl<typename sprout::fixed::result_of::append_front<Container, Input>::type>(
cont,
sprout::index_range<
0,
sprout::container_traits<typename sprout::fixed::result_of::append_front<Container, Input>::type>::static_size
>::make(),
sprout::container_indexes<typename sprout::fixed::result_of::append_front<Container, Input>::type>::make(),
sprout::internal_begin_offset(cont),
sprout::size(input),
input

View file

@ -5,6 +5,7 @@
#include <sprout/index_tuple.hpp>
#include <sprout/container/traits.hpp>
#include <sprout/container/functions.hpp>
#include <sprout/container/indexes.hpp>
#include <sprout/iterator/operation.hpp>
namespace sprout {
@ -54,10 +55,7 @@ namespace sprout {
erase(Container const& cont, typename sprout::container_traits<Container>::const_iterator pos) {
return sprout::fixed::detail::erase_impl<typename sprout::fixed::result_of::erase<Container>::type>(
cont,
sprout::index_range<
0,
sprout::container_traits<typename sprout::fixed::result_of::erase<Container>::type>::static_size
>::make(),
sprout::container_indexes<typename sprout::fixed::result_of::erase<Container>::type>::make(),
sprout::distance(sprout::internal_begin(cont), pos)
);
}
@ -69,10 +67,7 @@ namespace sprout {
erase(Container const& cont, typename sprout::container_traits<Container>::difference_type pos) {
return sprout::fixed::detail::erase_impl<typename sprout::fixed::result_of::erase<Container>::type>(
cont,
sprout::index_range<
0,
sprout::container_traits<typename sprout::fixed::result_of::erase<Container>::type>::static_size
>::make(),
sprout::container_indexes<typename sprout::fixed::result_of::erase<Container>::type>::make(),
sprout::distance(sprout::internal_begin(cont), sprout::next(sprout::begin(cont), pos))
);
}

View file

@ -6,6 +6,7 @@
#include <sprout/index_tuple.hpp>
#include <sprout/container/traits.hpp>
#include <sprout/container/functions.hpp>
#include <sprout/container/indexes.hpp>
#include <sprout/iterator/operation.hpp>
namespace sprout {
@ -55,10 +56,7 @@ namespace sprout {
erase_n(Container const& cont, typename sprout::container_traits<Container>::const_iterator pos) {
return sprout::fixed::detail::erase_n_impl<N, typename sprout::fixed::result_of::erase_n<N, Container>::type>(
cont,
sprout::index_range<
0,
sprout::container_traits<typename sprout::fixed::result_of::erase_n<N, Container>::type>::static_size
>::make(),
sprout::container_indexes<typename sprout::fixed::result_of::erase_n<N, Container>::type>::make(),
sprout::distance(sprout::internal_begin(cont), pos)
);
}
@ -67,10 +65,7 @@ namespace sprout {
erase_n(Container const& cont, typename sprout::container_traits<Container>::difference_type pos) {
return sprout::fixed::detail::erase_n_impl<N, typename sprout::fixed::result_of::erase_n<N, Container>::type>(
cont,
sprout::index_range<
0,
sprout::container_traits<typename sprout::fixed::result_of::erase_n<N, Container>::type>::static_size
>::make(),
sprout::container_indexes<typename sprout::fixed::result_of::erase_n<N, Container>::type>::make(),
sprout::distance(sprout::internal_begin(cont), sprout::next(sprout::begin(cont), pos))
);
}

View file

@ -6,6 +6,7 @@
#include <sprout/index_tuple.hpp>
#include <sprout/container/traits.hpp>
#include <sprout/container/functions.hpp>
#include <sprout/container/indexes.hpp>
#include <sprout/iterator/operation.hpp>
#include <sprout/detail/param_at.hpp>
@ -60,10 +61,7 @@ namespace sprout {
{
return sprout::fixed::detail::insert_impl<typename sprout::fixed::result_of::insert<Container, T, Values...>::type>(
cont,
sprout::index_range<
0,
sprout::container_traits<typename sprout::fixed::result_of::insert<Container, T, Values...>::type>::static_size
>::make(),
sprout::container_indexes<typename sprout::fixed::result_of::insert<Container, T, Values...>::type>::make(),
sprout::distance(sprout::internal_begin(cont), pos),
v,
values...
@ -78,10 +76,7 @@ namespace sprout {
{
return sprout::fixed::detail::insert_impl<typename sprout::fixed::result_of::insert<Container, T, Values...>::type>(
cont,
sprout::index_range<
0,
sprout::container_traits<typename sprout::fixed::result_of::insert<Container, T, Values...>::type>::static_size
>::make(),
sprout::container_indexes<typename sprout::fixed::result_of::insert<Container, T, Values...>::type>::make(),
sprout::distance(sprout::internal_begin(cont), sprout::next(sprout::begin(cont), pos)),
v,
values...

View file

@ -7,6 +7,7 @@
#include <sprout/index_tuple.hpp>
#include <sprout/container/traits.hpp>
#include <sprout/container/functions.hpp>
#include <sprout/container/indexes.hpp>
#include <sprout/iterator/operation.hpp>
#include <sprout/operation/fixed/insert.hpp>
#include <sprout/detail/param_at.hpp>
@ -63,10 +64,7 @@ namespace sprout {
{
return sprout::fixed::detail::insert_n_impl<N, typename sprout::fixed::result_of::insert_n<N, Container, T, Values...>::type>(
cont,
sprout::index_range<
0,
sprout::container_traits<typename sprout::fixed::result_of::insert_n<N, Container, T, Values...>::type>::static_size
>::make(),
sprout::container_indexes<typename sprout::fixed::result_of::insert_n<N, Container, T, Values...>::type>::make(),
sprout::distance(sprout::internal_begin(cont), pos),
v,
values...
@ -84,10 +82,7 @@ namespace sprout {
{
return sprout::fixed::detail::insert_n_impl<N, typename sprout::fixed::result_of::insert_n<N, Container, T, Values...>::type>(
cont,
sprout::index_range<
0,
sprout::container_traits<typename sprout::fixed::result_of::insert_n<N, Container, T, Values...>::type>::static_size
>::make(),
sprout::container_indexes<typename sprout::fixed::result_of::insert_n<N, Container, T, Values...>::type>::make(),
sprout::distance(sprout::internal_begin(cont), sprout::next(sprout::begin(cont), pos)),
v,
values...

View file

@ -6,6 +6,7 @@
#include <sprout/index_tuple.hpp>
#include <sprout/container/traits.hpp>
#include <sprout/container/functions.hpp>
#include <sprout/container/indexes.hpp>
#include <sprout/operation/fixed/erase.hpp>
namespace sprout {
@ -28,10 +29,7 @@ namespace sprout {
pop_back(Container const& cont) {
return sprout::fixed::detail::erase_impl<typename sprout::fixed::result_of::pop_back<Container>::type>(
cont,
sprout::index_range<
0,
sprout::container_traits<typename sprout::fixed::result_of::pop_back<Container>::type>::static_size
>::make(),
sprout::container_indexes<typename sprout::fixed::result_of::pop_back<Container>::type>::make(),
sprout::internal_end_offset(cont) - 1
);
}

View file

@ -6,6 +6,7 @@
#include <sprout/index_tuple.hpp>
#include <sprout/container/traits.hpp>
#include <sprout/container/functions.hpp>
#include <sprout/container/indexes.hpp>
#include <sprout/operation/fixed/erase_n.hpp>
namespace sprout {
@ -28,10 +29,7 @@ namespace sprout {
pop_back_n(Container const& cont) {
return sprout::fixed::detail::erase_n_impl<N, typename sprout::fixed::result_of::pop_back_n<N, Container>::type>(
cont,
sprout::index_range<
0,
sprout::container_traits<typename sprout::fixed::result_of::pop_back_n<N, Container>::type>::static_size
>::make(),
sprout::container_indexes<typename sprout::fixed::result_of::pop_back_n<N, Container>::type>::make(),
sprout::internal_end_offset(cont) - N
);
}

View file

@ -6,6 +6,7 @@
#include <sprout/index_tuple.hpp>
#include <sprout/container/traits.hpp>
#include <sprout/container/functions.hpp>
#include <sprout/container/indexes.hpp>
#include <sprout/operation/fixed/erase.hpp>
namespace sprout {
@ -28,10 +29,7 @@ namespace sprout {
pop_front(Container const& cont) {
return sprout::fixed::detail::erase_impl<typename sprout::fixed::result_of::pop_front<Container>::type>(
cont,
sprout::index_range<
0,
sprout::container_traits<typename sprout::fixed::result_of::pop_front<Container>::type>::static_size
>::make(),
sprout::container_indexes<typename sprout::fixed::result_of::pop_front<Container>::type>::make(),
sprout::internal_begin_offset(cont)
);
}

View file

@ -6,6 +6,7 @@
#include <sprout/index_tuple.hpp>
#include <sprout/container/traits.hpp>
#include <sprout/container/functions.hpp>
#include <sprout/container/indexes.hpp>
#include <sprout/operation/fixed/erase_n.hpp>
namespace sprout {
@ -28,10 +29,7 @@ namespace sprout {
pop_front_n(Container const& cont) {
return sprout::fixed::detail::erase_n_impl<N, typename sprout::fixed::result_of::pop_front_n<N, Container>::type>(
cont,
sprout::index_range<
0,
sprout::container_traits<typename sprout::fixed::result_of::pop_front_n<N, Container>::type>::static_size
>::make(),
sprout::container_indexes<typename sprout::fixed::result_of::pop_front_n<N, Container>::type>::make(),
sprout::internal_begin_offset(cont)
);
}

View file

@ -6,6 +6,7 @@
#include <sprout/index_tuple.hpp>
#include <sprout/container/traits.hpp>
#include <sprout/container/functions.hpp>
#include <sprout/container/indexes.hpp>
#include <sprout/operation/fixed/insert.hpp>
namespace sprout {
@ -28,10 +29,7 @@ namespace sprout {
push_back(Container const& cont, T const& v, Values const&... values) {
return sprout::fixed::detail::insert_impl<typename sprout::fixed::result_of::push_back<Container, T, Values...>::type>(
cont,
sprout::index_range<
0,
sprout::container_traits<typename sprout::fixed::result_of::push_back<Container, T, Values...>::type>::static_size
>::make(),
sprout::container_indexes<typename sprout::fixed::result_of::push_back<Container, T, Values...>::type>::make(),
sprout::internal_end_offset(cont),
v,
values...

View file

@ -6,6 +6,7 @@
#include <sprout/index_tuple.hpp>
#include <sprout/container/traits.hpp>
#include <sprout/container/functions.hpp>
#include <sprout/container/indexes.hpp>
#include <sprout/operation/fixed/insert_n.hpp>
namespace sprout {
@ -28,10 +29,7 @@ namespace sprout {
push_back_n(Container const& cont, T const& v, Values const&... values) {
return sprout::fixed::detail::insert_n_impl<N, typename sprout::fixed::result_of::push_back_n<N, Container, T, Values...>::type>(
cont,
sprout::index_range<
0,
sprout::container_traits<typename sprout::fixed::result_of::push_back_n<N, Container, T, Values...>::type>::static_size
>::make(),
sprout::container_indexes<typename sprout::fixed::result_of::push_back_n<N, Container, T, Values...>::type>::make(),
sprout::internal_end_offset(cont),
v,
values...

View file

@ -6,6 +6,7 @@
#include <sprout/index_tuple.hpp>
#include <sprout/container/traits.hpp>
#include <sprout/container/functions.hpp>
#include <sprout/container/indexes.hpp>
#include <sprout/operation/fixed/insert.hpp>
namespace sprout {
@ -28,10 +29,7 @@ namespace sprout {
push_front(Container const& cont, T const& v, Values const&... values) {
return sprout::fixed::detail::insert_impl<typename sprout::fixed::result_of::push_front<Container, T, Values...>::type>(
cont,
sprout::index_range<
0,
sprout::container_traits<typename sprout::fixed::result_of::push_front<Container, T, Values...>::type>::static_size
>::make(),
sprout::container_indexes<typename sprout::fixed::result_of::push_front<Container, T, Values...>::type>::make(),
sprout::internal_begin_offset(cont),
v,
values...

View file

@ -6,6 +6,7 @@
#include <sprout/index_tuple.hpp>
#include <sprout/container/traits.hpp>
#include <sprout/container/functions.hpp>
#include <sprout/container/indexes.hpp>
#include <sprout/operation/fixed/insert_n.hpp>
namespace sprout {
@ -28,10 +29,7 @@ namespace sprout {
push_front_n(Container const& cont, T const& v, Values const&... values) {
return sprout::fixed::detail::insert_n_impl<N, typename sprout::fixed::result_of::push_front_n<N, Container, T, Values...>::type>(
cont,
sprout::index_range<
0,
sprout::container_traits<typename sprout::fixed::result_of::push_front_n<N, Container, T, Values...>::type>::static_size
>::make(),
sprout::container_indexes<typename sprout::fixed::result_of::push_front_n<N, Container, T, Values...>::type>::make(),
sprout::internal_begin_offset(cont),
v,
values...

View file

@ -5,6 +5,7 @@
#include <sprout/index_tuple.hpp>
#include <sprout/container/traits.hpp>
#include <sprout/container/functions.hpp>
#include <sprout/container/indexes.hpp>
#include <sprout/iterator/operation.hpp>
namespace sprout {
@ -44,10 +45,7 @@ namespace sprout {
realign(Container const& cont, T const& v) {
return sprout::fixed::detail::realign_impl<typename sprout::fixed::result_of::realign<Container>::type>(
cont,
sprout::index_range<
0,
sprout::container_traits<typename sprout::fixed::result_of::realign<Container>::type>::static_size
>::make(),
sprout::container_indexes<typename sprout::fixed::result_of::realign<Container>::type>::make(),
sprout::size(cont),
v
);
@ -77,10 +75,7 @@ namespace sprout {
realign(Container const& cont) {
return sprout::fixed::detail::realign_impl<typename sprout::fixed::result_of::realign<Container>::type>(
cont,
sprout::index_range<
0,
sprout::container_traits<typename sprout::fixed::result_of::realign<Container>::type>::static_size
>::make(),
sprout::container_indexes<typename sprout::fixed::result_of::realign<Container>::type>::make(),
sprout::size(cont)
);
}

View file

@ -6,6 +6,7 @@
#include <sprout/index_tuple.hpp>
#include <sprout/container/traits.hpp>
#include <sprout/container/functions.hpp>
#include <sprout/container/indexes.hpp>
#include <sprout/operation/fixed/realign.hpp>
namespace sprout {
@ -29,10 +30,7 @@ namespace sprout {
realign_to(Container const& cont, T const& v) {
return sprout::fixed::detail::realign_impl<typename sprout::fixed::result_of::realign_to<Result, Container>::type>(
cont,
sprout::index_range<
0,
sprout::container_traits<typename sprout::fixed::result_of::realign_to<Result, Container>::type>::static_size
>::make(),
sprout::container_indexes<typename sprout::fixed::result_of::realign_to<Result, Container>::type>::make(),
sprout::size(cont),
v
);
@ -46,10 +44,7 @@ namespace sprout {
realign_to(Container const& cont) {
return sprout::fixed::detail::realign_impl<typename sprout::fixed::result_of::realign_to<Result, Container>::type>(
cont,
sprout::index_range<
0,
sprout::container_traits<typename sprout::fixed::result_of::realign_to<Result, Container>::type>::static_size
>::make(),
sprout::container_indexes<typename sprout::fixed::result_of::realign_to<Result, Container>::type>::make(),
sprout::size(cont)
);
}

View file

@ -6,6 +6,7 @@
#include <sprout/index_tuple.hpp>
#include <sprout/container/traits.hpp>
#include <sprout/container/functions.hpp>
#include <sprout/container/indexes.hpp>
#include <sprout/iterator/operation.hpp>
namespace sprout {
@ -48,10 +49,7 @@ namespace sprout {
resize(Container const& cont, T const& v) {
return sprout::fixed::detail::resize_impl<typename sprout::fixed::result_of::resize<N, Container>::type>(
cont,
sprout::index_range<
0,
sprout::container_traits<typename sprout::fixed::result_of::resize<N, Container>::type>::static_size
>::make(),
sprout::container_indexes<typename sprout::fixed::result_of::resize<N, Container>::type>::make(),
sprout::size(cont),
v
);
@ -81,10 +79,7 @@ namespace sprout {
resize(Container const& cont) {
return sprout::fixed::detail::resize_impl<typename sprout::fixed::result_of::resize<N, Container>::type>(
cont,
sprout::index_range<
0,
sprout::container_traits<typename sprout::fixed::result_of::resize<N, Container>::type>::static_size
>::make(),
sprout::container_indexes<typename sprout::fixed::result_of::resize<N, Container>::type>::make(),
sprout::size(cont)
);
}

View file

@ -6,6 +6,7 @@
#include <sprout/index_tuple.hpp>
#include <sprout/container/traits.hpp>
#include <sprout/container/functions.hpp>
#include <sprout/container/indexes.hpp>
#include <sprout/iterator/operation.hpp>
#include <sprout/operation/fixed/resize.hpp>
@ -47,10 +48,7 @@ namespace sprout {
resize_backward(Container const& cont, T const& v) {
return sprout::fixed::detail::resize_backward_impl<typename sprout::fixed::result_of::resize_backward<N, Container>::type>(
cont,
sprout::index_range<
0,
sprout::container_traits<typename sprout::fixed::result_of::resize_backward<N, Container>::type>::static_size
>::make(),
sprout::container_indexes<typename sprout::fixed::result_of::resize_backward<N, Container>::type>::make(),
sprout::size(cont),
static_cast<typename sprout::container_traits<Container>::difference_type>(
sprout::container_traits<typename sprout::fixed::result_of::resize_backward<N, Container>::type>::static_size
@ -85,10 +83,7 @@ namespace sprout {
resize_backward(Container const& cont) {
return sprout::fixed::detail::resize_backward_impl<typename sprout::fixed::result_of::resize_backward<N, Container>::type>(
cont,
sprout::index_range<
0,
sprout::container_traits<typename sprout::fixed::result_of::resize_backward<N, Container>::type>::static_size
>::make(),
sprout::container_indexes<typename sprout::fixed::result_of::resize_backward<N, Container>::type>::make(),
sprout::size(cont),
static_cast<typename sprout::container_traits<Container>::difference_type>(
sprout::container_traits<typename sprout::fixed::result_of::resize_backward<N, Container>::type>::static_size

View file

@ -5,6 +5,7 @@
#include <sprout/index_tuple.hpp>
#include <sprout/container/traits.hpp>
#include <sprout/container/functions.hpp>
#include <sprout/container/indexes.hpp>
#include <sprout/iterator/operation.hpp>
namespace sprout {
@ -46,10 +47,7 @@ namespace sprout {
set(Container const& cont, typename sprout::container_traits<Container>::const_iterator pos, T const& v) {
return sprout::fixed::detail::set_impl<typename sprout::fixed::result_of::set<Container, T>::type>(
cont,
sprout::index_range<
0,
sprout::container_traits<typename sprout::fixed::result_of::set<Container, T>::type>::static_size
>::make(),
sprout::container_indexes<typename sprout::fixed::result_of::set<Container, T>::type>::make(),
sprout::distance(sprout::internal_begin(cont), pos),
v
);
@ -59,10 +57,7 @@ namespace sprout {
set(Container const& cont, typename sprout::container_traits<Container>::difference_type pos, T const& v) {
return sprout::fixed::detail::set_impl<typename sprout::fixed::result_of::set<Container, T>::type>(
cont,
sprout::index_range<
0,
sprout::container_traits<typename sprout::fixed::result_of::set<Container, T>::type>::static_size
>::make(),
sprout::container_indexes<typename sprout::fixed::result_of::set<Container, T>::type>::make(),
sprout::distance(sprout::internal_begin(cont), sprout::next(sprout::begin(cont), pos)),
v
);

View file

@ -60,13 +60,13 @@ namespace sprout {
-> decltype(
sprout::adaptors::detail::apply_adaptors_tuple_impl(
sprout::forward<Range>(range), adaptors,
sprout::index_range<0, sprout::tuples::tuple_size<AdaptorsTuple>::value>::make()
sprout::make_index_tuple<sprout::tuples::tuple_size<AdaptorsTuple>::value>::make()
)
)
{
return sprout::adaptors::detail::apply_adaptors_tuple_impl(
sprout::forward<Range>(range), adaptors,
sprout::index_range<0, sprout::tuples::tuple_size<AdaptorsTuple>::value>::make()
sprout::make_index_tuple<sprout::tuples::tuple_size<AdaptorsTuple>::value>::make()
);
}
} // namespace detail

View file

@ -111,7 +111,7 @@ namespace sprout {
return sprout::detail::string_concat(
lhs, lhs.size(),
rhs,
sprout::index_range<0, N + 1>::make()
sprout::make_index_tuple<N + 1>::make()
);
}
template<typename T, std::size_t N, typename Traits>
@ -120,7 +120,7 @@ namespace sprout {
return sprout::detail::string_concat(
lhs,
rhs, rhs.size(),
sprout::index_range<0, 1 + N>::make()
sprout::make_index_tuple<1 + N>::make()
);
}
template<typename T, std::size_t N, typename Traits, std::size_t M>
@ -130,7 +130,7 @@ namespace sprout {
return sprout::detail::string_concat(
lhs, lhs.size(),
rhs, traits_type::length(rhs, M - 1),
sprout::index_range<0, N + (M - 1)>::make()
sprout::make_index_tuple<N + (M - 1)>::make()
);
}
template<typename T, std::size_t N, typename Traits, std::size_t M>
@ -140,7 +140,7 @@ namespace sprout {
return sprout::detail::string_concat(
lhs, traits_type::length(lhs, M - 1),
rhs, rhs.size(),
sprout::index_range<0, (M - 1) + N>::make()
sprout::make_index_tuple<(M - 1) + N>::make()
);
}
template<typename T, std::size_t N1, std::size_t N2, typename Traits>
@ -149,7 +149,7 @@ namespace sprout {
return sprout::detail::string_concat(
lhs, lhs.size(),
rhs, rhs.size(),
sprout::index_range<0, N1 + N2>::make()
sprout::make_index_tuple<N1 + N2>::make()
);
}
} // namespace sprout

View file

@ -65,7 +65,7 @@ namespace sprout {
float_to_string(FloatType val, bool negative, int digits) {
return sprout::detail::float_to_string_impl<Elem>(
val, negative, digits, static_cast<int>((val - sprout::floor(val)) * sprout::detail::int_pow<int>(sprout::detail::decimal_places_length)),
sprout::index_range<0, sprout::printed_float_digits<FloatType>::value - 1>::make()
sprout::make_index_tuple<sprout::printed_float_digits<FloatType>::value - 1>::make()
);
}
} // namespace detail
@ -164,7 +164,7 @@ namespace sprout {
val < 0,
sprout::detail::float_exponent10(val),
NS_SSCRISK_CEL_OR_SPROUT::max(sprout::detail::int_digits(sprout::detail::float_exponent10(val)), 2),
sprout::index_range<0, sprout::printed_float_exp_digits<FloatType>::value - 1>::make()
sprout::make_index_tuple<sprout::printed_float_exp_digits<FloatType>::value - 1>::make()
);
}

View file

@ -80,7 +80,7 @@ namespace sprout {
return sprout::detail::int_to_string<Elem, Base>(
val,
sprout::detail::int_digits<Base>(val),
sprout::index_range<0, sprout::integer_digits<IntType, Base>::value>::make()
sprout::make_index_tuple<sprout::integer_digits<IntType, Base>::value>::make()
);
}

View file

@ -45,7 +45,7 @@ namespace sprout {
return implicit_conversion_impl(
holder_.get().elems,
NS_SSCRISK_CEL_OR_SPROUT::min(N2, holder_.get().len),
sprout::index_range<0, NS_SSCRISK_CEL_OR_SPROUT::min(N2, N)>::make()
sprout::make_index_tuple<(N < N2 ? N : N2)>::make()
);
}
};

View file

@ -92,7 +92,7 @@ namespace sprout {
public:
static SPROUT_CONSTEXPR basic_string from_c_str(T const* s, size_type n) {
return !(N < n)
? from_c_str_impl(s, n, sprout::index_range<0, N>::make())
? from_c_str_impl(s, n, sprout::make_index_tuple<N>::make())
: throw std::out_of_range("basic_string<>: index out of range")
;
}
@ -490,7 +490,7 @@ namespace sprout {
SPROUT_CONSTEXPR operator basic_string<T, N2, Traits>() const {
return implicit_conversion_impl(
elems, size(),
sprout::index_range<0, N2>::make()
sprout::make_index_tuple<N2>::make()
);
}
#if SPROUT_USE_EXPLICIT_CONVERSION_OPERATORS
@ -721,7 +721,7 @@ namespace sprout {
make(Args&&... args) {
return make_impl(
length(args...),
sprout::index_range<0, sizeof...(Args)>::make(),
sprout::make_index_tuple<sizeof...(Args)>::make(),
sprout::forward<Args>(args)...
);
}
@ -730,7 +730,7 @@ namespace sprout {
make(typename copied_type::size_type size, Args&&... args) {
return make_impl(
size,
sprout::index_range<0, sizeof...(Args)>::make(),
sprout::make_index_tuple<sizeof...(Args)>::make(),
sprout::forward<Args>(args)...
);
}
@ -751,7 +751,7 @@ namespace sprout {
inline SPROUT_CONSTEXPR sprout::basic_string<T, N - 1>
to_string_impl(T const(& arr)[N]) {
typedef sprout::char_traits_helper<typename sprout::basic_string<T, N - 1>::traits_type> helper_type;
return to_string_impl_1(arr, helper_type::length(arr, N - 1), sprout::index_range<0, N - 1>::make());
return to_string_impl_1(arr, helper_type::length(arr, N - 1), sprout::make_index_tuple<N - 1>::make());
}
} // namespace detail
//

View file

@ -203,7 +203,7 @@ namespace sprout {
: impl_type(
array_tag(),
arr,
sprout::index_range<0, enumerable_size>::make(),
sprout::make_index_tuple<enumerable_size>::make(),
first,
last
)
@ -212,7 +212,7 @@ namespace sprout {
: impl_type(
array_tag(),
arr,
sprout::index_range<0, enumerable_size>::make(),
sprout::make_index_tuple<enumerable_size>::make(),
to_first,
to_last
)
@ -221,7 +221,7 @@ namespace sprout {
: impl_type(
array_tag(),
impl_type::template to_param<Container>(other.array_),
sprout::index_range<0, enumerable_size>::make(),
sprout::make_index_tuple<enumerable_size>::make(),
sprout::distance(sprout::begin(other.get_array()), first),
sprout::distance(sprout::begin(other.get_array()), last)
)
@ -230,7 +230,7 @@ namespace sprout {
: impl_type(
array_tag(),
impl_type::template to_param<Container>(other.array_),
sprout::index_range<0, enumerable_size>::make(),
sprout::make_index_tuple<enumerable_size>::make(),
other.to_first_ + to_first,
other.to_first_ + to_last
)

View file

@ -6,6 +6,7 @@
#include <sprout/index_tuple.hpp>
#include <sprout/tuple/traits.hpp>
#include <sprout/tuple/functions.hpp>
#include <sprout/tuple/indexes.hpp>
namespace sprout {
namespace tuples {
@ -43,7 +44,7 @@ namespace sprout {
return sprout::tuples::detail::copy_impl<typename sprout::tuples::result_of::copy<Tuple, InputTuple>::type>(
t, input,
sprout::index_range<sprout::tuples::tuple_size<InputTuple>::value, sprout::tuples::tuple_size<Tuple>::value>::make(),
sprout::index_range<0, sprout::tuples::tuple_size<InputTuple>::value>::make()
sprout::tuple_indexes<InputTuple>::make()
);
}
template<typename Tuple, typename InputTuple>
@ -55,7 +56,7 @@ namespace sprout {
return sprout::tuples::detail::copy_impl<typename sprout::tuples::result_of::copy<Tuple, InputTuple>::type>(
t, input,
sprout::index_tuple<>(),
sprout::index_range<0, sprout::tuples::tuple_size<Tuple>::value>::make()
sprout::tuple_indexes<Tuple>::make()
);
}
} // namespace detail

View file

@ -7,6 +7,7 @@
#include <sprout/index_tuple.hpp>
#include <sprout/tuple/tuple/tuple.hpp>
#include <sprout/tuple/tuple/get.hpp>
#include <sprout/tuple/indexes.hpp>
#include <sprout/utility/forward.hpp>
namespace sprout {
@ -35,7 +36,7 @@ namespace sprout {
struct result
: public result_impl<
Tuple,
typename sprout::index_range<0, sprout::tuples::tuple_size<typename std::remove_reference<Tuple>::type>::value>::type
typename sprout::tuple_indexes<typename std::remove_reference<Tuple>::type>::type
>
{};
private:
@ -60,7 +61,7 @@ namespace sprout {
operator()(Tuple&& t) const {
return call<typename result<Tuple>::type>(
sprout::forward<Tuple>(t),
sprout::index_range<0, sprout::tuples::tuple_size<typename std::remove_reference<Tuple>::type>::value>::make()
sprout::tuple_indexes<typename std::remove_reference<Tuple>::type>::make()
);
}
};

View file

@ -15,7 +15,7 @@ namespace sprout {
template<typename Tuple>
struct tuple_indexes
: public sprout::detail::make_indexes_helper<
sprout::index_range<0, sprout::tuples::tuple_size<Tuple>::value>
sprout::make_index_tuple<sprout::tuples::tuple_size<Tuple>::value>
>
{};
} // namespace tuples

View file

@ -5,6 +5,7 @@
#include <sprout/index_tuple.hpp>
#include <sprout/tuple/tuple.hpp>
#include <sprout/tuple/functions.hpp>
#include <sprout/tuple/indexes.hpp>
#include <sprout/type/operation/append_back.hpp>
namespace sprout {
@ -42,8 +43,8 @@ namespace sprout {
append_back(Tuple const& t, InputTuple const& input) {
return sprout::tuples::detail::append_back_impl<typename sprout::tuples::result_of::append_back<Tuple, InputTuple>::type>(
t, input,
sprout::index_range<0, sprout::tuples::tuple_size<Tuple>::value>::make(),
sprout::index_range<0, sprout::tuples::tuple_size<InputTuple>::value>::make()
sprout::tuple_indexes<Tuple>::make(),
sprout::tuple_indexes<InputTuple>::make()
);
}
} // namespace tuples

View file

@ -5,6 +5,7 @@
#include <sprout/index_tuple.hpp>
#include <sprout/tuple/tuple.hpp>
#include <sprout/tuple/functions.hpp>
#include <sprout/tuple/indexes.hpp>
#include <sprout/type/operation/append_front.hpp>
namespace sprout {
@ -42,8 +43,8 @@ namespace sprout {
append_front(Tuple const& t, InputTuple const& input) {
return sprout::tuples::detail::append_front_impl<typename sprout::tuples::result_of::append_front<Tuple, InputTuple>::type>(
t, input,
sprout::index_range<0, sprout::tuples::tuple_size<Tuple>::value>::make(),
sprout::index_range<0, sprout::tuples::tuple_size<InputTuple>::value>::make()
sprout::tuple_indexes<Tuple>::make(),
sprout::tuple_indexes<InputTuple>::make()
);
}
} // namespace tuples

View file

@ -37,7 +37,7 @@ namespace sprout {
pop_back(Tuple const& t) {
return sprout::tuples::detail::pop_back_impl<typename sprout::tuples::result_of::pop_back<Tuple>::type>(
t,
sprout::index_range<0, sprout::tuples::tuple_size<Tuple>::value - 1>::make()
sprout::make_index_tuple<sprout::tuples::tuple_size<Tuple>::value - 1>::make()
);
}
} // namespace tuples

View file

@ -5,6 +5,7 @@
#include <sprout/index_tuple.hpp>
#include <sprout/tuple/tuple.hpp>
#include <sprout/tuple/functions.hpp>
#include <sprout/tuple/indexes.hpp>
#include <sprout/type/operation/push_back.hpp>
namespace sprout {
@ -38,7 +39,7 @@ namespace sprout {
push_back(Tuple const& t, Args const&... args) {
return sprout::tuples::detail::push_back_impl<typename sprout::tuples::result_of::push_back<Tuple, Args...>::type>(
t,
sprout::index_range<0, sprout::tuples::tuple_size<Tuple>::value>::make(),
sprout::tuple_indexes<Tuple>::make(),
args...
);
}

View file

@ -5,6 +5,7 @@
#include <sprout/index_tuple.hpp>
#include <sprout/tuple/tuple.hpp>
#include <sprout/tuple/functions.hpp>
#include <sprout/tuple/indexes.hpp>
#include <sprout/type/operation/push_front.hpp>
namespace sprout {
@ -38,7 +39,7 @@ namespace sprout {
push_front(Tuple const& t, Args const&... args) {
return sprout::tuples::detail::push_front_impl<typename sprout::tuples::result_of::push_front<Tuple, Args...>::type>(
t,
sprout::index_range<0, sprout::tuples::tuple_size<Tuple>::value>::make(),
sprout::tuple_indexes<Tuple>::make(),
args...
);
}

View file

@ -4,6 +4,7 @@
#include <sprout/config.hpp>
#include <sprout/index_tuple.hpp>
#include <sprout/tuple/tuple.hpp>
#include <sprout/tuple/indexes.hpp>
#include <sprout/type/rebind_types.hpp>
#include <sprout/utility/forward.hpp>
@ -67,7 +68,7 @@ namespace sprout {
public:
typedef typename sprout::tuples::detail::default_copied<
Tuple,
typename sprout::index_range<0, sprout::tuples::tuple_size<Tuple>::value>::type
typename sprout::tuple_indexes<Tuple>::type
>::type copied_type;
public:
template<typename Tup>

View file

@ -26,7 +26,7 @@ namespace sprout {
hash_value(sprout::tuples::tuple<Types...> const& v) {
return sprout::tuples::detail::tuple_hash_value_impl(
v,
sprout::index_range<0, sprout::tuples::tuple_size<sprout::tuples::tuple<Types...> >::value>::make()
sprout::make_index_tuple<sizeof...(Types)>::make()
);
}
} // namespace tuples

View file

@ -7,6 +7,7 @@
#include <sprout/utility/forward.hpp>
#include <sprout/tuple/tuple/tuple.hpp>
#include <sprout/tuple/tuple/get.hpp>
#include <sprout/tuple/indexes.hpp>
namespace sprout {
namespace tuples {
@ -57,7 +58,7 @@ namespace sprout {
};
public:
typedef typename make<
Tuple, typename sprout::index_range<0, sprout::tuples::tuple_size<Tuple>::value>::type
Tuple, typename sprout::tuple_indexes<Tuple>::type
>::type type;
};
template<typename T, typename U, typename... Tuples>
@ -76,8 +77,8 @@ namespace sprout {
public:
typedef typename sprout::tuples::result_of::detail::tuple_cat_impl<
typename make<
T, typename sprout::index_range<0, sprout::tuples::tuple_size<T>::value>::type,
U, typename sprout::index_range<0, sprout::tuples::tuple_size<U>::value>::type
T, typename sprout::tuple_indexes<T>::type,
U, typename sprout::tuple_indexes<U>::type
>::type,
Tuples...
>::type type;
@ -104,9 +105,7 @@ namespace sprout {
};
template<typename Head, typename... Tail>
struct tuple_cat_1st_indexes<Head, Tail...>
: public sprout::index_range<
0, sprout::tuples::tuple_size<typename std::remove_reference<Head>::type>::value
>
: public sprout::tuple_indexes<typename std::remove_reference<Head>::type>
{};
template<typename Result, typename IndexTuple, typename... Tuples>

View file

@ -264,7 +264,7 @@ namespace sprout {
template<typename... UTypes>
struct is_flexibly_convert_constructible
: public is_flexibly_convert_constructible_impl<
typename sprout::index_range<0, (sizeof...(UTypes) < sizeof...(Types) ? sizeof...(UTypes) : sizeof...(Types))>::type,
typename sprout::make_index_tuple<(sizeof...(UTypes) < sizeof...(Types) ? sizeof...(UTypes) : sizeof...(Types))>::type,
UTypes...
>
{};

View file

@ -5,6 +5,7 @@
#include <sprout/index_tuple.hpp>
#include <sprout/type/tuple.hpp>
#include <sprout/type/rebind_types.hpp>
#include <sprout/tuple/indexes.hpp>
namespace sprout {
namespace types {
@ -27,8 +28,8 @@ namespace sprout {
{};
public:
typedef typename apply_impl<
typename sprout::index_range<0, sprout::types::tuple_size<Tuple>::value>::type,
typename sprout::index_range<0, sprout::types::tuple_size<InputTuple>::value>::type
typename sprout::tuple_indexes<Tuple>::type,
typename sprout::tuple_indexes<InputTuple>::type
>::type type;
};
} // namespace types

View file

@ -5,6 +5,7 @@
#include <sprout/index_tuple.hpp>
#include <sprout/type/tuple.hpp>
#include <sprout/type/rebind_types.hpp>
#include <sprout/tuple/indexes.hpp>
namespace sprout {
namespace types {
@ -27,8 +28,8 @@ namespace sprout {
{};
public:
typedef typename apply_impl<
typename sprout::index_range<0, sprout::types::tuple_size<Tuple>::value>::type,
typename sprout::index_range<0, sprout::types::tuple_size<InputTuple>::value>::type
typename sprout::tuple_indexes<Tuple>::type,
typename sprout::tuple_indexes<InputTuple>::type
>::type type;
};
} // namespace types

View file

@ -26,7 +26,7 @@ namespace sprout {
{};
public:
typedef typename apply_impl<
typename sprout::index_range<0, sprout::types::tuple_size<Tuple>::value - 1>::type
typename sprout::make_index_tuple<sprout::types::tuple_size<Tuple>::value - 1>::type
>::type type;
};
} // namespace types

View file

@ -5,6 +5,7 @@
#include <sprout/index_tuple.hpp>
#include <sprout/type/tuple.hpp>
#include <sprout/type/rebind_types.hpp>
#include <sprout/tuple/indexes.hpp>
namespace sprout {
namespace types {
@ -28,7 +29,7 @@ namespace sprout {
{};
public:
typedef typename apply_impl<
typename sprout::index_range<0, sprout::types::tuple_size<Tuple>::value>::type
typename sprout::tuple_indexes<Tuple>::type
>::type type;
};
} // namespace types

View file

@ -5,6 +5,7 @@
#include <sprout/index_tuple.hpp>
#include <sprout/type/tuple.hpp>
#include <sprout/type/rebind_types.hpp>
#include <sprout/tuple/indexes.hpp>
namespace sprout {
namespace types {
@ -28,7 +29,7 @@ namespace sprout {
{};
public:
typedef typename apply_impl<
typename sprout::index_range<0, sprout::types::tuple_size<Tuple>::value>::type
typename sprout::tuple_indexes<Tuple>::type
>::type type;
};
} // namespace types

View file

@ -36,7 +36,7 @@ namespace sprout {
};
public:
typedef typename impl<
typename sprout::index_range<0, sprout::size(Proxy()())>::type
typename sprout::make_index_tuple<sprout::size(Proxy()())>::type
>::type type;
};
namespace detail {

View file

@ -53,7 +53,7 @@ namespace sprout {
sprout::types::detail::str_length<Sequence>::value
> to_string_constant() {
return sprout::types::detail::to_string_constant_impl<Sequence>(
sprout::index_range<0, sprout::types::detail::str_length<Sequence>::value>::make()
sprout::make_index_tuple<sprout::types::detail::str_length<Sequence>::value>::make()
);
}
} // namespace types

View file

@ -80,8 +80,8 @@ namespace sprout {
: pair(
first_args,
second_args,
sprout::index_range<0, sizeof...(Args1)>::make(),
sprout::index_range<0, sizeof...(Args2)>::make()
sprout::make_index_tuple<sizeof...(Args1)>::make(),
sprout::make_index_tuple<sizeof...(Args2)>::make()
)
{}
#endif // #if SPROUT_USE_DELEGATING_CONSTRUCTORS

View file

@ -12,6 +12,7 @@
#include <sprout/utility/swap.hpp>
#include <sprout/tuple/tuple.hpp>
#include <sprout/tuple/functions.hpp>
#include <sprout/tuple/indexes.hpp>
#include <sprout/type_traits/common_decay.hpp>
#include <sprout/type/type_tuple.hpp>
#include <sprout/type/algorithm/find_index.hpp>
@ -49,7 +50,7 @@ namespace sprout {
{}
template<typename T, typename Index>
SPROUT_CONSTEXPR variant_impl(T&& operand, Index)
: tuple_(init(sprout::forward<T>(operand), sprout::index_range<0, Index::value>::make()))
: tuple_(init(sprout::forward<T>(operand), sprout::make_index_tuple<Index::value>::make()))
, which_(Index::value)
{
static_assert(Index::value < sizeof...(Types), "variant<>: invalid operand");
@ -113,7 +114,7 @@ namespace sprout {
&& !sprout::has_result_type<sprout::weak_result_type<Visitor> >::value
>::type
>
: public visitor_result_impl_2<Visitor, Tuple, typename sprout::index_range<0, sprout::tuples::tuple_size<Tuple>::value>::type>
: public visitor_result_impl_2<Visitor, Tuple, typename sprout::tuple_indexes<Tuple>::type>
{};
template<typename Visitor, typename Tuple>
struct visitor_result_impl<
@ -123,7 +124,7 @@ namespace sprout {
&& !sprout::has_result_type<sprout::weak_result_type<Visitor> >::value
>::type
>
: public visitor_result_impl_1<Visitor, Tuple, typename sprout::index_range<0, sprout::tuples::tuple_size<Tuple>::value>::type>
: public visitor_result_impl_1<Visitor, Tuple, typename sprout::tuple_indexes<Tuple>::type>
{};
public:
// visitation support