10USERVER_NAMESPACE_BEGIN
 
   16template <std::size_t... Indices, 
typename Func>
 
   17void DoForEachIndex(std::index_sequence<Indices...>, Func func) {
 
   18  static_assert(std::is_trivially_copyable_v<Func>);
 
   19  (..., func(std::integral_constant<std::size_t, Indices>{}));
 
   22template <std::size_t... Indices, 
typename Func>
 
   23void DoWithConstexprIndex(std::index_sequence<Indices...>,
 
   24                          std::size_t runtime_index, Func func) {
 
   25  static_assert(std::is_trivially_copyable_v<Func>);
 
   26  (..., (runtime_index == Indices
 
   27             ? func(std::integral_constant<std::size_t, Indices>{})
 
   35template <std::size_t Count, 
typename Func>
 
   37  impl::DoForEachIndex(std::make_index_sequence<Count>{}, func);
 
   41template <std::size_t Count, 
typename Func>
 
   43  impl::DoWithConstexprIndex(std::make_index_sequence<Count>{}, runtime_index,