-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Labels
Description
Currently, it's not possible to define attribute<numbers> with a limit. It'd be nice to be able to do something like:
attribute<numbers, threadsafe::no, limit::clamp> m_foo { this, "foo", { 0.0, 0.0 },
range { {-1.0, 3.5}, {-4.3, 7.0} }
};
This fails because:
error: no matching constructor for initialization of 'c74::min::range' (aka 'vector<c74::min::atom>')
range { {-1.0, 3.5}, {-4.3, 7.0} }
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c74_min_attribute.h:758:13: error: static_assert failed due to requirement 'std::is_arithmetic<std::vector<double, std::allocator<double>>>::value' "limiting can only be applied to arithmetic types"
static_assert(std::is_arithmetic<T>::value, "limiting can only be applied to arithmetic types");
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
We'd need to:
- be able to construct a
c74::min::rangeofnumbers - have a specialization of the
constrainmethod for vectors of numeric types