///////////////////////////////////////////////////////////////////////////// // Copyright (c) Electronic Arts Inc. All rights reserved. ///////////////////////////////////////////////////////////////////////////// #ifndef EASTL_INTEGER_SEQUENCE_H #define EASTL_INTEGER_SEQUENCE_H #include #include #include namespace eastl { #if EASTL_VARIADIC_TEMPLATES_ENABLED && !defined(EA_COMPILER_NO_TEMPLATE_ALIASES) // integer_sequence template class integer_sequence { public: typedef T value_type; static_assert(is_integral::value, "eastl::integer_sequence can only be instantiated with an integral type"); static EA_CONSTEXPR size_t size() EA_NOEXCEPT { return sizeof...(Ints); } }; template struct make_index_sequence_impl; template struct make_index_sequence_impl> { typedef typename make_index_sequence_impl>::type type; }; template struct make_index_sequence_impl<0, integer_sequence> { typedef integer_sequence type; }; template using index_sequence = integer_sequence; template using make_index_sequence = typename make_index_sequence_impl>::type; template struct integer_sequence_convert_impl; template struct integer_sequence_convert_impl> { typedef integer_sequence type; }; template struct make_integer_sequence_impl { typedef typename integer_sequence_convert_impl>::type type; }; template using make_integer_sequence = typename make_integer_sequence_impl::type; // Helper alias template that converts any type parameter pack into an index sequence of the same length template using index_sequence_for = make_index_sequence; #endif // EASTL_VARIADIC_TEMPLATES_ENABLED } // namespace eastl #endif // EASTL_INTEGER_SEQUENCE_H