mirror of
https://github.com/boostorg/mp11.git
synced 2025-08-06 07:44:31 +02:00
Use __make_integer_seq when available
This commit is contained in:
@@ -1,15 +1,21 @@
|
|||||||
#ifndef BOOST_MP11_INTEGER_SEQUENCE_HPP_INCLUDED
|
#ifndef BOOST_MP11_INTEGER_SEQUENCE_HPP_INCLUDED
|
||||||
#define BOOST_MP11_INTEGER_SEQUENCE_HPP_INCLUDED
|
#define BOOST_MP11_INTEGER_SEQUENCE_HPP_INCLUDED
|
||||||
|
|
||||||
// Copyright 2015, 2017 Peter Dimov.
|
// Copyright 2015, 2017, 2019 Peter Dimov.
|
||||||
//
|
//
|
||||||
// Distributed under the Boost Software License, Version 1.0.
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
//
|
//
|
||||||
// See accompanying file LICENSE_1_0.txt or copy at
|
// See accompanying file LICENSE_1_0.txt or copy at
|
||||||
// http://www.boost.org/LICENSE_1_0.txt
|
// http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
|
|
||||||
|
#if defined(__has_builtin)
|
||||||
|
# if __has_builtin(__make_integer_seq)
|
||||||
|
# define BOOST_MP11_HAS_MAKE_INTEGER_SEQ
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace boost
|
namespace boost
|
||||||
{
|
{
|
||||||
namespace mp11
|
namespace mp11
|
||||||
@@ -20,6 +26,12 @@ template<class T, T... I> struct integer_sequence
|
|||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if defined(BOOST_MP11_HAS_MAKE_INTEGER_SEQ)
|
||||||
|
|
||||||
|
template<class T, T N> using make_integer_sequence = __make_integer_seq<integer_sequence, T, N>;
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
// detail::make_integer_sequence_impl
|
// detail::make_integer_sequence_impl
|
||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
@@ -82,6 +94,8 @@ template<class T, T N> struct make_integer_sequence_impl: iseq_if_c<N == 0, iseq
|
|||||||
// make_integer_sequence
|
// make_integer_sequence
|
||||||
template<class T, T N> using make_integer_sequence = typename detail::make_integer_sequence_impl<T, N>::type;
|
template<class T, T N> using make_integer_sequence = typename detail::make_integer_sequence_impl<T, N>::type;
|
||||||
|
|
||||||
|
#endif // defined(BOOST_MP11_HAS_MAKE_INTEGER_SEQ)
|
||||||
|
|
||||||
// index_sequence
|
// index_sequence
|
||||||
template<std::size_t... I> using index_sequence = integer_sequence<std::size_t, I...>;
|
template<std::size_t... I> using index_sequence = integer_sequence<std::size_t, I...>;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user