1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Couple of initialiser-list fixes for the DSP module

This commit is contained in:
jules 2017-10-16 12:23:28 +01:00
parent c2a2d5c734
commit a6deec4670
2 changed files with 3 additions and 5 deletions

View file

@ -69,17 +69,15 @@ public:
/** Creates a copy of another polynomial. */
Polynomial& operator= (Polynomial&&) = default;
#if JUCE_COMPILER_SUPPORTS_INITIALIZER_LISTS || defined(DOXYGEN)
/** Creates a new polynomial with coefficients by a C++11 initializer list.
This function can be used in the following way:
Polynomial<float> p ({0.5f, -0.3f, 0.2f});
*/
template <typename TypeToCreateFrom>
Polynomial (const std::initializer_list<TypeToCreateFrom>& items) : coeffs (items)
template <typename... Values>
Polynomial (Values... items) : coeffs (items...)
{
jassert (! coeffs.isEmpty());
}
#endif
//==============================================================================
/** Returns a single coefficient of the receiver for reading */