diff --git a/include/FluidSCWrapper.hpp b/include/FluidSCWrapper.hpp index c1d074e..c3c8cbc 100644 --- a/include/FluidSCWrapper.hpp +++ b/include/FluidSCWrapper.hpp @@ -325,8 +325,7 @@ class FluidSCWrapper : public impl::FluidSCWrapperBase struct Setter { static constexpr size_t argSize = C::getParameterDescriptors().template get().fixedSize; - using ArrayType = std::array, argSize>; - + auto fromArgs(World *w, FloatControlsIter& args, LongT::type) { return args.next(); } auto fromArgs(World *w, FloatControlsIter& args, FloatT::type) { return args.next(); } auto fromArgs(World *w, sc_msg_iter* args, LongT::type) { return args->geti(); } @@ -341,20 +340,14 @@ class FluidSCWrapper : public impl::FluidSCWrapperBase return BufferT::type(bufnum >= 0 ? new SCBufferAdaptor(bufnum, w) : nullptr); } - template - static typename T::type makeVal(ArrayType &a, std::index_sequence) - { - return typename T::type{a[Is]...}; - } - typename T::type operator()(World *w, ArgType args) { - ArrayType a; + ParamArraySetter a; for (auto i = 0; i < argSize; i++) a[i] = fromArgs(w, args, a[0]); - return makeVal(a, std::make_index_sequence()); + return a.value(); } };