mirror of
https://github.com/boostorg/mp11.git
synced 2025-12-04 07:49:20 +01:00
Add mp_list_c, mp_from_sequence
This commit is contained in:
@@ -287,7 +287,7 @@ template<class L, std::size_t N> using mp_drop_c = typename detail::mp_drop_impl
|
||||
|
||||
template<class L, class N> using mp_drop = typename detail::mp_drop_impl<L, mp_repeat<mp_list<void>, N>>::type;
|
||||
|
||||
// mp_iota(_c)<N>
|
||||
// mp_from_sequence<S>
|
||||
namespace detail
|
||||
{
|
||||
|
||||
@@ -298,12 +298,13 @@ template<template<class T, T... I> class S, class U, U... J> struct mp_from_sequ
|
||||
using type = mp_list<std::integral_constant<U, J>...>;
|
||||
};
|
||||
|
||||
template<class S> using mp_from_sequence = typename mp_from_sequence_impl<S>::type;
|
||||
|
||||
} // namespace detail
|
||||
|
||||
template<std::size_t N> using mp_iota_c = detail::mp_from_sequence<make_index_sequence<N>>;
|
||||
template<class N> using mp_iota = detail::mp_from_sequence<make_integer_sequence<typename std::remove_const<decltype(N::value)>::type, N::value>>;
|
||||
template<class S> using mp_from_sequence = typename detail::mp_from_sequence_impl<S>::type;
|
||||
|
||||
// mp_iota(_c)<N>
|
||||
template<std::size_t N> using mp_iota_c = mp_from_sequence<make_index_sequence<N>>;
|
||||
template<class N> using mp_iota = mp_from_sequence<make_integer_sequence<typename std::remove_const<decltype(N::value)>::type, N::value>>;
|
||||
|
||||
// mp_at(_c)<L, I>
|
||||
namespace detail
|
||||
|
||||
@@ -13,12 +13,16 @@
|
||||
#include <boost/mp11/detail/mp_append.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
#include <type_traits>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace mp11
|
||||
{
|
||||
|
||||
// mp_list_c<T, I...>
|
||||
template<class T, T... I> using mp_list_c = mp_list<std::integral_constant<T, I>...>;
|
||||
|
||||
// mp_is_list<L>
|
||||
namespace detail
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user