Skip to content
Snippets Groups Projects
Commit 8c8bf82e authored by Elias Pipping's avatar Elias Pipping
Browse files

Cast expression to void to sidestep a warning

The expression in question is clearly intentionally unused.
parent a8cc7366
Branches
No related tags found
No related merge requests found
Pipeline #
...@@ -243,7 +243,9 @@ namespace Imp { ...@@ -243,7 +243,9 @@ namespace Imp {
template<class Range, class F, class Index, Index... i> template<class Range, class F, class Index, Index... i>
constexpr void forEachIndex(Range&& range, F&& f, std::integer_sequence<Index, i...>) constexpr void forEachIndex(Range&& range, F&& f, std::integer_sequence<Index, i...>)
{ {
std::initializer_list<int>{(f(Hybrid::elementAt(range, std::integral_constant<Index,i>())), 0)...}; (void)std::initializer_list<int>{
((void)f(Hybrid::elementAt(range, std::integral_constant<Index,i>())), 0)...
};
} }
template<class Range, class F, template<class Range, class F,
......
  • Owner

    I understand the cast of the unused result. But is the cast of the argument really necessary?

  • Owner

    My clang-3.8 is happy if we only do (void) std::initializer_list<int>....

  • Contributor

    I didn't test that. I found it easier to understand the code this way. But those lines are gone now anyway, right?

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment