Skip to content

Commit

Permalink
Using std::integral_constant for model_detail::forEachInTuple
Browse files Browse the repository at this point in the history
  • Loading branch information
jatinchowdhury18 committed Feb 22, 2024
1 parent 89b8c8b commit 37f32d6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions RTNeural/ModelT.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ namespace modelt_detail

/** Functions to do a function for each element in the tuple */
template <typename Fn, typename Tuple, size_t... Ix>
constexpr void forEachInTuple(Fn&& fn, Tuple&& tuple, std::index_sequence<Ix...>) noexcept(noexcept(std::initializer_list<int> { (fn(std::get<Ix>(tuple), Ix), 0)... }))
constexpr void forEachInTuple(Fn&& fn, Tuple&& tuple, std::index_sequence<Ix...>) noexcept(noexcept(std::initializer_list<int> { (fn(std::get<Ix>(tuple), std::integral_constant<size_t, Ix>()), 0)... }))
{
(void)std::initializer_list<int> { ((void)fn(std::get<Ix>(tuple), Ix), 0)... };
(void)std::initializer_list<int> { ((void)fn(std::get<Ix>(tuple), std::integral_constant<size_t, Ix>()), 0)... };
}

template <typename T>
Expand Down

0 comments on commit 37f32d6

Please sign in to comment.