fix inherit_if_xxx decltype

This commit is contained in:
bolero-MURAKAMI 2012-05-14 11:33:36 +09:00
parent e4a0f7549b
commit 3a999dd70c
54 changed files with 154 additions and 152 deletions

View file

@ -1,68 +1,68 @@
//
// Sprout C++ Library
//
// Copyright (c) 2012
// bolero-MURAKAMI : http://d.hatena.ne.jp/boleros/
// osyo-manga : http://d.hatena.ne.jp/osyo-manga/
//
// Readme:
// https://github.com/osyo-manga/cpp-half/blob/master/README
//
// License:
// Boost Software License - Version 1.0
// <http://www.boost.org/LICENSE_1_0.txt>
//
#include <sprout/weed.hpp>
#include <boost/mpl/print.hpp>
#include <boost/mpl/int.hpp>
#include <iostream>
//
// __TIME__ Parser
//
int
main(){
namespace w = sprout::weed;
//
// __TIME__ to Sprout.String
//
static constexpr auto time = sprout::to_string(__TIME__);
// static constexpr auto time = sprout::to_string("23:22:45");
//
// parse __TIME__
//
constexpr auto expr = w::int_ >> ':' >> w::int_ >> ':' >> w::int_;
static constexpr auto result = w::parse(time.begin(), time.end(), parser);
static_assert(result.success(), "failed parse");
//
// get result
//
static constexpr sprout::array<long long int, 3> result_attr = result.attr();
static constexpr auto hour = result_attr[0];
static constexpr auto minute = result_attr[1];
static constexpr auto second = result_attr[2];
// static_assert(hour == 23, "");
// static_assert(minute == 22, "");
// static_assert(second == 45, "");
std::cout << hour << std::endl;
std::cout << minute << std::endl;
std::cout << second << std::endl;
//
// compile time output
//
namespace m = boost::mpl;
typedef m::print<m::int_<hour>>::type hour_;
typedef m::print<m::int_<minute>>::type minute_;
typedef m::print<m::int_<second>>::type second_;
return 0;
}
//
// Sprout C++ Library
//
// Copyright (c) 2012
// bolero-MURAKAMI : http://d.hatena.ne.jp/boleros/
// osyo-manga : http://d.hatena.ne.jp/osyo-manga/
//
// Readme:
// https://github.com/osyo-manga/cpp-half/blob/master/README
//
// License:
// Boost Software License - Version 1.0
// <http://www.boost.org/LICENSE_1_0.txt>
//
#include <sprout/weed.hpp>
#include <boost/mpl/print.hpp>
#include <boost/mpl/int.hpp>
#include <iostream>
//
// __TIME__ Parser
//
int
main(){
namespace w = sprout::weed;
//
// __TIME__ to Sprout.String
//
static constexpr auto time = sprout::to_string(__TIME__);
// static constexpr auto time = sprout::to_string("23:22:45");
//
// parse __TIME__
//
constexpr auto expr = w::int_ >> ':' >> w::int_ >> ':' >> w::int_;
static constexpr auto result = w::parse(time.begin(), time.end(), parser);
static_assert(result.success(), "failed parse");
//
// get result
//
static constexpr sprout::array<long long int, 3> result_attr = result.attr();
static constexpr auto hour = result_attr[0];
static constexpr auto minute = result_attr[1];
static constexpr auto second = result_attr[2];
// static_assert(hour == 23, "");
// static_assert(minute == 22, "");
// static_assert(second == 45, "");
std::cout << hour << std::endl;
std::cout << minute << std::endl;
std::cout << second << std::endl;
//
// compile time output
//
namespace m = boost::mpl;
typedef m::print<m::int_<hour>>::type hour_;
typedef m::print<m::int_<minute>>::type minute_;
typedef m::print<m::int_<second>>::type second_;
return 0;
}

View file

