mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-11 23:54:18 +00:00
MathsFunctions: Made numElementsInArray constexpr
This commit is contained in:
parent
a8ff4ea180
commit
e5ce2ceb97
1 changed files with 1 additions and 6 deletions
|
|
@ -297,12 +297,7 @@ void ignoreUnused (Types&&...) noexcept {}
|
|||
@endcode
|
||||
*/
|
||||
template <typename Type, int N>
|
||||
int numElementsInArray (Type (&array)[N])
|
||||
{
|
||||
(void) array;
|
||||
(void) sizeof (0[array]); // This line should cause an error if you pass an object with a user-defined subscript operator
|
||||
return N;
|
||||
}
|
||||
JUCE_CONSTEXPR int numElementsInArray (Type (&)[N]) noexcept { return N; }
|
||||
|
||||
//==============================================================================
|
||||
// Some useful maths functions that aren't always present with all compilers and build settings.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue