mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-12 23:35:33 +08:00
Use fold expressions (C++17 feature)
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user