Browse Source

Couple of initialiser-list fixes for the DSP module

tags/2021-05-28
jules 8 years ago
parent
commit
a6deec4670
2 changed files with 3 additions and 5 deletions
  1. +1
    -1
      modules/juce_dsp/maths/juce_Matrix.h
  2. +2
    -4
      modules/juce_dsp/maths/juce_Polynomial.h

+ 1
- 1
modules/juce_dsp/maths/juce_Matrix.h View File

@@ -96,7 +96,7 @@ public:
/** Returns an Array of 2 integers with the number of rows and columns in the
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. */
void clear() noexcept { zeromem (data.begin(), sizeof (ElementType) * (size_t) data.size()); }


+ 2
- 4
modules/juce_dsp/maths/juce_Polynomial.h 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 */


Loading…
Cancel
Save