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

@ -96,7 +96,7 @@ public:
/** Returns an Array of 2 integers with the number of rows and columns in the /** Returns an Array of 2 integers with the number of rows and columns in the
matrix. matrix.
*/ */
Array<size_t> getSize() const noexcept { return {{ rows, columns }}; } Array<size_t> getSize() const noexcept { return { rows, columns }; }
/** Fills the contents of the matrix with zeroes. */ /** Fills the contents of the matrix with zeroes. */
void clear() noexcept { zeromem (data.begin(), sizeof (ElementType) * (size_t) data.size()); } void clear() noexcept { zeromem (data.begin(), sizeof (ElementType) * (size_t) data.size()); }

View file

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