1
0
Fork 0
mirror of https://github.com/bolero-MURAKAMI/Sprout synced 2025-08-03 12:49:50 +00:00

sprout/weed/parser/directive/as_array.hpp 追加

sprout/weed/parser/directive/as_tuple.hpp 追加
This commit is contained in:
bolero-MURAKAMI 2012-01-10 23:57:46 +09:00
parent a110b0ad0f
commit e731c3caf4
4 changed files with 200 additions and 2 deletions

View file

@ -13,15 +13,29 @@ namespace sprout {
//
namespace detail {
template<std::size_t N, typename Head, typename... Tail>
struct tppack_at_impl {
struct tppack_at_impl_1 {
public:
typedef typename sprout::detail::tppack_at_impl<N - 1, Tail...>::type type;
};
template<typename Head, typename... Tail>
struct tppack_at_impl<0, Head, Tail...> {
struct tppack_at_impl_1<0, Head, Tail...> {
public:
typedef Head type;
};
template<
std::size_t N,
typename... Args,
typename std::enable_if<(N < sizeof...(Args))>::type*& = sprout::enabler
>
struct tppack_at_impl
: public sprout::detail::tppack_at_impl_1<N, Args...>
{};
template<
std::size_t N,
typename... Args,
typename std::enable_if<(N >= sizeof...(Args))>::type*& = sprout::enabler
>
struct tppack_at_impl {};
} // namespace detail
template<std::size_t N, typename... Args>
struct tppack_at