index_sequence.hpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // Copyright Oliver Kowalke 2014.
  2. // Distributed under the Boost Software License, Version 1.0.
  3. // (See accompanying file LICENSE_1_0.txt or copy at
  4. // http://www.boost.org/LICENSE_1_0.txt)
  5. #ifndef BOOST_CONTEXT_DETAIL_INDEX_SEQUENCE_H
  6. #define BOOST_CONTEXT_DETAIL_INDEX_SEQUENCE_H
  7. #include <cstddef>
  8. #include <boost/config.hpp>
  9. #include <boost/context/detail/config.hpp>
  10. #if defined(BOOST_CONTEXT_NO_CXX14_INTEGER_SEQUENCE)
  11. #include <boost/mp11/integer_sequence.hpp>
  12. #endif
  13. #ifdef BOOST_HAS_ABI_HEADERS
  14. # include BOOST_ABI_PREFIX
  15. #endif
  16. namespace boost {
  17. namespace context {
  18. namespace detail {
  19. #if ! defined(BOOST_CONTEXT_NO_CXX14_INTEGER_SEQUENCE)
  20. template< std::size_t ... I >
  21. using index_sequence = std::index_sequence< I ... >;
  22. template< std::size_t I >
  23. using make_index_sequence = std::make_index_sequence< I >;
  24. template< typename ... T >
  25. using index_sequence_for = std::index_sequence_for< T ... >;
  26. #else
  27. template< std::size_t ... I >
  28. using index_sequence = mp11::index_sequence< I ... >;
  29. template< std::size_t I >
  30. using make_index_sequence = mp11::make_index_sequence< I >;
  31. template< typename ... T >
  32. using index_sequence_for = mp11::index_sequence_for< T ... >;
  33. #endif
  34. }}}
  35. #ifdef BOOST_HAS_ABI_HEADERS
  36. #include BOOST_ABI_SUFFIX
  37. #endif
  38. #endif // BOOST_CONTEXT_DETAIL_INDEX_SEQUENCE_H