// // detail/utility.hpp // ~~~~~~~~~~~~~~~~~~ // // Copyright (c) 2003-2022 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) // #ifndef ASIO_DETAIL_UTILITY_HPP #define ASIO_DETAIL_UTILITY_HPP #if defined(_MSC_VER) && (_MSC_VER >= 1200) # pragma once #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) #include "asio/detail/config.hpp" #include namespace asio { namespace detail { #if defined(ASIO_HAS_STD_INDEX_SEQUENCE) using std::index_sequence; using std::index_sequence_for; using std::make_index_sequence; #elif defined(ASIO_HAS_VARIADIC_TEMPLATES) template struct index_sequence { }; template struct join_index_sequences; template struct join_index_sequences, index_sequence > { using type = index_sequence; }; template struct index_pack : join_index_sequences< typename index_pack::type, typename index_pack::type > { }; template struct index_pack { using type = index_sequence; }; template struct index_range : index_pack { }; template struct index_range { using type = index_sequence<>; }; template using index_sequence_for = typename index_range<0, sizeof...(T)>::type; template using make_index_sequence = typename index_range<0, N>::type; #endif // defined(ASIO_HAS_VARIADIC_TEMPLATES) } // namespace detail } // namespace asio #endif // ASIO_DETAIL_UTILITY_HPP