mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 06:35:52 +08:00
Use fold expressions (C++17 feature)
This commit is contained in:
@@ -165,13 +165,8 @@ namespace BlackMisc
|
||||
template <typename T, typename F, size_t... Is>
|
||||
void tupleForEachPairImpl(T &&tuple, F &&visitor, std::index_sequence<Is...>)
|
||||
{
|
||||
// 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
|
||||
// cppcheck-suppress accessForwarded
|
||||
((void)(std::forward<F>(visitor)(std::get<Is * 2>(std::forward<T>(tuple)), std::get<Is * 2 + 1>(std::forward<T>(tuple)))), 0)...
|
||||
});
|
||||
// cppcheck-suppress accessForwarded
|
||||
(static_cast<void>(std::forward<F>(visitor)(std::get<Is * 2>(std::forward<T>(tuple)), std::get<Is * 2 + 1>(std::forward<T>(tuple)))), ...);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user