diff --git a/include/boost/mp11/integer_sequence.hpp b/include/boost/mp11/integer_sequence.hpp index ad72bd0..34b097e 100644 --- a/include/boost/mp11/integer_sequence.hpp +++ b/include/boost/mp11/integer_sequence.hpp @@ -1,15 +1,21 @@ #ifndef 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 -// http://www.boost.org/LICENSE_1_0.txt +// See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt #include +#if defined(__has_builtin) +# if __has_builtin(__make_integer_seq) +# define BOOST_MP11_HAS_MAKE_INTEGER_SEQ +# endif +#endif + namespace boost { namespace mp11 @@ -20,6 +26,12 @@ template struct integer_sequence { }; +#if defined(BOOST_MP11_HAS_MAKE_INTEGER_SEQ) + +template using make_integer_sequence = __make_integer_seq; + +#else + // detail::make_integer_sequence_impl namespace detail { @@ -82,6 +94,8 @@ template struct make_integer_sequence_impl: iseq_if_c using make_integer_sequence = typename detail::make_integer_sequence_impl::type; +#endif // defined(BOOST_MP11_HAS_MAKE_INTEGER_SEQ) + // index_sequence template using index_sequence = integer_sequence;