@ -47,7 +47,7 @@ namespace sprout {
first,
last,
result,
typename sprout::index_range<0, sprout::container_traits<Result>::static_size>::type(),
sprout::index_range<0, sprout::container_traits<Result>::static_size>::make(),
sprout::internal_begin_offset(result),
sprout::size(result),
NS_SSCRISK_CEL_OR_SPROUT::distance(first, last)

View file

@ -48,7 +48,7 @@ namespace sprout {
first,
last,
result,
typename sprout::index_range<0, sprout::container_traits<Result>::static_size>::type(),
sprout::index_range<0, sprout::container_traits<Result>::static_size>::make(),
sprout::internal_end_offset(result),
sprout::size(result),
NS_SSCRISK_CEL_OR_SPROUT::distance(first, last)

View file

@ -42,7 +42,7 @@ namespace sprout {
return sprout::fixed::detail::fill_impl(
cont,
value,
typename sprout::index_range<0, sprout::container_traits<Container>::static_size>::type(),
sprout::index_range<0, sprout::container_traits<Container>::static_size>::make(),
sprout::internal_begin_offset(cont),
sprout::size(cont)
);

View file

@ -23,7 +23,7 @@ namespace sprout {
return sprout::fixed::detail::fill_impl(
cont,
value,
typename sprout::index_range<0, sprout::container_traits<Container>::static_size>::type(),
sprout::index_range<0, sprout::container_traits<Container>::static_size>::make(),
sprout::internal_begin_offset(cont),
n
);

View file

@ -54,7 +54,7 @@ namespace sprout {
result,
old_value,
new_value,
typename sprout::index_range<0, sprout::container_traits<Result>::static_size>::type(),
sprout::index_range<0, sprout::container_traits<Result>::static_size>::make(),
sprout::internal_begin_offset(result),
sprout::size(result),
NS_SSCRISK_CEL_OR_SPROUT::distance(first, last)

View file

@ -53,7 +53,7 @@ namespace sprout {
result,
pred,
new_value,
typename sprout::index_range<0, sprout::container_traits<Result>::static_size>::type(),
sprout::index_range<0, sprout::container_traits<Result>::static_size>::make(),
sprout::internal_begin_offset(result),
sprout::size(result),
NS_SSCRISK_CEL_OR_SPROUT::distance(first, last)

View file

@ -7,7 +7,7 @@
#include <sprout/index_tuple.hpp>
#include <sprout/container/traits.hpp>
#include <sprout/container/functions.hpp>
#include <sprout/iterator/operation.hpp>
#include <sprout/iterator/operation.hpp>
#include <sprout/algorithm/fixed/result_of.hpp>
#include <sprout/detail/container_complate.hpp>
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT
@ -47,7 +47,7 @@ namespace sprout {
first,
last,
result,
typename sprout::index_range<0, sprout::container_traits<Result>::static_size>::type(),
sprout::index_range<0, sprout::container_traits<Result>::static_size>::make(),
sprout::internal_begin_offset(result),
sprout::size(result),
NS_SSCRISK_CEL_OR_SPROUT::distance(first, last)

View file

@ -7,7 +7,7 @@
#include <sprout/index_tuple.hpp>
#include <sprout/container/traits.hpp>
#include <sprout/container/functions.hpp>
#include <sprout/iterator/operation.hpp>
#include <sprout/iterator/operation.hpp>
#include <sprout/algorithm/fixed/result_of.hpp>
#include <sprout/detail/container_complate.hpp>
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT
@ -53,7 +53,7 @@ namespace sprout {
middle,
last,
result,
typename sprout::index_range<0, sprout::container_traits<Result>::static_size>::type(),
sprout::index_range<0, sprout::container_traits<Result>::static_size>::make(),
sprout::internal_begin_offset(result),
sprout::size(result),
NS_SSCRISK_CEL_OR_SPROUT::distance(first, last)

View file

@ -103,7 +103,7 @@ namespace sprout {
{
return sprout::fixed::detail::shuffle_impl(
cont,
typename sprout::index_range<0, sprout::container_traits<Container>::static_size>::type(),
sprout::index_range<0, sprout::container_traits<Container>::static_size>::make(),
sprout::forward<UniformRandomNumberGenerator>(g),
sprout::internal_begin_offset(cont),
sprout::size(cont)

View file

@ -140,7 +140,7 @@ namespace sprout {
{
return sprout::fixed::detail::shuffle_result_impl(
cont,
typename sprout::index_range<0, sprout::container_traits<Container>::static_size>::type(),
sprout::index_range<0, sprout::container_traits<Container>::static_size>::make(),
sprout::forward<UniformRandomNumberGenerator>(g),
sprout::internal_begin_offset(cont),
sprout::size(cont)

View file

@ -57,7 +57,7 @@ namespace sprout {
result,
pos1,
pos2,
typename sprout::index_range<0, sprout::container_traits<Result>::static_size>::type(),
sprout::index_range<0, sprout::container_traits<Result>::static_size>::make(),
sprout::internal_begin_offset(result),
sprout::size(result),
NS_SSCRISK_CEL_OR_SPROUT::distance(first, last)

View file

@ -50,7 +50,7 @@ namespace sprout {
last,
result,
op,
typename sprout::index_range<0, sprout::container_traits<Result>::static_size>::type(),
sprout::index_range<0, sprout::container_traits<Result>::static_size>::make(),
sprout::internal_begin_offset(result),
sprout::size(result),
NS_SSCRISK_CEL_OR_SPROUT::distance(first, last)
@ -155,7 +155,7 @@ namespace sprout {
first2,
result,
op,
typename sprout::index_range<0, sprout::container_traits<Result>::static_size>::type(),
sprout::index_range<0, sprout::container_traits<Result>::static_size>::make(),
sprout::internal_begin_offset(result),
sprout::size(result),
NS_SSCRISK_CEL_OR_SPROUT::distance(first1, last1)

View file

@ -258,7 +258,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, typename sprout::index_range<0, N>::type());
return sprout::detail::to_array_impl(arr, sprout::index_range<0, N>::make());
}
//

View file

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

View file

@ -74,7 +74,7 @@ namespace sprout {
typename pass_through_impl::data_param d
) const
{
return call_impl(e, s, d, typename sprout::index_range<0, Arity>::type());
return call_impl(e, s, d, sprout::index_range<0, Arity>::make());
}
};
template<typename Grammar, typename Expr, typename State, typename Data>

View file

@ -106,12 +106,12 @@ namespace sprout {
width,
height,
depth_max,
typename sprout::index_range<
sprout::index_range<
0,
sprout::container_traits<
typename sprout::container_traits<Pixels>::value_type
>::static_size
>::type()
>::make()
)...
);
}
@ -162,10 +162,10 @@ namespace sprout {
width,
height,
depth_max,
typename sprout::index_range<
sprout::index_range<
0,
sprout::container_traits<Pixels>::static_size
>::type()
>::make()
);
}

View file

@ -180,7 +180,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, typename sprout::index_range<0, sizeof...(Args)>::type());
return call(arg, tuple, sprout::index_range<0, sizeof...(Args)>::make());
}
};
template<typename Arg>

View file

@ -44,7 +44,7 @@ namespace sprout {
first,
last,
result,
typename sprout::index_range<0, sprout::container_traits<Result>::static_size>::type(),
sprout::index_range<0, sprout::container_traits<Result>::static_size>::make(),
sprout::internal_begin_offset(result),
sprout::size(result),
NS_SSCRISK_CEL_OR_SPROUT::distance(first, last)

View file

@ -44,7 +44,7 @@ namespace sprout {
first,
last,
result,
typename sprout::index_range<0, sprout::container_traits<Result>::static_size>::type(),
sprout::index_range<0, sprout::container_traits<Result>::static_size>::make(),
sprout::internal_begin_offset(result),
sprout::size(result),
NS_SSCRISK_CEL_OR_SPROUT::distance(first, last)

View file

@ -53,7 +53,7 @@ namespace sprout {
first,
last,
result,
typename sprout::index_range<0, sprout::container_traits<Result>::static_size>::type(),
sprout::index_range<0, sprout::container_traits<Result>::static_size>::make(),
sprout::internal_begin_offset(result),
sprout::size(result),
NS_SSCRISK_CEL_OR_SPROUT::distance(first, last)

View file

@ -47,7 +47,7 @@ namespace sprout {
{
return sprout::fixed::detail::bitrev_table_impl(
cont,
typename sprout::index_range<0, sprout::container_traits<Container>::static_size>::type(),
sprout::index_range<0, sprout::container_traits<Container>::static_size>::make(),
sprout::empty(cont)
? 0
: sprout::bit_length(sprout::size(cont) - 1)

View file

@ -41,7 +41,7 @@ namespace sprout {
{
return sprout::fixed::detail::iota_impl(
cont,
typename sprout::index_range<0, sprout::container_traits<Container>::static_size>::type(),
sprout::index_range<0, sprout::container_traits<Container>::static_size>::make(),
value,
sprout::internal_begin_offset(cont),
sprout::size(cont)

View file

@ -62,7 +62,7 @@ namespace sprout {
{
return sprout::fixed::detail::append_impl<typename sprout::fixed::result_of::append<Container, Input>::type>(
cont,
typename sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::append<Container, Input>::type>::static_size>::type(),
sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::append<Container, Input>::type>::static_size>::make(),
NS_SSCRISK_CEL_OR_SPROUT::distance(sprout::internal_begin(cont), pos),
sprout::size(input),
input
@ -80,7 +80,7 @@ namespace sprout {
{
return sprout::fixed::detail::append_impl<typename sprout::fixed::result_of::append<Container, Input>::type>(
cont,
typename sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::append<Container, Input>::type>::static_size>::type(),
sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::append<Container, Input>::type>::static_size>::make(),
NS_SSCRISK_CEL_OR_SPROUT::distance(sprout::internal_begin(cont), sprout::next(sprout::begin(cont), pos)),
sprout::size(input),
input

View file

@ -31,7 +31,7 @@ namespace sprout {
{
return sprout::fixed::detail::append_impl<typename sprout::fixed::result_of::append_back<Container, Input>::type>(
cont,
typename sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::append_back<Container, Input>::type>::static_size>::type(),
sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::append_back<Container, Input>::type>::static_size>::make(),
sprout::internal_end_offset(cont),
sprout::size(input),
input

View file

@ -31,7 +31,7 @@ namespace sprout {
{
return sprout::fixed::detail::append_impl<typename sprout::fixed::result_of::append_front<Container, Input>::type>(
cont,
typename sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::append_front<Container, Input>::type>::static_size>::type(),
sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::append_front<Container, Input>::type>::static_size>::make(),
sprout::internal_begin_offset(cont),
sprout::size(input),
input

View file

@ -58,7 +58,7 @@ namespace sprout {
{
return sprout::fixed::detail::erase_impl<typename sprout::fixed::result_of::erase<Container>::type>(
cont,
typename sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::erase<Container>::type>::static_size>::type(),
sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::erase<Container>::type>::static_size>::make(),
NS_SSCRISK_CEL_OR_SPROUT::distance(sprout::internal_begin(cont), pos)
);
}
@ -73,7 +73,7 @@ namespace sprout {
{
return sprout::fixed::detail::erase_impl<typename sprout::fixed::result_of::erase<Container>::type>(
cont,
typename sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::erase<Container>::type>::static_size>::type(),
sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::erase<Container>::type>::static_size>::make(),
NS_SSCRISK_CEL_OR_SPROUT::distance(sprout::internal_begin(cont), sprout::next(sprout::begin(cont), pos))
);
}

View file

@ -59,7 +59,7 @@ namespace sprout {
{
return sprout::fixed::detail::erase_n_impl<N, typename sprout::fixed::result_of::erase_n<N, Container>::type>(
cont,
typename sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::erase_n<N, Container>::type>::static_size>::type(),
sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::erase_n<N, Container>::type>::static_size>::make(),
NS_SSCRISK_CEL_OR_SPROUT::distance(sprout::internal_begin(cont), pos)
);
}
@ -74,7 +74,7 @@ namespace sprout {
{
return sprout::fixed::detail::erase_n_impl<N, typename sprout::fixed::result_of::erase_n<N, Container>::type>(
cont,
typename sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::erase_n<N, Container>::type>::static_size>::type(),
sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::erase_n<N, Container>::type>::static_size>::make(),
NS_SSCRISK_CEL_OR_SPROUT::distance(sprout::internal_begin(cont), sprout::next(sprout::begin(cont), pos))
);
}

View file

@ -65,7 +65,7 @@ namespace sprout {
{
return sprout::fixed::detail::insert_impl<typename sprout::fixed::result_of::insert<Container, T, Values...>::type>(
cont,
typename sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::insert<Container, T, Values...>::type>::static_size>::type(),
sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::insert<Container, T, Values...>::type>::static_size>::make(),
NS_SSCRISK_CEL_OR_SPROUT::distance(sprout::internal_begin(cont), pos),
v,
values...
@ -84,7 +84,7 @@ namespace sprout {
{
return sprout::fixed::detail::insert_impl<typename sprout::fixed::result_of::insert<Container, T, Values...>::type>(
cont,
typename sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::insert<Container, T, Values...>::type>::static_size>::type(),
sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::insert<Container, T, Values...>::type>::static_size>::make(),
NS_SSCRISK_CEL_OR_SPROUT::distance(sprout::internal_begin(cont), sprout::next(sprout::begin(cont), pos)),
v,
values...

View file

@ -67,7 +67,7 @@ namespace sprout {
{
return sprout::fixed::detail::insert_n_impl<N, typename sprout::fixed::result_of::insert_n<N, Container, T, Values...>::type>(
cont,
typename sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::insert_n<N, Container, T, Values...>::type>::static_size>::type(),
sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::insert_n<N, Container, T, Values...>::type>::static_size>::make(),
NS_SSCRISK_CEL_OR_SPROUT::distance(sprout::internal_begin(cont), pos),
v,
values...
@ -86,7 +86,7 @@ namespace sprout {
{
return sprout::fixed::detail::insert_n_impl<N, typename sprout::fixed::result_of::insert_n<N, Container, T, Values...>::type>(
cont,
typename sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::insert_n<N, Container, T, Values...>::type>::static_size>::type(),
sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::insert_n<N, Container, T, Values...>::type>::static_size>::make(),
NS_SSCRISK_CEL_OR_SPROUT::distance(sprout::internal_begin(cont), sprout::next(sprout::begin(cont), pos)),
v,
values...

View file

@ -30,7 +30,7 @@ namespace sprout {
{
return sprout::fixed::detail::erase_impl<typename sprout::fixed::result_of::pop_back<Container>::type>(
cont,
typename sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::pop_back<Container>::type>::static_size>::type(),
sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::pop_back<Container>::type>::static_size>::make(),
sprout::internal_end_offset(cont) - 1
);
}

View file

@ -30,7 +30,7 @@ namespace sprout {
{
return sprout::fixed::detail::erase_n_impl<N, typename sprout::fixed::result_of::pop_back_n<N, Container>::type>(
cont,
typename sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::pop_back_n<N, Container>::type>::static_size>::type(),
sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::pop_back_n<N, Container>::type>::static_size>::make(),
sprout::internal_end_offset(cont) - N
);
}

View file

@ -30,7 +30,7 @@ namespace sprout {
{
return sprout::fixed::detail::erase_impl<typename sprout::fixed::result_of::pop_front<Container>::type>(
cont,
typename sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::pop_front<Container>::type>::static_size>::type(),
sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::pop_front<Container>::type>::static_size>::make(),
sprout::internal_begin_offset(cont)
);
}

View file

@ -30,7 +30,7 @@ namespace sprout {
{
return sprout::fixed::detail::erase_n_impl<N, typename sprout::fixed::result_of::pop_front_n<N, Container>::type>(
cont,
typename sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::pop_front_n<N, Container>::type>::static_size>::type(),
sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::pop_front_n<N, Container>::type>::static_size>::make(),
sprout::internal_begin_offset(cont)
);
}

View file

@ -32,7 +32,7 @@ namespace sprout {
{
return sprout::fixed::detail::insert_impl<typename sprout::fixed::result_of::push_back<Container, T, Values...>::type>(
cont,
typename sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::push_back<Container, T, Values...>::type>::static_size>::type(),
sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::push_back<Container, T, Values...>::type>::static_size>::make(),
sprout::internal_end_offset(cont),
v,
values...

View file

@ -32,7 +32,7 @@ namespace sprout {
{
return sprout::fixed::detail::insert_n_impl<N, typename sprout::fixed::result_of::push_back_n<N, Container, T, Values...>::type>(
cont,
typename sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::push_back_n<N, Container, T, Values...>::type>::static_size>::type(),
sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::push_back_n<N, Container, T, Values...>::type>::static_size>::make(),
sprout::internal_end_offset(cont),
v,
values...

View file

@ -32,7 +32,7 @@ namespace sprout {
{
return sprout::fixed::detail::insert_impl<typename sprout::fixed::result_of::push_front<Container, T, Values...>::type>(
cont,
typename sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::push_front<Container, T, Values...>::type>::static_size>::type(),
sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::push_front<Container, T, Values...>::type>::static_size>::make(),
sprout::internal_begin_offset(cont),
v,
values...

View file

@ -32,7 +32,7 @@ namespace sprout {
{
return sprout::fixed::detail::insert_n_impl<N, typename sprout::fixed::result_of::push_front_n<N, Container, T, Values...>::type>(
cont,
typename sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::push_front_n<N, Container, T, Values...>::type>::static_size>::type(),
sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::push_front_n<N, Container, T, Values...>::type>::static_size>::make(),
sprout::internal_begin_offset(cont),
v,
values...

View file

@ -48,7 +48,7 @@ namespace sprout {
{
return sprout::fixed::detail::realign_impl<typename sprout::fixed::result_of::realign<Container>::type>(
cont,
typename sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::realign<Container>::type>::static_size>::type(),
sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::realign<Container>::type>::static_size>::make(),
sprout::size(cont),
v
);
@ -80,7 +80,7 @@ namespace sprout {
{
return sprout::fixed::detail::realign_impl<typename sprout::fixed::result_of::realign<Container>::type>(
cont,
typename sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::realign<Container>::type>::static_size>::type(),
sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::realign<Container>::type>::static_size>::make(),
sprout::size(cont)
);
}

View file

@ -32,7 +32,7 @@ namespace sprout {
{
return sprout::fixed::detail::realign_impl<typename sprout::fixed::result_of::realign_to<Result, Container>::type>(
cont,
typename sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::realign_to<Result, Container>::type>::static_size>::type(),
sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::realign_to<Result, Container>::type>::static_size>::make(),
sprout::size(cont),
v
);
@ -48,7 +48,7 @@ namespace sprout {
{
return sprout::fixed::detail::realign_impl<typename sprout::fixed::result_of::realign_to<Result, Container>::type>(
cont,
typename sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::realign_to<Result, Container>::type>::static_size>::type(),
sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::realign_to<Result, Container>::type>::static_size>::make(),
sprout::size(cont)
);
}

View file

@ -53,7 +53,7 @@ namespace sprout {
{
return sprout::fixed::detail::resize_impl<typename sprout::fixed::result_of::resize<N, Container>::type>(
cont,
typename sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::resize<N, Container>::type>::static_size>::type(),
sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::resize<N, Container>::type>::static_size>::make(),
sprout::size(cont),
v
);
@ -84,7 +84,7 @@ namespace sprout {
)
{
return sprout::fixed::detail::resize_impl<typename sprout::fixed::result_of::resize<N, Container>::type>(
cont, typename sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::resize<N, Container>::type>::static_size>::type(),
cont, sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::resize<N, Container>::type>::static_size>::make(),
sprout::size(cont)
);
}

View file

@ -50,7 +50,7 @@ namespace sprout {
{
return sprout::fixed::detail::resize_backward_impl<typename sprout::fixed::result_of::resize_backward<N, Container>::type>(
cont,
typename sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::resize_backward<N, Container>::type>::static_size>::type(),
sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::resize_backward<N, Container>::type>::static_size>::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
@ -87,7 +87,7 @@ namespace sprout {
{
return sprout::fixed::detail::resize_backward_impl<typename sprout::fixed::result_of::resize_backward<N, Container>::type>(
cont,
typename sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::resize_backward<N, Container>::type>::static_size>::type(),
sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::resize_backward<N, Container>::type>::static_size>::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

@ -52,7 +52,7 @@ namespace sprout {
{
return sprout::fixed::detail::set_impl<typename sprout::fixed::result_of::set<Container, T>::type>(
cont,
typename sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::set<Container, T>::type>::static_size>::type(),
sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::set<Container, T>::type>::static_size>::make(),
NS_SSCRISK_CEL_OR_SPROUT::distance(sprout::internal_begin(cont), pos),
v
);
@ -69,7 +69,7 @@ namespace sprout {
{
return sprout::fixed::detail::set_impl<typename sprout::fixed::result_of::set<Container, T>::type>(
cont,
typename sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::set<Container, T>::type>::static_size>::type(),
sprout::index_range<0, sprout::container_traits<typename sprout::fixed::result_of::set<Container, T>::type>::static_size>::make(),
NS_SSCRISK_CEL_OR_SPROUT::distance(sprout::internal_begin(cont), sprout::next(sprout::begin(cont), pos)),
v
);

View file

@ -4,6 +4,7 @@
#include <cstddef>
#include <sprout/config.hpp>
#include <sprout/index_tuple.hpp>
#include <sprout/string/char_traits.hpp>
#include <sprout/string/string.hpp>
#include <sprout/utility/value_holder.hpp>
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT
@ -12,14 +13,12 @@ namespace sprout {
//
// shrink_string
//
template<typename T, std::size_t N, typename Traits>
template<typename T, std::size_t N, typename Traits = sprout::char_traits<T> >
class shrink_string {
public:
typedef sprout::basic_string<T, N, Traits> string_type;
private:
typedef sprout::value_holder<string_type const&> holder_type;
public:
typedef typename holder_type::param_type param_type;
private:
template<std::size_t M, sprout::index_t... Indexes>
static SPROUT_CONSTEXPR sprout::basic_string<T, sizeof...(Indexes), Traits> implicit_conversion_impl(
@ -35,9 +34,12 @@ namespace sprout {
public:
shrink_string(shrink_string const&) = default;
shrink_string(shrink_string&&) = default;
explicit SPROUT_CONSTEXPR shrink_string(param_type p)
: holder_(p)
SPROUT_CONSTEXPR shrink_string(string_type const& s)
: holder_(s)
{}
SPROUT_CONSTEXPR operator string_type const&() const {
return holder_.get();
}
template<std::size_t N2>
SPROUT_CONSTEXPR operator sprout::basic_string<T, N2, Traits>() const {
return implicit_conversion_impl(

View file

@ -112,7 +112,7 @@ namespace sprout {
public:
static SPROUT_CONSTEXPR basic_string<T, N, Traits> from_c_str(value_type const* s, size_type n) {
return !(N < n)
? from_c_str_impl(s, n, typename sprout::index_range<0, N>::type())
? from_c_str_impl(s, n, sprout::index_range<0, N>::make())
: throw std::out_of_range("basic_string<>: index out of range")
;
}
@ -357,7 +357,7 @@ namespace sprout {
return implicit_conversion_impl(
elems,
len,
typename sprout::index_range<0, N2>::type()
sprout::index_range<0, N2>::make()
);
}
pointer c_array() SPROUT_NOEXCEPT {
@ -522,7 +522,7 @@ namespace sprout {
} // namespace detail
template<typename T, std::size_t N>
inline SPROUT_CONSTEXPR sprout::basic_string<T, N - 1> to_string(T const(& arr)[N]) {
return sprout::detail::to_string_impl(arr, typename sprout::index_range<0, N - 1>::type());
return sprout::detail::to_string_impl(arr, sprout::index_range<0, N - 1>::make());
}
//

View file

@ -205,7 +205,7 @@ namespace sprout {
: impl_type(
array_tag(),
arr,
typename sprout::index_range<0, static_size>::type(),
sprout::index_range<0, static_size>::make(),
first,
last
)
@ -214,7 +214,7 @@ namespace sprout {
: impl_type(
array_tag(),
arr,
typename sprout::index_range<0, static_size>::type(),
sprout::index_range<0, static_size>::make(),
first,
last
)
@ -223,7 +223,7 @@ namespace sprout {
: impl_type(
array_tag(),
impl_type::template to_param<Container>(other.array_),
typename sprout::index_range<0, static_size>::type(),
sprout::index_range<0, static_size>::make(),
NS_SSCRISK_CEL_OR_SPROUT::distance(sprout::begin(other.get_array()), first),
NS_SSCRISK_CEL_OR_SPROUT::distance(sprout::begin(other.get_array()), last)
)
@ -232,7 +232,7 @@ namespace sprout {
: impl_type(
array_tag(),
impl_type::template to_param<Container>(other.array_),
typename sprout::index_range<0, static_size>::type(),
sprout::index_range<0, static_size>::make(),
first + other.first_,
last + other.first_
)

View file

@ -47,8 +47,8 @@ namespace sprout {
return sprout::tuples::detail::copy_impl<typename sprout::tuples::result_of::copy<Tuple, InputTuple>::type>(
t,
input,
typename sprout::index_range<sprout::tuples::tuple_size<InputTuple>::value, sprout::tuples::tuple_size<Tuple>::value>::type(),
typename sprout::index_range<0, sprout::tuples::tuple_size<InputTuple>::value>::type()
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()
);
}
template<typename Tuple, typename InputTuple>
@ -64,7 +64,7 @@ namespace sprout {
t,
input,
sprout::index_tuple<>(),
typename sprout::index_range<0, sprout::tuples::tuple_size<Tuple>::value>::type()
sprout::index_range<0, sprout::tuples::tuple_size<Tuple>::value>::make()
);
}
} // namespace detail

View file

@ -47,8 +47,8 @@ namespace sprout {
return sprout::tuples::detail::append_back_impl<typename sprout::tuples::result_of::append_back<Tuple, InputTuple>::type>(
t,
input,
typename sprout::index_range<0, sprout::tuples::tuple_size<Tuple>::value>::type(),
typename sprout::index_range<0, sprout::tuples::tuple_size<InputTuple>::value>::type()
sprout::index_range<0, sprout::tuples::tuple_size<Tuple>::value>::make(),
sprout::index_range<0, sprout::tuples::tuple_size<InputTuple>::value>::make()
);
}
} // namespace tuples

View file

@ -47,8 +47,8 @@ namespace sprout {
return sprout::tuples::detail::append_front_impl<typename sprout::tuples::result_of::append_front<Tuple, InputTuple>::type>(
t,
input,
typename sprout::index_range<0, sprout::tuples::tuple_size<Tuple>::value>::type(),
typename sprout::index_range<0, sprout::tuples::tuple_size<InputTuple>::value>::type()
sprout::index_range<0, sprout::tuples::tuple_size<Tuple>::value>::make(),
sprout::index_range<0, sprout::tuples::tuple_size<InputTuple>::value>::make()
);
}
} // namespace tuples

View file

@ -46,7 +46,7 @@ namespace sprout {
return sprout::tuples::detail::push_back_impl<typename sprout::tuples::result_of::push_back<Tuple, T>::type>(
t,
v,
typename sprout::index_range<0, sprout::tuples::tuple_size<Tuple>::value>::type()
sprout::index_range<0, sprout::tuples::tuple_size<Tuple>::value>::make()
);
}
} // namespace tuples

View file

@ -46,7 +46,7 @@ namespace sprout {
return sprout::tuples::detail::push_front_impl<typename sprout::tuples::result_of::push_front<Tuple, T>::type>(
t,
v,
typename sprout::index_range<0, sprout::tuples::tuple_size<Tuple>::value>::type()
sprout::index_range<0, sprout::tuples::tuple_size<Tuple>::value>::make()
);
}
} // namespace tuples

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>(
typename sprout::index_range<0, sprout::types::detail::str_length<Sequence>::value>::type()
sprout::index_range<0, sprout::types::detail::str_length<Sequence>::value>::make()
);
}
} // namespace types

View file

@ -48,10 +48,10 @@
typename std::enable_if<SPROUT_PP_CAT(SPROUT_PP_CAT(sprout_inherit_if_xxx_constant_def_impl_has_, CONSTANT), __LINE__)<T>::value>::type \
> { \
public: \
SPROUT_STATIC_CONSTEXPR decltype(T::CONSTANT) ALIAS = T::CONSTANT; \
SPROUT_STATIC_CONSTEXPR typename std::decay<decltype(T::CONSTANT)>::type ALIAS = T::CONSTANT; \
}; \
template<typename T> \
SPROUT_CONSTEXPR decltype(T::CONSTANT) NAME< \
SPROUT_CONSTEXPR typename std::decay<decltype(T::CONSTANT)>::type NAME< \
T, \
typename std::enable_if<SPROUT_PP_CAT(SPROUT_PP_CAT(sprout_inherit_if_xxx_constant_def_impl_has_, CONSTANT), __LINE__)<T>::value>::type \
>::ALIAS

View file

@ -38,7 +38,7 @@ namespace sprout {
{}
template<typename T, typename Index>
SPROUT_CONSTEXPR variant_impl(T&& operand, Index)
: tuple_(init(sprout::forward<T>(operand), typename sprout::index_range<0, Index::value>::type()))
: tuple_(init(sprout::forward<T>(operand), sprout::index_range<0, Index::value>::make()))
, which_(Index::value)
{
static_assert(Index::value < sizeof...(Types), "variant<>: invalid operand");