Use fold expressions (C++17 feature)

This commit is contained in:
Mat Sutcliffe
2021-04-16 21:33:27 +01:00
parent 7955d0a06e
commit b75e3859d4
3 changed files with 4 additions and 14 deletions

View File

@@ -280,12 +280,7 @@ namespace BlackMisc
template <typename F>
static void forEachMember(F &&visitor)
{
// parameter pack swallow idiom
static_cast<void>(std::initializer_list<int>
{
//! \fixme C-style cast is needed due to a clang bug: https://bugs.llvm.org/show_bug.cgi?id=39375
((void)(std::forward<F>(visitor)(members().at(index<Is>()))), 0)...
});
(static_cast<void>(std::forward<F>(visitor)(members().at(index<Is>()))), ...);
}
private: