From 65f1a766145842ff4df2c72845e3fb47b9ffecd3 Mon Sep 17 00:00:00 2001 From: reuk Date: Tue, 6 Sep 2022 12:13:55 +0100 Subject: [PATCH] Tidy up parameter pack expansions --- examples/Plugins/DSPModulePluginDemo.h | 3 +-- modules/juce_dsp/processors/juce_ProcessorChain.h | 12 ++++-------- .../native/accessibility/juce_ios_Accessibility.mm | 2 +- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/examples/Plugins/DSPModulePluginDemo.h b/examples/Plugins/DSPModulePluginDemo.h index a1f2052309..6e5c9c3691 100644 --- a/examples/Plugins/DSPModulePluginDemo.h +++ b/examples/Plugins/DSPModulePluginDemo.h @@ -120,9 +120,8 @@ namespace ID template constexpr void forEach (Func&& func, Items&&... items) - noexcept (noexcept (std::initializer_list { (func (std::forward (items)), 0)... })) { - (void) std::initializer_list { ((void) func (std::forward (items)), 0)... }; + (func (std::forward (items)), ...); } template diff --git a/modules/juce_dsp/processors/juce_ProcessorChain.h b/modules/juce_dsp/processors/juce_ProcessorChain.h index 3b0cdfe4fc..1336fc6be9 100644 --- a/modules/juce_dsp/processors/juce_ProcessorChain.h +++ b/modules/juce_dsp/processors/juce_ProcessorChain.h @@ -38,7 +38,7 @@ namespace detail template constexpr void forEachInTuple (Fn&& fn, Tuple&& tuple, std::index_sequence) { - (void) std::initializer_list { ((void) fn (std::get (tuple), std::integral_constant()), 0)... }; + (fn (std::get (tuple), std::integral_constant()), ...); } template @@ -50,12 +50,8 @@ namespace detail forEachInTuple (std::forward (fn), std::forward (tuple), TupleIndexSequence{}); } - // This could be a template variable, but that code causes an internal compiler error in MSVC 19.00.24215 template - struct UseContextDirectly - { - static constexpr auto value = ! Context::usesSeparateInputAndOutputBlocks() || Ix == 0; - }; + inline constexpr auto useContextDirectly = ! Context::usesSeparateInputAndOutputBlocks() || Ix == 0; } #endif @@ -103,7 +99,7 @@ public: } private: - template ::value, int> = 0> + template , int> = 0> void processOne (const Context& context, Proc& proc, std::integral_constant) noexcept { jassert (context.getOutputBlock().getNumChannels() == context.getInputBlock().getNumChannels()); @@ -113,7 +109,7 @@ private: proc.process (replacingContext); } - template ::value, int> = 0> + template , int> = 0> void processOne (const Context& context, Proc& proc, std::integral_constant) noexcept { auto contextCopy = context; diff --git a/modules/juce_gui_basics/native/accessibility/juce_ios_Accessibility.mm b/modules/juce_gui_basics/native/accessibility/juce_ios_Accessibility.mm index 5874ad3e0b..e7f8516cb1 100644 --- a/modules/juce_gui_basics/native/accessibility/juce_ios_Accessibility.mm +++ b/modules/juce_gui_basics/native/accessibility/juce_ios_Accessibility.mm @@ -217,7 +217,7 @@ private: template static constexpr void forEach (Func&& func, Items&&... items) { - (void) std::initializer_list { ((void) func (std::forward (items)), 0)... }; + (func (std::forward (items)), ...); } public: