OpenShot Audio Library | OpenShotAudio 0.4.0
Loading...
Searching...
No Matches
juce::TypeHelpers Namespace Reference

Classes

struct  ParameterType
 
struct  UnsignedTypeWithSize
 

Typedefs

template<typename Type >
using SmallestFloatType = std::conditional_t<std::is_same_v<Type, double>, double, float>
 

Detailed Description

This namespace contains a few template classes for helping work out class type variations.


Class Documentation

◆ juce::TypeHelpers::ParameterType

struct juce::TypeHelpers::ParameterType
template<typename Type>
struct juce::TypeHelpers::ParameterType< Type >

The ParameterType struct is used to find the best type to use when passing some kind of object as a parameter.

Of course, this is only likely to be useful in certain esoteric template situations.

E.g. "myFunction (typename TypeHelpers::ParameterType<int>::type, typename TypeHelpers::ParameterType<MyObject>::type)" would evaluate to "myfunction (int, const MyObject&)", keeping any primitive types as pass-by-value, but passing objects as a const reference, to avoid copying.

Definition at line 752 of file juce_MathsFunctions.h.

Class Members
typedef const Type & type const Type&

◆ juce::TypeHelpers::UnsignedTypeWithSize

struct juce::TypeHelpers::UnsignedTypeWithSize
template<int bytes>
struct juce::TypeHelpers::UnsignedTypeWithSize< bytes >

These templates are designed to take an integer type, and return an unsigned int version with the same size.

Definition at line 785 of file juce_MathsFunctions.h.

Typedef Documentation

◆ SmallestFloatType

template<typename Type >
using juce::TypeHelpers::SmallestFloatType = std::conditional_t<std::is_same_v<Type, double>, double, float>

These templates are designed to take a type, and if it's a double, they return a double type; for anything else, they return a float type.

Definition at line 778 of file juce_MathsFunctions.h.