muu namespace

The root namespace for all muu functions and types.

Namespaces

namespace build
Build environment information (compiler, date/time, support for various things...)
namespace literals inline
Literal operators.
namespace strong_typedef_traits
CRTP-based 'mixin' traits for strong typedefs.

Classes

template <typename ValueType, typename Impl = impl::default_accumulator<ValueType>::type>
class accumulator
Determines min, max and sum of an interderminate number of values.
template <typename Scalar>
struct axis_angle
An axis-angle rotation.
class blob
Interface for managing chunks of memory.
template <typename Scalar>
struct bounding_box
An axis-aligned bounding box.
template <typename Scalar>
struct bounding_sphere
A bounding sphere.
template <typename First, typename Second>
class compressed_pair
A pair that uses Empty Base Class Optimization to elide storage for one or both of its members where possible.
template <typename T>
struct constants
A typed container for static constants, similar to std::numeric_limits.
template <>
struct constants<_Float16>
_Float16 constants.
template <typename Scalar>
struct constants<bounding_box<Scalar>>
Axis-aligned bounding box constants.
template <typename Scalar>
struct constants<bounding_sphere<Scalar>>
Bounding spehere constants.
template <>
struct constants<char>
char constants.
template <>
struct constants<char16_t>
char16_t constants.
template <>
struct constants<char32_t>
char32_t constants.
template <>
struct constants<char8_t>
char8_t constants.
template <>
struct constants<double>
double constants.
template <>
struct constants<float>
float constants.
template <>
struct constants<float128_t>
float128_t constants.
template <>
struct constants<half>
16-bit half-precision float constants.
template <>
struct constants<int128_t>
int128_t constants.
template <typename Scalar>
struct constants<line_segment<Scalar>>
Line segment constants.
template <>
struct constants<long double>
long double constants.
template <typename Scalar, size_t Rows, size_t Columns>
struct constants<matrix<Scalar, Rows, Columns>>
Matrix constants.
template <typename Scalar>
struct constants<oriented_bounding_box<Scalar>>
Oriented bounding box constants.
template <typename Integer, size_t Dimensions>
struct constants<packed_unit_vector<Integer, Dimensions>>
Packed unit vector constants.
template <typename Scalar>
struct constants<plane<Scalar>>
Plane constants.
template <typename Scalar>
struct constants<quaternion<Scalar>>
Quaternion constants.
template <>
struct constants<signed char>
signed char constants.
template <>
struct constants<signed int>
signed int constants.
template <>
struct constants<signed long>
signed long constants.
template <>
struct constants<signed long long>
signed long long constants.
template <>
struct constants<signed short>
signed short constants.
template <typename Scalar>
struct constants<triangle<Scalar>>
Triangle constants.
template <>
struct constants<uint128_t>
uint128_t constants.
template <>
struct constants<unsigned char>
unsigned char constants.
template <>
struct constants<unsigned int>
unsigned int constants.
template <>
struct constants<unsigned long>
unsigned long constants.
template <>
struct constants<unsigned long long>
unsigned long long constants.
template <>
struct constants<unsigned short>
unsigned short constants.
template <>
struct constants<uuid>
UUID constants.
template <typename Scalar, size_t Dimensions>
struct constants<vector<Scalar, Dimensions>>
Vector constants.
template <>
struct constants<wchar_t>
wchar_t constants.
template <typename T>
class emplacement_array
Simple std::vector-like array type for immovable or move-only types.
template <typename Scalar>
struct euler_angles
A set of euler angles used for rotation.
template <typename Character, size_t Length>
class fixed_string
A null-terminated string for compile-time string manipulation.
template <size_t Bits = (sizeof(size_t)* CHAR_BIT)>
class fnv1a
FNV-1a hasher.
template <typename Func>
class function_view
A non-owning, type-erasing view of a callable object (functions, lambdas, etc.).
struct half
A 16-bit "half-precision" IEEE754 floating point type.
template <size_t Bits = (sizeof(size_t)* CHAR_BIT)>
class hash_combiner
A hash combiner for integral hashes.
template <typename Char = char>
struct hex_char_pair
A pair of code units in a byte pair.
template <typename T>
struct integral_range
A half-open range of integral values (ints, enums, pointers).
template <typename Scalar>
struct line_segment
A line segment.
template <typename Scalar, size_t Rows, size_t Columns>
struct matrix
A matrix.
template <typename Scalar>
struct oriented_bounding_box
An oriented bounding box.
template <typename Integer, size_t Dimensions>
struct packed_unit_vector
A utility type for lossy packing of 2D or 3D unit vectors into a single integer.
template <typename Scalar>
struct plane
A plane.
template <typename Scalar>
struct quaternion
A quaternion.
template <typename Scalar>
struct ray
A ray.
template <typename Scalar, size_t Dimensions>
struct sat_tester
A helper utility for performing Separating-Axis Theorem tests.
template <typename T>
class scope_fail
Performs actions when going out of scope due to an exception being thrown.
template <typename T>
class scope_guard
Performs actions when going out of scope.
template <typename T>
class scope_success
Performs actions when going out of scope only if no exceptions have been thrown.
class sha1
SHA-1 hasher.
class source_location
A backport of C++20's std::source_location.
template <typename T, size_t Extent = dynamic_extent, size_t Alignment = 0>
class span
A non-owning view of contiguous elements.
class spin_mutex
A mutex that acquires locks by spin-waiting.
template <typename T, T... Elements>
struct static_array
A statically-defined array.
class string_param
A move-only string type-eraser capable of representing any UTF string.
template <typename ValueType, typename Tag, template<typename> typename... Traits>
struct strong_typedef
A utility class for creating 'strong typedefs'.
template <typename T, size_t Align = impl::tptr_min_align<T>>
class tagged_ptr
Specialized pointer capable of storing data in the unused bits of a pointer's value.
class thread_pool
A thread pool.
template <typename Scalar>
struct triangle
A triangle.
template <typename... T>
struct type_list
A 'tag' type for encoding/parameterizing lists of types (without the instantiation heft of std::tuple).
class utf16_decoder
A state machine for decoding UTF-16 data.
class utf8_decoder
A state machine for decoding UTF-8 data.
struct uuid
A 128-bit universally-unique identifier (UUID).
template <typename Scalar, size_t Dimensions>
struct vector
An N-dimensional vector.

Enums

enum class box_corner: uint8_t { min = 0, x = 1, y = 2, xy = x | y, z = 4, xz = x | z, yz = y | z, xyz = x | y | z, max = xyz }
Corner masks/indices for three-dimensional bounding-boxes.
enum class math_apis { directx = 0, opengl = 1, right_handed = 0, left_handed = 2 }
Flags relating to math APIs w.r.t some graphics + rendering environments (e.g. DirectX).
enum class uuid_variant: uint8_t { none, standard, reserved_ncs, reserved_microsoft, reserved_future }
A UUID variant as per RFC 4122.
enum class uuid_version: uint8_t { none, time, dce, name_md5, random, name_sha1, unknown = 0b1111 }
A UUID version as per RFC 4122.

Typedefs

template <typename T>
using add_const = typename impl::rebase_ref_<T, std::add_const_t<std::remove_reference_t<T>>>::type
Adds a const qualifier to a type or reference.
template <typename T>
using add_cv = typename impl::rebase_ref_<T, std::add_volatile_t<std::add_const_t<std::remove_reference_t<T>>>>::type
Adds const and volatile qualifiers to a type or reference.
template <typename T>
using add_noexcept = copy_cvref<typename impl::add_noexcept_<remove_cvref<T>>::type, T>
Adds a noexcept specifier to a functional type (or reference to one).
template <typename T>
using add_volatile = typename impl::rebase_ref_<T, std::add_volatile_t<std::remove_reference_t<T>>>::type
Adds a volatile qualifier to a type or reference.
template <size_t Alignment>
using aligned_byte_span = span<std::byte, dynamic_extent, Alignment>
Convenience alias for span<std::byte, dynamic_extent, Alignment>.
using byte_span = span<std::byte>
Convenience alias for span<std::byte>.
using byteptr_range = integral_range<std::byte*>
Convenience alias for integral_range<std::byte*>.
template <typename T>
using clamp_to_standard_float = demote_if_large_float<promote_if_small_float<T>>
Clamps extended arithmetic floating-point types (e.g. __fp16, __float128) to float or long double.
template <typename T, bool AddConst>
using conditionally_add_const = std::conditional_t<AddConst, add_const<T>, T>
Shorthand for conditionally adding const to a type or reference.
template <typename T, bool AddConstVolatile>
using conditionally_add_cv = std::conditional_t<AddConstVolatile, add_cv<T>, T>
Shorthand for conditionally adding const and volatile qualifiers to a type or reference.
template <typename T, bool AddVolatile>
using conditionally_add_volatile = std::conditional_t<AddVolatile, add_volatile<T>, T>
Shorthand for conditionally adding volatile to a type or reference.
using const_byte_span = span<const std::byte>
Convenience alias for span<const std::byte>.
template <typename T, size_t Extent = dynamic_extent, size_t Alignment = 0>
using const_span = span<const T, Extent, Alignment>
Convenience alias for span<const T, Extent>.
template <typename T, typename CopyFrom>
using copy_const = set_const<T, is_const<CopyFrom>>
Copies the constness (or lack thereof) from one type or reference to another.
template <typename T, typename CopyFrom>
using copy_cv = copy_const<copy_volatile<T, CopyFrom>, CopyFrom>
Copies consteness and volatility (or lack thereof) from one type or reference to another.
template <typename T, typename CopyFrom>
using copy_cvref = copy_ref<copy_cv<std::remove_reference_t<T>, std::remove_reference_t<CopyFrom>>, CopyFrom>
Copies consteness, volatility and reference category (or lack thereof) from one type or to another.
template <typename T, typename CopyFrom>
using copy_ref = typename impl::copy_ref_<T, CopyFrom>::type
Copies the reference category (or lack thereof) from one type or to another.
template <typename T, typename CopyFrom>
using copy_signed = set_signed<T, is_signed<CopyFrom>>
Copies the signed-ness (or lack thereof) from one numeric type or reference to another.
template <typename T, typename CopyFrom>
using copy_unsigned = set_unsigned<T, is_unsigned<CopyFrom>>
Copies the unsigned-ness (or lack thereof) from one numeric type or reference to another.
template <typename T, typename CopyFrom>
using copy_volatile = set_volatile<T, is_volatile<CopyFrom>>
Copies the volatility (or lack thereof) from one type or reference to another.
template <typename T>
using demote_if_large_float = std::conditional_t<impl::is_large_float_<T>, typename impl::rebase_ref_<T, copy_cv<long double, T>>::type, T>
Demotes 'large' extended arithmetic floating-point types (e.g. __float128) to long double.
template <typename... T>
using epsilon_type = impl::std_math_common_type<remove_cvref<T>...>
A common epsilon type when comparing floating-point types named by T.
using float128_t = __float128
A 128-bit quad-precision float.
using index_range = integral_range<size_t>
Convenience alias for integral_range<size_t>.
template <size_t N>
using index_tag = std::integral_constant<size_t, N>
A tag type for encoding/parameterizing a single index.
using int128_t = __int128_t
A 128-bit signed integer.
using intptr_range = integral_range<intptr_t>
Convenience alias for integral_range<intptr_t>.
template <typename T, typename... U>
using largest = typename impl::largest_<T, U...>::type
The largest type from a set of types.
template <typename T, typename... U>
using least_aligned = typename impl::least_aligned_<T, U...>::type
The type with the smallest alignment (i.e. having the smallest value for alignment_of<T>) from a set of types.
template <typename T>
using make_cref = std::add_lvalue_reference_t<std::add_const_t<remove_cvref<T>>>
Makes a type into a const lvalue reference (replacing existing cvref qualifiers).
template <typename T>
using make_signed = typename impl::make_signed_<T>::type
Converts a numeric type to the signed equivalent with the same rank.
template <typename T>
using make_unsigned = typename impl::make_unsigned_<T>::type
Converts a numeric type to the unsigned equivalent with the same rank.
template <typename T, typename... U>
using most_aligned = typename impl::most_aligned_<T, U...>::type
The type with the largest alignment (i.e. having the largest value for alignment_of<T>) from a set of types.
template <typename T>
using promote_if_small_float = std::conditional_t<impl::is_small_float_<T>, typename impl::rebase_ref_<T, copy_cv<float, T>>::type, T>
Promotes 'small' extended arithmetic floating-point types (e.g. __fp16, etc.) to float.
template <typename T>
using readonly_param = typename impl::readonly_param_<std::remove_reference_t<T>>::type
Resolves to T or const T& based on the performance characteristics of T being passed by value into a function.
template <typename Ptr, typename NewBase>
using rebase_pointer = typename impl::rebase_pointer_<Ptr, NewBase>::type
Rebases a pointer, preserving the const and volatile qualification of the pointed type.
template <typename T>
using remove_all_pointers = typename impl::remove_all_pointers_<T>::type
Strips every level of pointer from a type.
template <typename T>
using remove_callconv = copy_cvref<typename impl::remove_callconv_<remove_cvref<T>>::type, T>
Removes any explicit calling convention specifiers from functions, function pointers and function references.
template <typename T>
using remove_const = typename impl::rebase_ref_<T, std::remove_const_t<std::remove_reference_t<T>>>::type
Removes the topmost const qualifier from a type or reference.
template <typename T>
using remove_cv = typename impl::rebase_ref_<T, std::remove_volatile_t<std::remove_const_t<std::remove_reference_t<T>>>>::type
Removes the topmost const and volatile qualifiers from a type or reference.
template <typename T>
using remove_cvref = std::remove_cv_t<std::remove_reference_t<T>>
Removes the topmost const, volatile and reference qualifiers from a type.
template <typename T>
using remove_enum = typename impl::remove_enum_<T>::type
Removes the outer enum wrapper from a type, converting it to the underlying integer equivalent.
template <typename T>
using remove_lvalue_reference = typename impl::remove_lvalue_reference_<T>::type
Removes reference qualification from a type if (and only if) it is an lvalue reference.
template <typename T>
using remove_noexcept = copy_cvref<typename impl::remove_noexcept_<remove_cvref<T>>::type, T>
Removes any noexcept specifier from a functional type (or reference to one).
template <typename T>
using remove_rvalue_reference = typename impl::remove_rvalue_reference_<T>::type
Removes reference qualification from a type if (and only if) it is an rvalue reference.
template <typename T>
using remove_volatile = typename impl::rebase_ref_<T, std::remove_volatile_t<std::remove_reference_t<T>>>::type
Removes the topmost volatile qualifier from a type or reference.
template <typename T, bool Const>
using set_const = std::conditional_t<Const, add_const<T>, remove_const<T>>
Sets the constness of a type or reference according to a boolean.
template <typename T, bool ConstVolatile>
using set_cv = std::conditional_t<ConstVolatile, add_cv<T>, remove_cv<T>>
Sets the constness and volatility of a type or reference according to a boolean.
template <typename T, bool Signed>
using set_signed = std::conditional_t<Signed, make_signed<T>, make_unsigned<T>>
Sets the signed-ness of a numeric type or reference according to a boolean.
template <typename T, bool Unsigned>
using set_unsigned = std::conditional_t<Unsigned, make_unsigned<T>, make_signed<T>>
Sets the unsigned-ness of a numeric type or reference according to a boolean.
template <typename T, bool Volatile>
using set_volatile = std::conditional_t<Volatile, add_volatile<T>, remove_volatile<T>>
Sets the volatility of a type or reference according to a boolean.
template <size_t Bits>
using signed_integer = typename decltype(impl::sint_for_bits_impl<Bits>())::type
Gets the signed integer type with a specific number of bits for the target platform.
template <typename T, typename... U>
using smallest = typename impl::smallest_<T, U...>::type
The smallest type from a set of types.
template <auto I, typename... T>
using type_at_index = /* ... */
The type at the given index in the list.
template <typename T>
using type_identity = typename impl::type_identity_<T>::type
Provides an identity type transformation.
template <typename T>
using type_tag = type_list<T>
A tag type for encoding/parameterizing a single type.
using uint128_t = __uint128_t
A 128-bit unsigned integer.
using uintptr_range = integral_range<uintptr_t>
Convenience alias for integral_range<uintptr_t>.
template <size_t Bits>
using unsigned_integer = typename decltype(impl::uint_for_bits_impl<Bits>())::type
Gets the unsigned integer type with a specific number of bits for the target platform.
template <typename T>
using vector_param = typename impl::vector_param_<std::remove_reference_t<T>>::type
Same as readonly_param, but also takes SIMD vector types and MSVC's __vectorcall into account.
using w_axis_tag = index_tag<3>
An index_tag specialization for representing the W axis.
using x_axis_tag = index_tag<0>
An index_tag specialization for representing the X axis.
using y_axis_tag = index_tag<1>
An index_tag specialization for representing the Y axis.
using z_axis_tag = index_tag<2>
An index_tag specialization for representing the Z axis.

Functions

auto abs(half x) -> half constexpr noexcept
Returns the absolute value of a half-precision float.
auto abs(float x) -> float constexpr noexcept
Returns the absolute value of a float.
auto abs(double x) -> double constexpr noexcept
Returns the absolute value of a double.
auto abs(long double x) -> long double constexpr noexcept
Returns the absolute value of a long double.
auto abs(float128_t x) -> float128_t constexpr noexcept
Returns the absolute value of a float128_t.
auto abs(_Float16 x) -> _Float16 constexpr noexcept
Returns the absolute value of a _Float16.
auto abs(signed char x) -> signed char constexpr noexcept
Returns the absolute value of a signed char.
auto abs(short x) -> short constexpr noexcept
Returns the absolute value of a short.
auto abs(int x) -> int constexpr noexcept
Returns the absolute value of an int.
auto abs(long x) -> long constexpr noexcept
Returns the absolute value of a long.
auto abs(long long x) -> long long constexpr noexcept
Returns the absolute value of a long long.
template <typename T>
auto abs(T x) -> T constexpr noexcept
Returns the absolute value of an integral type.
template <typename S, size_t D>
auto abs(const vector<S, D>& v) -> vector<S, D> constexpr noexcept
Returns a copy of a vector with all scalar components set to their absolute values.
auto acos(half x) -> half constexpr noexcept
Returns the arc cosine of a half-precision float.
auto acos(float x) -> float constexpr noexcept
Returns the arc cosine of a float.
auto acos(double x) -> double constexpr noexcept
Returns the arc cosine of a double.
auto acos(long double x) -> long double constexpr noexcept
Returns the arc cosine of a long double.
auto acos(float128_t x) -> float128_t constexpr noexcept
Returns the arc cosine of a float128_t.
auto acos(_Float16 x) -> _Float16 constexpr noexcept
Returns the arc cosine of a _Float16.
template <typename T>
auto acos(T x) -> double constexpr noexcept
Returns the arc cosine of an integer.
auto aligned_alloc(size_t size, size_t alignment) -> void* noexcept
Allocates memory on a specific alignment boundary.
void aligned_free(void* ptr) noexcept
Frees memory that was allocated using muu::aligned_alloc().
template <typename S, size_t D>
auto angle(const vector<S, D>& v1, const vector<S, D>& v2) -> delta_scalar_type constexpr noexcept
Calculates the angle between two vectors.
template <size_t Alignment, typename T>
auto apply_alignment(T val) -> T constexpr noexcept
Rounds an unsigned value up to the next multiple of the given alignment.
template <size_t Alignment, typename T>
auto apply_alignment(T* ptr) -> T* constexpr noexcept
Rounds a pointer up to the byte offset that is the next multiple of the given alignment.
template <typename T>
auto apply_alignment(T val, size_t alignment) -> T constexpr noexcept
Rounds an unsigned value up to the next multiple of the given alignment.
template <typename T>
auto apply_alignment(T* ptr, size_t alignment) -> T* constexpr noexcept
Rounds a pointer up to the byte offset that is the next multiple of the given alignment.
template <typename T, typename Offset>
auto apply_offset(T* ptr, Offset offset) -> T* constexpr noexcept
Applies a byte offset to a pointer.
template <typename S, typename T>
auto approx_equal(const bounding_box<S>& bb1, const bounding_box<T>& bb2, epsilon_type<S, T> epsilon = default_epsilon<S, T>) -> bool constexpr noexcept
Returns true if two bounding boxes are approximately equal.
template <typename S, typename T>
auto approx_equal(const bounding_sphere<S>& bs1, const bounding_sphere<T>& bs2, epsilon_type<S, T> epsilon = default_epsilon<S, T>) -> bool constexpr noexcept
Returns true if two bounding spheres are approximately equal.
auto approx_equal(half a, half b, half epsilon = constants<half>::default_epsilon) -> bool constexpr noexcept
Returns true if two half-precision floats are approximately equal.
template <typename S, typename T>
auto approx_equal(const line_segment<S>& seg1, const line_segment<T>& seg2, epsilon_type<S, T> epsilon = default_epsilon<S, T>) -> bool constexpr noexcept
Returns true if two line segments are approximately equal.
auto approx_equal(float a, float b, float epsilon = default_epsilon<float>) -> bool constexpr noexcept
Returns true if two floats are approximately equal.
auto approx_equal(double a, double b, double epsilon = default_epsilon<double>) -> bool constexpr noexcept
Returns true if two doubles are approximately equal.
auto approx_equal(long double a, long double b, long double epsilon = default_epsilon<long double>) -> bool constexpr noexcept
Returns true if two long doubles are approximately equal.
auto approx_equal(float128_t a, float128_t b, float128_t epsilon = default_epsilon<float128_t>) -> bool constexpr noexcept
Returns true if two float128_ts are approximately equal.
auto approx_equal(_Float16 a, _Float16 b, _Float16 epsilon = default_epsilon<_Float16>) -> bool constexpr noexcept
Returns true if two _Float16s are approximately equal.
template <typename T, typename U>
auto approx_equal(T a, U b) -> bool constexpr noexcept
Returns true if two scalar values are approximately equal.
template <typename S, typename T, size_t R, size_t C>
auto approx_equal(const matrix<S, R, C>& m1, const matrix<T, R, C>& m2, epsilon_type<S, T> epsilon = default_epsilon<S, T>) -> bool constexpr noexcept
Returns true if two matrices are approximately equal.
template <typename S, typename T>
auto approx_equal(const oriented_bounding_box<S>& bb1, const oriented_bounding_box<T>& bb2, epsilon_type<S, T> epsilon = default_epsilon<S, T>) -> bool constexpr noexcept
Returns true if two oriented bounding boxes are approximately equal.
template <typename S, typename T>
auto approx_equal(const plane<S>& p1, const plane<T>& p2, epsilon_type<S, T> epsilon = default_epsilon<S, T>) -> bool constexpr noexcept
Returns true if two planes are approximately equal.
template <typename S, typename T>
auto approx_equal(const quaternion<S>& q1, const quaternion<T>& q2, epsilon_type<S, T> epsilon = default_epsilon<S, T>) -> bool constexpr noexcept
Returns true if two quaternions are approximately equal.
template <typename S, typename T>
auto approx_equal(const ray<S>& ray1, const ray<T>& ray2, epsilon_type<S, T> epsilon = default_epsilon<S, T>) -> bool constexpr noexcept
Returns true if two rays are approximately equal.
template <typename S, typename T>
auto approx_equal(const triangle<S>& tri1, const triangle<T>& tri2, epsilon_type<S, T> epsilon = default_epsilon<S, T>) -> bool constexpr noexcept
Returns true if two triangles are approximately equal.
template <typename S, typename T, size_t D>
auto approx_equal(const vector<S, D>& v1, const vector<T, D>& v2, epsilon_type<S, T> epsilon = default_epsilon<S, T>) -> bool constexpr noexcept
Returns true if two vectors are approximately equal.
template <typename S>
auto approx_zero(const bounding_box<S>& bb, S epsilon = default_epsilon<S>) -> bool constexpr noexcept
Returns true if all the scalar components of a bounding box are approximately equal to zero.
template <typename S>
auto approx_zero(const bounding_sphere<S>& bs, S epsilon = default_epsilon<S>) -> bool constexpr noexcept
Returns true if all the scalar components of a bounding sphere are approximately equal to zero.
auto approx_zero(half x, half epsilon = constants<half>::default_epsilon) -> bool constexpr noexcept
Returns true a half-precision float is approximately equal to zero.
template <typename S>
auto approx_zero(const line_segment<S>& seg, S epsilon = default_epsilon<S>) -> bool constexpr noexcept
Returns true if all the points in line segment are approximately equal to zero.
auto approx_zero(float x, float epsilon = default_epsilon<float>) -> bool constexpr noexcept
Returns true if a float is approximately equal to zero.
auto approx_zero(double x, double epsilon = default_epsilon<double>) -> bool constexpr noexcept
Returns true if a double is approximately equal to zero.
auto approx_zero(long double x, long double epsilon = default_epsilon<long double>) -> bool constexpr noexcept
Returns true if a long double is approximately equal to zero.
auto approx_zero(float128_t x, float128_t epsilon = default_epsilon<float128_t>) -> bool constexpr noexcept
Returns true if a float128_t is approximately equal to zero.
auto approx_zero(_Float16 x, _Float16 epsilon = default_epsilon<_Float16>) -> bool constexpr noexcept
Returns true if a _Float16 is approximately equal to zero.
template <typename T>
auto approx_zero(T x) -> bool constexpr noexcept
Returns true if a scalar value is approximately equal to zero.
template <typename S, size_t R, size_t C>
auto approx_zero(const matrix<S, R, C>& m, S epsilon = default_epsilon<S>) -> bool constexpr noexcept
Returns true if all the scalar components of a matrix are approximately equal to zero.
template <typename S>
auto approx_zero(const oriented_bounding_box<S>& bb, S epsilon = default_epsilon<S>) -> bool constexpr noexcept
Returns true if all the scalar components of an oriented bounding box are approximately equal to zero.
template <typename S>
auto approx_zero(const plane<S>& p, S epsilon = default_epsilon<S>) -> bool constexpr noexcept
Returns true if all the scalar components of a plane are approximately equal to zero.
template <typename S>
auto approx_zero(const quaternion<S>& q, S epsilon = default_epsilon<S>) -> bool constexpr noexcept
Returns true if all the scalar components of a quaternion are approximately equal to zero.
template <typename S>
auto approx_zero(const triangle<S>& tri, S epsilon = default_epsilon<S>) -> bool constexpr noexcept
Returns true if all the points in triangle are approximately equal to zero.
template <typename S, size_t D>
auto approx_zero(const vector<S, D>& v, S epsilon = default_epsilon<S>) -> bool constexpr noexcept
Returns true if all the scalar components of a vector are approximately equal to zero.
template <typename T, size_t E, size_t A>
auto as_bytes(span<T, E, A> s) -> span<const std::byte, impl::as_bytes_extent<T, E>> noexcept
Reinterprets a span as an immutable view of the underlying bytes.
template <typename T, size_t E, size_t A>
auto as_writable_bytes(span<T, E, A> s) -> span<std::byte, impl::as_bytes_extent<T, E>> noexcept
Reinterprets a span as a view of the underlying bytes.
auto asin(half x) -> half constexpr noexcept
Returns the arc sine of a half-precision float.
auto asin(float x) -> float constexpr noexcept
Returns the arc sine of a float.
auto asin(double x) -> double constexpr noexcept
Returns the arc sine of a double.
auto asin(long double x) -> long double constexpr noexcept
Returns the arc sine of a long double.
auto asin(float128_t x) -> float128_t constexpr noexcept
Returns the arc sine of a float128_t.
auto asin(_Float16 x) -> _Float16 constexpr noexcept
Returns the arc sine of a _Float16.
template <typename T>
auto asin(T x) -> double constexpr noexcept
Returns the arc sine of an integer.
template <size_t N, typename T>
auto assume_aligned(T* ptr) -> T* constexpr noexcept
Equivalent to C++20's std::assume_aligned.
auto atan(half x) -> half constexpr noexcept
Returns the arc tangent of a half-precision float.
auto atan(float x) -> float constexpr noexcept
Returns the arc tangent of a float.
auto atan(double x) -> double constexpr noexcept
Returns the arc tangent of a double.
auto atan(long double x) -> long double constexpr noexcept
Returns the arc tangent of a long double.
auto atan(float128_t x) -> float128_t constexpr noexcept
Returns the arc tangent of a float128_t.
auto atan(_Float16 x) -> _Float16 constexpr noexcept
Returns the arc tangent of a _Float16.
template <typename T>
auto atan(T x) -> double constexpr noexcept
Returns the arc tangent of an integer.
auto atan2(half y, half x) -> half constexpr noexcept
Returns the arc tangent of a half-precision float.
auto atan2(float y, float x) -> float constexpr noexcept
Returns the arc tangent of a float.
auto atan2(double y, double x) -> double constexpr noexcept
Returns the arc tangent of a double.
auto atan2(long double y, long double x) -> long double constexpr noexcept
Returns the arc tangent of a long double.
auto atan2(float128_t y, float128_t x) -> float128_t constexpr noexcept
Returns the arc tangent of a float128_t.
auto atan2(_Float16 y, _Float16 x) -> _Float16 constexpr noexcept
Returns the arc tangent of a _Float16.
template <typename X, typename Y>
auto atan2(Y y, X x) -> auto constexpr noexcept
Returns the arc tangent of two arithmetic values.
template <typename T>
auto begin_iterator(T&& iterable) -> auto constexpr noexcept
Returns the 'begin' iterator of an iterable object.
template <typename T, typename U>
auto between(const T& val, const U& low, const U& high) -> bool constexpr noexcept
Returns true if a value is between two bounds (inclusive).
template <typename To, typename From>
auto bit_cast(const From& from) -> To constexpr noexcept
Equivalent to C++20's std::bit_cast.
template <typename T>
auto bit_ceil(T val) -> T constexpr noexcept
Finds the smallest integral power of two not less than the given value.
template <typename T>
auto bit_fill_left(size_t count) -> T constexpr noexcept
Returns an unsigned integer filled from the left with the desired number of consecutive ones.
template <typename T>
auto bit_fill_right(size_t count) -> T constexpr noexcept
Returns an unsigned integer filled from the right with the desired number of consecutive ones.
template <typename T>
auto bit_floor(T val) -> T constexpr noexcept
Finds the largest integral power of two not greater than the given value.
template <typename Return = void, typename T, typename U, typename... V>
auto bit_pack(T val1, U val2, V... vals) -> auto constexpr noexcept
Bitwise-packs integers left-to-right into a larger integer.
template <typename T>
auto bit_width(T val) -> T constexpr noexcept
Finds the smallest number of bits needed to represent the given value.
template <typename T>
auto byte_reverse(T val) -> T constexpr noexcept
Reverses the byte order of an unsigned integral type.
template <size_t Index, typename T>
auto byte_select(T val) -> uint8_t constexpr noexcept
Gets a specific byte from an integer.
template <typename T>
auto byte_select(T val, size_t index) -> uint8_t constexpr noexcept
Gets a specific byte from an integer.
template <typename Char = char>
auto byte_to_hex(uint8_t byte, Char a = constants<Char>::letter_a) -> hex_char_pair<Char> constexpr noexcept
Converts a byte value to it's equivalent pair of code units in the range [0x0, 0xF].
template <typename Char = char>
auto byte_to_hex(std::byte byte, Char a = constants<Char>::letter_a) -> hex_char_pair<Char> constexpr noexcept
Converts a byte value to it's equivalent pair of code units in the range [0x0, 0xF].
auto ceil(half x) -> half constexpr noexcept
Returns the ceiling of a half-precision float.
auto ceil(float x) -> float constexpr noexcept
Returns the ceiling of a float value.
auto ceil(double x) -> double constexpr noexcept
Returns the ceiling of a double value.
auto ceil(long double x) -> long double constexpr noexcept
Returns the ceiling of a long double value.
auto ceil(float128_t x) -> float128_t constexpr noexcept
Returns the ceiling of a float128_t value.
auto ceil(_Float16 x) -> _Float16 constexpr noexcept
Returns the ceiling of a _Float16 value.
template <typename T>
auto ceil(T x) -> double constexpr noexcept
Returns the ceiling of an integer.
template <typename S, size_t D>
auto ceil(const vector<S, D>& v) -> vector<S, D> constexpr noexcept
Returns a copy of a vector with all scalar components set to the lowest integer not less than their original values.
template <typename S, size_t D>
auto clamp(const vector<S, D>& v, const vector<S, D>& low, const vector<S, D>& high) -> vector<S, D> constexpr noexcept
Componentwise clamps a vector between two others.
template <typename T>
auto clamp(const T& val, const T& low, const T& high) -> const T& constexpr noexcept
Returns a value clamped between two bounds (inclusive).
template <typename S, size_t D>
auto consteval_distance(const vector<S, D>& p1, const vector<S, D>& p2) -> delta_scalar_type consteval noexcept
Returns the distance between two points.
template <typename S, size_t D>
auto consteval_length(const vector<S, D>& v) -> delta_scalar_type consteval noexcept
Returns the length (magnitude) of a vector.
template <typename S, size_t D>
auto consteval_normalize(const vector<S, D>& v) -> vector<S, D> consteval noexcept
Normalizes a vector.
auto consteval_sqrt(half x) -> half constexpr noexcept
Returns the square-root of a half-precision float.
auto consteval_sqrt(float x) -> float constexpr noexcept
Returns the square-root of a float.
auto consteval_sqrt(double x) -> double constexpr noexcept
Returns the square-root of a double.
auto consteval_sqrt(long double x) -> long double constexpr noexcept
Returns the square-root of a long double.
auto consteval_sqrt(float128_t x) -> float128_t constexpr noexcept
Returns the square-root of a float128_t.
auto consteval_sqrt(_Float16 x) -> _Float16 constexpr noexcept
Returns the square-root of a _Float16.
template <typename T>
auto consteval_sqrt(T x) -> double constexpr noexcept
Returns the square-root of an integer.
template <typename T, typename U>
auto contains(const T& outer, const U& inner) -> bool constexpr noexcept
Checks if an object contains another object.
auto cos(half x) -> half constexpr noexcept
Returns the cosine of a half-precision float.
auto cos(float x) -> float constexpr noexcept
Returns the cosine of a float.
auto cos(double x) -> double constexpr noexcept
Returns the cosine of a double.
auto cos(long double x) -> long double constexpr noexcept
Returns the cosine of a long double.
auto cos(float128_t x) -> float128_t constexpr noexcept
Returns the cosine of a float128_t.
auto cos(_Float16 x) -> _Float16 constexpr noexcept
Returns the cosine of a _Float16.
template <typename T>
auto cos(T x) -> double constexpr noexcept
Returns the cosine of an integer.
template <typename T>
auto countl_one(T val) -> int constexpr noexcept
Counts the number of consecutive 1 bits, starting from the left.
template <typename T>
auto countl_zero(T val) -> int constexpr noexcept
Counts the number of consecutive 0 bits, starting from the left.
template <typename T>
auto countr_one(T val) -> int constexpr noexcept
Counts the number of consecutive 1 bits, starting from the right.
template <typename T>
auto countr_zero(T val) -> int constexpr noexcept
Counts the number of consecutive 0 bits, starting from the right.
template <typename S>
auto cross(const vector<S, 3>& lhs, const vector<S, 3>& rhs) -> product_type constexpr noexcept
Returns the cross product of two three-dimensional vectors.
template <typename Char = char>
auto dec_to_hex(unsigned val, Char a = constants<Char>::letter_a) -> Char constexpr noexcept
Converts an unsigned integer in the range [0x0, 0xF] to it's equivalent code units [0-9, a-f, A-F].
template <typename S>
auto degenerate(const bounding_box<S>& bb) -> bool constexpr noexcept
Returns true if a bounding box is degenerate (i.e. any of its extents are less than or equal to zero).
template <typename S>
auto degenerate(const bounding_sphere<S>& bs) -> bool constexpr noexcept
Returns true if a bounding sphere is degenerate (i.e. its radius is less than or equal to zero).
template <typename S>
auto degenerate(const line_segment<S>& seg) -> bool constexpr noexcept
Returns true if a line segment is degenerate (i.e. its points are coincident).
template <typename T, size_t N>
auto degenerate(const T(&vals)[N]) -> bool constexpr noexcept
Returns true if any value in array is in a degenerate state.
template <typename T, typename U, typename... V>
auto degenerate(const T& val1, const U& val2, const V&... vals) -> bool constexpr noexcept
Returns true if any of the given values in a degenerate state.
template <typename S>
auto degenerate(const oriented_bounding_box<S>& bb) -> bool constexpr noexcept
Returns true if an oriented bounding box is degenerate (i.e. any of its extents are less than or equal to zero).
template <typename S>
auto degenerate(const triangle<S>& tri) -> bool constexpr noexcept
Returns true if a triangle is degenerate (i.e. two or more of its points are coincident).
template <typename S, size_t R, size_t C>
auto determinant(const matrix<S, R, C>& m) -> determinant_type constexpr noexcept
Calculates the determinant of a matrix.
template <typename S, size_t D>
auto direction(const vector<S, D>& from, const vector<S, D>& to, delta_scalar_type& distance_out) -> delta_type constexpr noexcept
Returns the normalized direction vector from one position to another.
template <typename S, size_t D>
auto direction(const vector<S, D>& from, const vector<S, D>& to) -> delta_type constexpr noexcept
Returns the normalized direction vector from one position to another.
template <typename S, size_t D>
auto distance(const vector<S, D>& p1, const vector<S, D>& p2) -> delta_scalar_type constexpr noexcept
Returns the distance between two points.
template <typename S, size_t D>
auto distance_squared(const vector<S, D>& p1, const vector<S, D>& p2) -> delta_scalar_type constexpr noexcept
Returns the squared distance between two points.
template <typename S>
auto dot(const quaternion<S>& q1, const quaternion<S>& q2) -> S constexpr noexcept
Returns the dot product of two quaternions.
template <typename S, size_t D>
auto dot(const vector<S, D>& v1, const vector<S, D>& v2) -> product_scalar_type constexpr noexcept
Returns the dot product of two vectors.
template <typename T>
auto end_iterator(T&& iterable) -> auto constexpr noexcept
Returns the 'end' iterator of an iterable object.
template <typename T>
auto evenly_distribute(T total, T bucket_count, T bucket_index) -> T constexpr noexcept
Evenly divides an integer into buckets.
auto floor(half x) -> half constexpr noexcept
Returns the floor of a half-precision float.
auto floor(float x) -> float constexpr noexcept
Returns the floor of a float value.
auto floor(double x) -> double constexpr noexcept
Returns the floor of a double value.
auto floor(long double x) -> long double constexpr noexcept
Returns the floor of a long double value.
auto floor(float128_t x) -> float128_t constexpr noexcept
Returns the floor of a float128_t value.
auto floor(_Float16 x) -> _Float16 constexpr noexcept
Returns the floor of a _Float16 value.
template <typename T>
auto floor(T x) -> double constexpr noexcept
Returns the floor of an integer.
template <typename S, size_t D>
auto floor(const vector<S, D>& v) -> vector<S, D> constexpr noexcept
Returns a copy of a vector with all scalar components set to the highest integer not greater than their original values.
template <auto N1, auto N2, typename Func>
void for_product(Func&& func) constexpr noexcept(…)
Generates a series of sequential function calls by pack expansion.
template <auto N, typename Func>
void for_sequence(Func&& func) constexpr noexcept(…)
Generates a series of sequential function calls by pack expansion.
template <typename T, typename U, typename... V>
auto gcd(T val1, U val2, V... vals) -> std::common_type_t<T, U, V...> constexpr noexcept
Returns the lowest common multiple of two or more integers.
template <typename T>
auto has_single_bit(T val) -> bool constexpr noexcept
Checks if an integral value has only a single bit set.
template <typename T>
auto hex_to_dec(T codepoint) -> unsigned constexpr noexcept
Converts a code units containing a hex value [0-9, a-f, A-F] to it's equivalent unsigned integer [0x0, 0xF].
template <typename S>
auto infinity_or_nan(const axis_angle<S>& aa) -> bool constexpr noexcept
Returns true if any of the scalars in an axis-angle are infinity or NaN.
template <typename S>
auto infinity_or_nan(const bounding_box<S>& bb) -> bool constexpr noexcept
Returns true if any of the scalar components of a bounding box are infinity or NaN.
template <typename S>
auto infinity_or_nan(const bounding_sphere<S>& bs) -> bool constexpr noexcept
Returns true if any of the scalar components of a bounding sphere are infinity or NaN.
template <typename S>
auto infinity_or_nan(const euler_angles<S>& rot) -> bool constexpr noexcept
Returns true if any of the angles in a set of euler angles are infinity or NaN.
auto infinity_or_nan(half x) -> bool constexpr noexcept
Returns true if a half-precision float is infinity or NaN.
template <typename S>
auto infinity_or_nan(const line_segment<S>& seg) -> bool constexpr noexcept
Returns true if any of the points in a line segment are infinity or NaN.
auto infinity_or_nan(float x) -> bool constexpr noexcept
Returns true if a float is infinity or NaN.
auto infinity_or_nan(double x) -> bool constexpr noexcept
Returns true if a double is infinity or NaN.
auto infinity_or_nan(long double x) -> bool constexpr noexcept
Returns true if a long double is infinity or NaN.
auto infinity_or_nan(float128_t x) -> bool constexpr noexcept
Returns true if a float128_t is infinity or NaN.
auto infinity_or_nan(_Float16 x) -> bool constexpr noexcept
Returns true if a _Float16 is infinity or NaN.
template <typename T>
auto infinity_or_nan(T x) -> bool constexpr noexcept
Returns true if an arithmetic value is infinity or NaN.
template <typename T, size_t N>
auto infinity_or_nan(const T(&vals)[N]) -> bool constexpr noexcept
Returns true if any value in array is infinity or NaN.
template <typename T, typename U, typename... V>
auto infinity_or_nan(const T& val1, const U& val2, const V&... vals) -> bool constexpr noexcept
Returns true if any of the given values is infinity or NaN.
template <typename S, size_t R, size_t C>
auto infinity_or_nan(const matrix<S, R, C>& m) -> bool constexpr noexcept
Returns true if any of the scalar components of a matrix are infinity or NaN.
template <typename S>
auto infinity_or_nan(const oriented_bounding_box<S>& bb) -> bool constexpr noexcept
Returns true if any of the scalar components of an oriented bounding box are infinity or NaN.
template <typename S>
auto infinity_or_nan(const plane<S>& p) -> bool constexpr noexcept
Returns true if any of the scalar components of a plane are infinity or NaN.
template <typename S>
auto infinity_or_nan(const quaternion<S>& q) -> bool constexpr noexcept
Returns true if any of the scalar components of a quaternion are infinity or NaN.
template <typename S>
auto infinity_or_nan(const ray<S>& r) -> bool constexpr noexcept
Returns true if any of the scalars in a ray are infinity or NaN.
template <typename S>
auto infinity_or_nan(const triangle<S>& tri) -> bool constexpr noexcept
Returns true if any of the points in a triangle are infinity or NaN.
template <typename S, size_t D>
auto infinity_or_nan(const vector<S, D>& v) -> bool constexpr noexcept
Returns true if any of the scalar components of a vector are infinity or NaN.
template <typename T, typename U>
auto intersects(const T& obj1, const U& obj2) -> bool constexpr noexcept
Checks if two objects intersect.
template <typename S, size_t R, size_t C>
auto invert(const matrix<S, R, C>& m) -> inverse_type constexpr noexcept
Returns the inverse of a matrix.
auto is_ascii_code_point(char c) -> bool constexpr noexcept
Returns true if a character is a valid code point from the ASCII range.
auto is_ascii_code_point(char16_t c) -> bool constexpr noexcept
Returns true if a UTF-16 code unit is a valid code point from the ASCII range.
auto is_ascii_code_point(char32_t c) -> bool constexpr noexcept
Returns true if a UTF-32 code unit is a valid code point from the ASCII range.
auto is_ascii_code_point(char8_t c) -> bool constexpr noexcept
Returns true if a UTF-8 code unit is a valid code point from the ASCII range.
auto is_ascii_code_point(unsigned char c) -> bool constexpr noexcept
Returns true if a character is a valid code point from the ASCII range.
auto is_ascii_code_point(wchar_t c) -> bool constexpr noexcept
Returns true if a wide character is a valid code point from the ASCII range.
auto is_ascii_hyphen(char c) -> bool constexpr noexcept
Returns true if a character is a hyphen code point from the ASCII range.
auto is_ascii_hyphen(char16_t c) -> bool constexpr noexcept
Returns true if a UTF-16 code unit is a hyphen code point from the ASCII range.
auto is_ascii_hyphen(char32_t c) -> bool constexpr noexcept
Returns true if a UTF-32 code unit is a hyphen code point from the ASCII range.
auto is_ascii_hyphen(char8_t c) -> bool constexpr noexcept
Returns true if a UTF-8 code unit is a hyphen code point from the ASCII range.
auto is_ascii_hyphen(unsigned char c) -> bool constexpr noexcept
Returns true if a character is a hyphen code point from the ASCII range.
auto is_ascii_hyphen(wchar_t c) -> bool constexpr noexcept
Returns true if a wide character is a hyphen code point from the ASCII range.
auto is_ascii_letter(char c) -> bool constexpr noexcept
Returns true if a character is a letter code point from the ASCII range.
auto is_ascii_letter(char16_t c) -> bool constexpr noexcept
Returns true if a UTF-16 code unit is a letter code point from the ASCII range.
auto is_ascii_letter(char32_t c) -> bool constexpr noexcept
Returns true if a UTF-32 code unit is a letter code point from the ASCII range.
auto is_ascii_letter(char8_t c) -> bool constexpr noexcept
Returns true if a UTF-8 code unit is a letter code point from the ASCII range.
auto is_ascii_letter(unsigned char c) -> bool constexpr noexcept
Returns true if a character is a letter code point from the ASCII range.
auto is_ascii_letter(wchar_t c) -> bool constexpr noexcept
Returns true if a wide character is a letter code point from the ASCII range.
auto is_ascii_lowercase(char c) -> bool constexpr noexcept
Returns true if a character is a lowercase code point from the ASCII range.
auto is_ascii_lowercase(char16_t c) -> bool constexpr noexcept
Returns true if a UTF-16 code unit is a lowercase code point from the ASCII range.
auto is_ascii_lowercase(char32_t c) -> bool constexpr noexcept
Returns true if a UTF-32 code unit is a lowercase code point from the ASCII range.
auto is_ascii_lowercase(char8_t c) -> bool constexpr noexcept
Returns true if a UTF-8 code unit is a lowercase code point from the ASCII range.
auto is_ascii_lowercase(unsigned char c) -> bool constexpr noexcept
Returns true if a character is a lowercase code point from the ASCII range.
auto is_ascii_lowercase(wchar_t c) -> bool constexpr noexcept
Returns true if a wide character is a lowercase code point from the ASCII range.
auto is_ascii_number(char c) -> bool constexpr noexcept
Returns true if a character is a number code point from the ASCII range.
auto is_ascii_number(char16_t c) -> bool constexpr noexcept
Returns true if a UTF-16 code unit is a number code point from the ASCII range.
auto is_ascii_number(char32_t c) -> bool constexpr noexcept
Returns true if a UTF-32 code unit is a number code point from the ASCII range.
auto is_ascii_number(char8_t c) -> bool constexpr noexcept
Returns true if a UTF-8 code unit is a number code point from the ASCII range.
auto is_ascii_number(unsigned char c) -> bool constexpr noexcept
Returns true if a character is a number code point from the ASCII range.
auto is_ascii_number(wchar_t c) -> bool constexpr noexcept
Returns true if a wide character is a number code point from the ASCII range.
auto is_ascii_uppercase(char c) -> bool constexpr noexcept
Returns true if a character is an uppercase code point from the ASCII range.
auto is_ascii_uppercase(char16_t c) -> bool constexpr noexcept
Returns true if a UTF-16 code unit is an uppercase code point from the ASCII range.
auto is_ascii_uppercase(char32_t c) -> bool constexpr noexcept
Returns true if a UTF-32 code unit is an uppercase code point from the ASCII range.
auto is_ascii_uppercase(char8_t c) -> bool constexpr noexcept
Returns true if a UTF-8 code unit is an uppercase code point from the ASCII range.
auto is_ascii_uppercase(unsigned char c) -> bool constexpr noexcept
Returns true if a character is an uppercase code point from the ASCII range.
auto is_ascii_uppercase(wchar_t c) -> bool constexpr noexcept
Returns true if a wide character is an uppercase code point from the ASCII range.
auto is_ascii_whitespace(char c) -> bool constexpr noexcept
Returns true if a character is a whitespace code point from the ASCII range.
auto is_ascii_whitespace(char16_t c) -> bool constexpr noexcept
Returns true if a UTF-16 code unit is a whitespace code point from the ASCII range.
auto is_ascii_whitespace(char32_t c) -> bool constexpr noexcept
Returns true if a UTF-32 code unit is a whitespace code point from the ASCII range.
auto is_ascii_whitespace(char8_t c) -> bool constexpr noexcept
Returns true if a UTF-8 code unit is a whitespace code point from the ASCII range.
auto is_ascii_whitespace(unsigned char c) -> bool constexpr noexcept
Returns true if a character is a whitespace code point from the ASCII range.
auto is_ascii_whitespace(wchar_t c) -> bool constexpr noexcept
Returns true if a wide character is a whitespace code point from the ASCII range.
auto is_code_point(char c) -> bool constexpr noexcept
Returns true if a character is a valid code point.
auto is_code_point(char16_t c) -> bool constexpr noexcept
Returns true if a UTF-16 code unit is a valid code point.
auto is_code_point(char32_t c) -> bool constexpr noexcept
Returns true if a UTF-32 code unit is a valid code point.
auto is_code_point(char8_t c) -> bool constexpr noexcept
Returns true if a UTF-8 code unit is a valid code point.
auto is_code_point(unsigned char c) -> bool constexpr noexcept
Returns true if a character is a valid code point.
auto is_code_point(wchar_t c) -> bool constexpr noexcept
Returns true if a wide character is a valid code point.
auto is_code_point_boundary(char c) -> bool constexpr noexcept
Returns true if a character is a code point boundary.
auto is_code_point_boundary(char16_t c) -> bool constexpr noexcept
Returns true if a UTF-16 code unit is a code point boundary.
auto is_code_point_boundary(char32_t c) -> bool constexpr noexcept
Returns true if a UTF-32 code unit is a code point boundary.
auto is_code_point_boundary(char8_t c) -> bool constexpr noexcept
Returns true if a UTF-8 code unit is a code point boundary.
auto is_code_point_boundary(unsigned char c) -> bool constexpr noexcept
Returns true if a character is a code point boundary.
auto is_code_point_boundary(wchar_t c) -> bool constexpr noexcept
Returns true if a wide character is a code point boundary.
auto is_combining_mark(char c) -> bool constexpr noexcept
Returns true if a character is a combining mark code point.
auto is_combining_mark(char16_t c) -> bool constexpr noexcept
Returns true if a UTF-16 code unit is a combining mark code point.
auto is_combining_mark(char32_t c) -> bool constexpr noexcept
Returns true if a UTF-32 code unit is a combining mark code point.
auto is_combining_mark(char8_t c) -> bool constexpr noexcept
Returns true if a UTF-8 code unit is a combining mark code point.
auto is_combining_mark(unsigned char c) -> bool constexpr noexcept
Returns true if a character is a combining mark code point.
auto is_combining_mark(wchar_t c) -> bool constexpr noexcept
Returns true if a wide character is a combining mark code point.
auto is_constant_evaluated() -> bool constexpr noexcept
Equivalent to C++20's std::is_constant_evaluated.
auto is_decimal_digit(char c) -> bool constexpr noexcept
Returns true if a character is a decimal digit code point.
auto is_decimal_digit(char16_t c) -> bool constexpr noexcept
Returns true if a UTF-16 code unit is a decimal digit code point.
auto is_decimal_digit(char32_t c) -> bool constexpr noexcept
Returns true if a UTF-32 code unit is a decimal digit code point.
auto is_decimal_digit(char8_t c) -> bool constexpr noexcept
Returns true if a UTF-8 code unit is a decimal digit code point.
auto is_decimal_digit(unsigned char c) -> bool constexpr noexcept
Returns true if a character is a decimal digit code point.
auto is_decimal_digit(wchar_t c) -> bool constexpr noexcept
Returns true if a wide character is a decimal digit code point.
auto is_hexadecimal_digit(char c) -> bool constexpr noexcept
Returns true if a character is a hexadecimal digit code point.
auto is_hexadecimal_digit(char16_t c) -> bool constexpr noexcept
Returns true if a UTF-16 code unit is a hexadecimal digit code point.
auto is_hexadecimal_digit(char32_t c) -> bool constexpr noexcept
Returns true if a UTF-32 code unit is a hexadecimal digit code point.
auto is_hexadecimal_digit(char8_t c) -> bool constexpr noexcept
Returns true if a UTF-8 code unit is a hexadecimal digit code point.
auto is_hexadecimal_digit(unsigned char c) -> bool constexpr noexcept
Returns true if a character is a hexadecimal digit code point.
auto is_hexadecimal_digit(wchar_t c) -> bool constexpr noexcept
Returns true if a wide character is a hexadecimal digit code point.
auto is_hyphen(char c) -> bool constexpr noexcept
Returns true if a character is a hyphen code point.
auto is_hyphen(char16_t c) -> bool constexpr noexcept
Returns true if a UTF-16 code unit is a hyphen code point.
auto is_hyphen(char32_t c) -> bool constexpr noexcept
Returns true if a UTF-32 code unit is a hyphen code point.
auto is_hyphen(char8_t c) -> bool constexpr noexcept
Returns true if a UTF-8 code unit is a hyphen code point.
auto is_hyphen(unsigned char c) -> bool constexpr noexcept
Returns true if a character is a hyphen code point.
auto is_hyphen(wchar_t c) -> bool constexpr noexcept
Returns true if a wide character is a hyphen code point.
auto is_letter(char c) -> bool constexpr noexcept
Returns true if a character is a letter code point.
auto is_letter(char16_t c) -> bool constexpr noexcept
Returns true if a UTF-16 code unit is a letter code point.
auto is_letter(char32_t c) -> bool constexpr noexcept
Returns true if a UTF-32 code unit is a letter code point.
auto is_letter(char8_t c) -> bool constexpr noexcept
Returns true if a UTF-8 code unit is a letter code point.
auto is_letter(unsigned char c) -> bool constexpr noexcept
Returns true if a character is a letter code point.
auto is_letter(wchar_t c) -> bool constexpr noexcept
Returns true if a wide character is a letter code point.
auto is_lowercase(char c) -> bool constexpr noexcept
Returns true if a character is a lowercase code point.
auto is_lowercase(char16_t c) -> bool constexpr noexcept
Returns true if a UTF-16 code unit is a lowercase code point.
auto is_lowercase(char32_t c) -> bool constexpr noexcept
Returns true if a UTF-32 code unit is a lowercase code point.
auto is_lowercase(char8_t c) -> bool constexpr noexcept
Returns true if a UTF-8 code unit is a lowercase code point.
auto is_lowercase(unsigned char c) -> bool constexpr noexcept
Returns true if a character is a lowercase code point.
auto is_lowercase(wchar_t c) -> bool constexpr noexcept
Returns true if a wide character is a lowercase code point.
auto is_non_ascii_code_point(char c) -> bool constexpr noexcept
Returns true if a character is a valid code point from outside the ASCII range.
auto is_non_ascii_code_point(char16_t c) -> bool constexpr noexcept
Returns true if a UTF-16 code unit is a valid code point from outside the ASCII range.
auto is_non_ascii_code_point(char32_t c) -> bool constexpr noexcept
Returns true if a UTF-32 code unit is a valid code point from outside the ASCII range.
auto is_non_ascii_code_point(char8_t c) -> bool constexpr noexcept
Returns true if a UTF-8 code unit is a valid code point from outside the ASCII range.
auto is_non_ascii_code_point(unsigned char c) -> bool constexpr noexcept
Returns true if a character is a valid code point from outside the ASCII range.
auto is_non_ascii_code_point(wchar_t c) -> bool constexpr noexcept
Returns true if a wide character is a valid code point from outside the ASCII range.
auto is_non_ascii_hyphen(char c) -> bool constexpr noexcept
Returns true if a character is a hyphen code point from outside the ASCII range.
auto is_non_ascii_hyphen(char16_t c) -> bool constexpr noexcept
Returns true if a UTF-16 code unit is a hyphen code point from outside the ASCII range.
auto is_non_ascii_hyphen(char32_t c) -> bool constexpr noexcept
Returns true if a UTF-32 code unit is a hyphen code point from outside the ASCII range.
auto is_non_ascii_hyphen(char8_t c) -> bool constexpr noexcept
Returns true if a UTF-8 code unit is a hyphen code point from outside the ASCII range.
auto is_non_ascii_hyphen(unsigned char c) -> bool constexpr noexcept
Returns true if a character is a hyphen code point from outside the ASCII range.
auto is_non_ascii_hyphen(wchar_t c) -> bool constexpr noexcept
Returns true if a wide character is a hyphen code point from outside the ASCII range.
auto is_non_ascii_letter(char c) -> bool constexpr noexcept
Returns true if a character is a letter code point from outside the ASCII range.
auto is_non_ascii_letter(char16_t c) -> bool constexpr noexcept
Returns true if a UTF-16 code unit is a letter code point from outside the ASCII range.
auto is_non_ascii_letter(char32_t c) -> bool constexpr noexcept
Returns true if a UTF-32 code unit is a letter code point from outside the ASCII range.
auto is_non_ascii_letter(char8_t c) -> bool constexpr noexcept
Returns true if a UTF-8 code unit is a letter code point from outside the ASCII range.
auto is_non_ascii_letter(unsigned char c) -> bool constexpr noexcept
Returns true if a character is a letter code point from outside the ASCII range.
auto is_non_ascii_letter(wchar_t c) -> bool constexpr noexcept
Returns true if a wide character is a letter code point from outside the ASCII range.
auto is_non_ascii_lowercase(char c) -> bool constexpr noexcept
Returns true if a character is a lowercase code point from outside the ASCII range.
auto is_non_ascii_lowercase(char16_t c) -> bool constexpr noexcept
Returns true if a UTF-16 code unit is a lowercase code point from outside the ASCII range.
auto is_non_ascii_lowercase(char32_t c) -> bool constexpr noexcept
Returns true if a UTF-32 code unit is a lowercase code point from outside the ASCII range.
auto is_non_ascii_lowercase(char8_t c) -> bool constexpr noexcept
Returns true if a UTF-8 code unit is a lowercase code point from outside the ASCII range.
auto is_non_ascii_lowercase(unsigned char c) -> bool constexpr noexcept
Returns true if a character is a lowercase code point from outside the ASCII range.
auto is_non_ascii_lowercase(wchar_t c) -> bool constexpr noexcept
Returns true if a wide character is a lowercase code point from outside the ASCII range.
auto is_non_ascii_number(char c) -> bool constexpr noexcept
Returns true if a character is a number code point from outside the ASCII range.
auto is_non_ascii_number(char16_t c) -> bool constexpr noexcept
Returns true if a UTF-16 code unit is a number code point from outside the ASCII range.
auto is_non_ascii_number(char32_t c) -> bool constexpr noexcept
Returns true if a UTF-32 code unit is a number code point from outside the ASCII range.
auto is_non_ascii_number(char8_t c) -> bool constexpr noexcept
Returns true if a UTF-8 code unit is a number code point from outside the ASCII range.
auto is_non_ascii_number(unsigned char c) -> bool constexpr noexcept
Returns true if a character is a number code point from outside the ASCII range.
auto is_non_ascii_number(wchar_t c) -> bool constexpr noexcept
Returns true if a wide character is a number code point from outside the ASCII range.
auto is_non_ascii_uppercase(char c) -> bool constexpr noexcept
Returns true if a character is an uppercase code point from outside the ASCII range.
auto is_non_ascii_uppercase(char16_t c) -> bool constexpr noexcept
Returns true if a UTF-16 code unit is an uppercase code point from outside the ASCII range.
auto is_non_ascii_uppercase(char32_t c) -> bool constexpr noexcept
Returns true if a UTF-32 code unit is an uppercase code point from outside the ASCII range.
auto is_non_ascii_uppercase(char8_t c) -> bool constexpr noexcept
Returns true if a UTF-8 code unit is an uppercase code point from outside the ASCII range.
auto is_non_ascii_uppercase(unsigned char c) -> bool constexpr noexcept
Returns true if a character is an uppercase code point from outside the ASCII range.
auto is_non_ascii_uppercase(wchar_t c) -> bool constexpr noexcept
Returns true if a wide character is an uppercase code point from outside the ASCII range.
auto is_non_ascii_whitespace(char c) -> bool constexpr noexcept
Returns true if a character is a whitespace code point from outside the ASCII range.
auto is_non_ascii_whitespace(char16_t c) -> bool constexpr noexcept
Returns true if a UTF-16 code unit is a whitespace code point from outside the ASCII range.
auto is_non_ascii_whitespace(char32_t c) -> bool constexpr noexcept
Returns true if a UTF-32 code unit is a whitespace code point from outside the ASCII range.
auto is_non_ascii_whitespace(char8_t c) -> bool constexpr noexcept
Returns true if a UTF-8 code unit is a whitespace code point from outside the ASCII range.
auto is_non_ascii_whitespace(unsigned char c) -> bool constexpr noexcept
Returns true if a character is a whitespace code point from outside the ASCII range.
auto is_non_ascii_whitespace(wchar_t c) -> bool constexpr noexcept
Returns true if a wide character is a whitespace code point from outside the ASCII range.
auto is_not_code_point(char c) -> bool constexpr noexcept
Returns true if a character is not a valid code point.
auto is_not_code_point(char16_t c) -> bool constexpr noexcept
Returns true if a UTF-16 code unit is not a valid code point.
auto is_not_code_point(char32_t c) -> bool constexpr noexcept
Returns true if a UTF-32 code unit is not a valid code point.
auto is_not_code_point(char8_t c) -> bool constexpr noexcept
Returns true if a UTF-8 code unit is not a valid code point.
auto is_not_code_point(unsigned char c) -> bool constexpr noexcept
Returns true if a character is not a valid code point.
auto is_not_code_point(wchar_t c) -> bool constexpr noexcept
Returns true if a wide character is not a valid code point.
auto is_not_hyphen(char c) -> bool constexpr noexcept
Returns true if a character is not a hyphen code point.
auto is_not_hyphen(char16_t c) -> bool constexpr noexcept
Returns true if a UTF-16 code unit is not a hyphen code point.
auto is_not_hyphen(char32_t c) -> bool constexpr noexcept
Returns true if a UTF-32 code unit is not a hyphen code point.
auto is_not_hyphen(char8_t c) -> bool constexpr noexcept
Returns true if a UTF-8 code unit is not a hyphen code point.
auto is_not_hyphen(unsigned char c) -> bool constexpr noexcept
Returns true if a character is not a hyphen code point.
auto is_not_hyphen(wchar_t c) -> bool constexpr noexcept
Returns true if a wide character is not a hyphen code point.
auto is_not_letter(char c) -> bool constexpr noexcept
Returns true if a character is not a letter code point.
auto is_not_letter(char16_t c) -> bool constexpr noexcept
Returns true if a UTF-16 code unit is not a letter code point.
auto is_not_letter(char32_t c) -> bool constexpr noexcept
Returns true if a UTF-32 code unit is not a letter code point.
auto is_not_letter(char8_t c) -> bool constexpr noexcept
Returns true if a UTF-8 code unit is not a letter code point.
auto is_not_letter(unsigned char c) -> bool constexpr noexcept
Returns true if a character is not a letter code point.
auto is_not_letter(wchar_t c) -> bool constexpr noexcept
Returns true if a wide character is not a letter code point.
auto is_not_lowercase(char c) -> bool constexpr noexcept
Returns true if a character is not a lowercase code point.
auto is_not_lowercase(char16_t c) -> bool constexpr noexcept
Returns true if a UTF-16 code unit is not a lowercase code point.
auto is_not_lowercase(char32_t c) -> bool constexpr noexcept
Returns true if a UTF-32 code unit is not a lowercase code point.
auto is_not_lowercase(char8_t c) -> bool constexpr noexcept
Returns true if a UTF-8 code unit is not a lowercase code point.
auto is_not_lowercase(unsigned char c) -> bool constexpr noexcept
Returns true if a character is not a lowercase code point.
auto is_not_lowercase(wchar_t c) -> bool constexpr noexcept
Returns true if a wide character is not a lowercase code point.
auto is_not_number(char c) -> bool constexpr noexcept
Returns true if a character is not a number code point.
auto is_not_number(char16_t c) -> bool constexpr noexcept
Returns true if a UTF-16 code unit is not a number code point.
auto is_not_number(char32_t c) -> bool constexpr noexcept
Returns true if a UTF-32 code unit is not a number code point.
auto is_not_number(char8_t c) -> bool constexpr noexcept
Returns true if a UTF-8 code unit is not a number code point.
auto is_not_number(unsigned char c) -> bool constexpr noexcept
Returns true if a character is not a number code point.
auto is_not_number(wchar_t c) -> bool constexpr noexcept
Returns true if a wide character is not a number code point.
auto is_not_uppercase(char c) -> bool constexpr noexcept
Returns true if a character is not an uppercase code point.
auto is_not_uppercase(char16_t c) -> bool constexpr noexcept
Returns true if a UTF-16 code unit is not an uppercase code point.
auto is_not_uppercase(char32_t c) -> bool constexpr noexcept
Returns true if a UTF-32 code unit is not an uppercase code point.
auto is_not_uppercase(char8_t c) -> bool constexpr noexcept
Returns true if a UTF-8 code unit is not an uppercase code point.
auto is_not_uppercase(unsigned char c) -> bool constexpr noexcept
Returns true if a character is not an uppercase code point.
auto is_not_uppercase(wchar_t c) -> bool constexpr noexcept
Returns true if a wide character is not an uppercase code point.
auto is_not_whitespace(char c) -> bool constexpr noexcept
Returns true if a character is not a whitespace code point.
auto is_not_whitespace(char16_t c) -> bool constexpr noexcept
Returns true if a UTF-16 code unit is not a whitespace code point.
auto is_not_whitespace(char32_t c) -> bool constexpr noexcept
Returns true if a UTF-32 code unit is not a whitespace code point.
auto is_not_whitespace(char8_t c) -> bool constexpr noexcept
Returns true if a UTF-8 code unit is not a whitespace code point.
auto is_not_whitespace(unsigned char c) -> bool constexpr noexcept
Returns true if a character is not a whitespace code point.
auto is_not_whitespace(wchar_t c) -> bool constexpr noexcept
Returns true if a wide character is not a whitespace code point.
auto is_number(char c) -> bool constexpr noexcept
Returns true if a character is a number code point.
auto is_number(char16_t c) -> bool constexpr noexcept
Returns true if a UTF-16 code unit is a number code point.
auto is_number(char32_t c) -> bool constexpr noexcept
Returns true if a UTF-32 code unit is a number code point.
auto is_number(char8_t c) -> bool constexpr noexcept
Returns true if a UTF-8 code unit is a number code point.
auto is_number(unsigned char c) -> bool constexpr noexcept
Returns true if a character is a number code point.
auto is_number(wchar_t c) -> bool constexpr noexcept
Returns true if a wide character is a number code point.
auto is_octal_digit(char c) -> bool constexpr noexcept
Returns true if a character is an octal digit code point.
auto is_octal_digit(char16_t c) -> bool constexpr noexcept
Returns true if a UTF-16 code unit is an octal digit code point.
auto is_octal_digit(char32_t c) -> bool constexpr noexcept
Returns true if a UTF-32 code unit is an octal digit code point.
auto is_octal_digit(char8_t c) -> bool constexpr noexcept
Returns true if a UTF-8 code unit is an octal digit code point.
auto is_octal_digit(unsigned char c) -> bool constexpr noexcept
Returns true if a character is an octal digit code point.
auto is_octal_digit(wchar_t c) -> bool constexpr noexcept
Returns true if a wide character is an octal digit code point.
auto is_uppercase(char c) -> bool constexpr noexcept
Returns true if a character is an uppercase code point.
auto is_uppercase(char16_t c) -> bool constexpr noexcept
Returns true if a UTF-16 code unit is an uppercase code point.
auto is_uppercase(char32_t c) -> bool constexpr noexcept
Returns true if a UTF-32 code unit is an uppercase code point.
auto is_uppercase(char8_t c) -> bool constexpr noexcept
Returns true if a UTF-8 code unit is an uppercase code point.
auto is_uppercase(unsigned char c) -> bool constexpr noexcept
Returns true if a character is an uppercase code point.
auto is_uppercase(wchar_t c) -> bool constexpr noexcept
Returns true if a wide character is an uppercase code point.
auto is_whitespace(char c) -> bool constexpr noexcept
Returns true if a character is a whitespace code point.
auto is_whitespace(char16_t c) -> bool constexpr noexcept
Returns true if a UTF-16 code unit is a whitespace code point.
auto is_whitespace(char32_t c) -> bool constexpr noexcept
Returns true if a UTF-32 code unit is a whitespace code point.
auto is_whitespace(char8_t c) -> bool constexpr noexcept
Returns true if a UTF-8 code unit is a whitespace code point.
auto is_whitespace(unsigned char c) -> bool constexpr noexcept
Returns true if a character is a whitespace code point.
auto is_whitespace(wchar_t c) -> bool constexpr noexcept
Returns true if a wide character is a whitespace code point.
template <typename B, typename E>
auto iterator_distance(B begin, E end) -> auto constexpr noexcept
Returns the distance between two iterators.
template <class T>
auto launder(T* ptr) -> T* constexpr noexcept
Equivalent to C++17's std::launder.
template <typename T, typename U, typename... V>
auto lcm(T val1, U val2, V... vals) -> std::common_type_t<T, U, V...> constexpr noexcept
Returns the lowest common multiple of two or more integers.
template <typename S, size_t D>
auto length(const vector<S, D>& v) -> delta_scalar_type constexpr noexcept
Returns the length (magnitude) of a vector.
template <typename S, size_t D>
auto length_squared(const vector<S, D>& v) -> delta_scalar_type constexpr noexcept
Returns the squared length of a vector.
auto lerp(half start, half finish, half alpha) -> half constexpr noexcept
Returns a linear interpolation between two half-precision floats.
auto lerp(float start, float finish, float alpha) -> float constexpr noexcept
Returns a linear interpolation between two floats.
auto lerp(double start, double finish, double alpha) -> double constexpr noexcept
Returns a linear interpolation between two doubles.
auto lerp(long double start, long double finish, long double alpha) -> long double constexpr noexcept
Returns a linear interpolation between two long doubles.
auto lerp(float128_t start, float128_t finish, float128_t alpha) -> float128_t constexpr noexcept
Returns a linear interpolation between two float128_ts.
auto lerp(_Float16 start, _Float16 finish, _Float16 alpha) -> _Float16 constexpr noexcept
Returns a linear interpolation between two _Float16s.
template <typename T, typename U, typename V>
auto lerp(T start, U finish, V alpha) -> auto constexpr noexcept
Returns a linear interpolation between two arithmetic values.
template <typename S, size_t D>
auto lerp(const vector<S, D>& start, const vector<S, D>& finish, delta_scalar_type alpha) -> vector<S, D> constexpr noexcept
Performs a linear interpolation between two vectors.
template <typename S, size_t D, typename... T>
auto max(const vector<S, D>& v1, const vector<S, D>& v2, const T&... vecs) -> vector<S, D> constexpr noexcept
Returns the componentwise maximum of two or more vectors.
template <typename T, typename... U>
auto max(const T& val1, const T& val2, const U&... vals) -> const T& constexpr noexcept
Returns the maximum of two or more values.
template <typename S, size_t D, typename... T>
auto min(const vector<S, D>& v1, const vector<S, D>& v2, const T&... vecs) -> vector<S, D> constexpr noexcept
Returns the componentwise minimum of two or more vectors.
template <typename T, typename... U>
auto min(const T& val1, const T& val2, const U&... vals) -> const T& constexpr noexcept
Returns the minimum of two or more values.
template <typename S>
auto normalize(const quaternion<S>& q) -> quaternion<S> constexpr noexcept
Normalizes a quaternion.
template <typename S, size_t D>
auto normalize(const vector<S, D>& v, delta_scalar_type& length_out) -> vector<S, D> constexpr noexcept
Normalizes a vector.
template <typename S, size_t D>
auto normalize(const vector<S, D>& v) -> vector<S, D> constexpr noexcept
Normalizes a vector.
auto normalize_angle(half x) -> half constexpr noexcept
Normalizes the angle value of a half-precision float.
auto normalize_angle(float x) -> float constexpr noexcept
Normalizes the angle value of a float.
auto normalize_angle(double x) -> double constexpr noexcept
Normalizes the angle value of a double.
auto normalize_angle(long double x) -> long double constexpr noexcept
Normalizes the angle value of a long double.
auto normalize_angle(float128_t x) -> float128_t constexpr noexcept
Normalizes the angle value of a float128_t.
auto normalize_angle(_Float16 x) -> _Float16 constexpr noexcept
Normalizes the angle value of a _Float16.
template <typename T>
auto normalize_angle(T x) -> double constexpr noexcept
Normalizes the angle of an integer.
auto normalize_angle_signed(half x) -> half constexpr noexcept
Normalizes the angle value of a half-precision float.
auto normalize_angle_signed(float x) -> float constexpr noexcept
Normalizes the angle value of a float.
auto normalize_angle_signed(double x) -> double constexpr noexcept
Normalizes the angle value of a double.
auto normalize_angle_signed(long double x) -> long double constexpr noexcept
Normalizes the angle value of a long double.
auto normalize_angle_signed(float128_t x) -> float128_t constexpr noexcept
Normalizes the angle value of a float128_t.
auto normalize_angle_signed(_Float16 x) -> _Float16 constexpr noexcept
Normalizes the angle value of a _Float16.
template <typename T>
auto normalize_angle_signed(T x) -> double constexpr noexcept
Normalizes the angle of an integer.
template <typename S>
auto normalized(const plane<S>& p) -> bool constexpr noexcept
Returns true if a plane is normalized.
template <typename S>
auto normalized(const quaternion<S>& q) -> bool constexpr noexcept
Returns true if a quaternion is normalized (i.e. has a length of 1).
template <typename S, size_t D>
auto normalized(const vector<S, D>& v) -> bool constexpr noexcept
Returns true if a vector is normalized (i.e. has a length of 1).
auto operator""_b(unsigned long long b) -> size_t consteval noexcept
Creates a size_t for a given number of bytes.
auto operator""_f16(long double val) -> half consteval noexcept
Literal for creating a half-precision float.
auto operator""_f16(unsigned long long val) -> half consteval noexcept
Literal for creating a half-precision float.
template <impl::fixed_string_udl_impl Str>
auto operator""_fs() consteval
Constructs a fixed_string directly using a string literal.
auto operator""_gb(unsigned long long gb) -> size_t consteval noexcept
Creates a size_t for a given number of gigabytes.
auto operator""_i128(unsigned long long n) -> int128_t consteval noexcept
Creates an int128_t.
auto operator""_i16(unsigned long long n) -> int16_t consteval noexcept
Creates an int16_t.
auto operator""_i32(unsigned long long n) -> int32_t consteval noexcept
Creates an int32_t.
auto operator""_i64(unsigned long long n) -> int64_t consteval noexcept
Creates an int64_t.
auto operator""_i8(unsigned long long n) -> int8_t consteval noexcept
Creates an int8_t.
auto operator""_kb(unsigned long long kb) -> size_t consteval noexcept
Creates a size_t for a given number of kilobytes.
auto operator""_mb(unsigned long long mb) -> size_t consteval noexcept
Creates a size_t for a given number of megabytes.
auto operator""_sz(unsigned long long n) -> size_t consteval noexcept
Creates a size_t.
auto operator""_u128(unsigned long long n) -> uint128_t consteval noexcept
Creates a uint128_t.
auto operator""_u16(unsigned long long n) -> uint16_t consteval noexcept
Creates a uint16_t.
auto operator""_u32(unsigned long long n) -> uint32_t consteval noexcept
Creates a uint32_t.
auto operator""_u64(unsigned long long n) -> uint64_t consteval noexcept
Creates a uint64_t.
auto operator""_u8(unsigned long long n) -> uint8_t consteval noexcept
Creates a uint8_t.
auto operator""_uuid(const char* str, size_t len) -> uuid consteval noexcept
Constructs a uuid from a string literal using uuid::parse.
template <typename S, size_t R, size_t C>
auto orthonormalize(const matrix<S, R, C>& m) -> matrix<S, R, C> constexpr noexcept
Returns a copy of a matrix with the 3x3 part orthonormalized.
template <typename To, typename From>
auto pointer_cast(From from) -> To constexpr noexcept
Casts between pointers, choosing the most appropriate conversion path.
template <typename T>
auto popcount(T val) -> int constexpr noexcept
Counts the number of set bits (the 'population count') of an unsigned integer.
void set_thread_name(string_param name) noexcept
Sets the name of the current thread for debuggers.
auto sin(half x) -> half constexpr noexcept
Returns the sine of a half-precision float.
auto sin(float x) -> float constexpr noexcept
Returns the sine of a float.
auto sin(double x) -> double constexpr noexcept
Returns the sine of a double.
auto sin(long double x) -> long double constexpr noexcept
Returns the sine of a long double.
auto sin(float128_t x) -> float128_t constexpr noexcept
Returns the sine of a float128_t.
auto sin(_Float16 x) -> _Float16 constexpr noexcept
Returns the sine of a _Float16.
template <typename T>
auto sin(T x) -> double constexpr noexcept
Returns the sine of an integer.
template <typename S>
auto slerp(const quaternion<S>& start, const quaternion<S>& finish, S alpha) -> quaternion<S> constexpr noexcept
Performs a spherical-linear interpolation between two quaternions.
auto sqrt(half x) -> half constexpr noexcept
Returns the square-root of a half-precision float.
auto sqrt(float x) -> float constexpr noexcept
Returns the square-root of a float.
auto sqrt(double x) -> double constexpr noexcept
Returns the square-root of a double.
auto sqrt(long double x) -> long double constexpr noexcept
Returns the square-root of a long double.
auto sqrt(float128_t x) -> float128_t constexpr noexcept
Returns the square-root of a float128_t.
auto sqrt(_Float16 x) -> _Float16 constexpr noexcept
Returns the square-root of a _Float16.
template <typename T>
auto sqrt(T x) -> double constexpr noexcept
Returns the square-root of an integer.
template <typename F, typename S>
void swap(compressed_pair<F, S>& lhs, compressed_pair<F, S>& rhs) noexcept(…)
Swaps two compressed pairs.
template <size_t... ByteIndices, typename T>
auto swizzle(T val) -> auto constexpr noexcept
Select and re-pack arbitrary bytes from an integer.
auto tan(half x) -> half constexpr noexcept
Returns the tangent of a half-precision float.
auto tan(float x) -> float constexpr noexcept
Returns the tangent of a float.
auto tan(double x) -> double constexpr noexcept
Returns the tangent of a double.
auto tan(long double x) -> long double constexpr noexcept
Returns the tangent of a long double.
auto tan(float128_t x) -> float128_t constexpr noexcept
Returns the tangent of a float128_t.
auto tan(_Float16 x) -> _Float16 constexpr noexcept
Returns the tangent of a _Float16.
template <typename T>
auto tan(T x) -> double constexpr noexcept
Returns the tangent of an integer.
template <typename T>
auto to_address(T* p) -> T* constexpr noexcept
Obtain the address represented by p without forming a reference to the pointee.
template <typename Ptr>
auto to_address(const Ptr& p) -> auto constexpr noexcept
Obtain the address represented by p without forming a reference to the pointee.
template <typename Char>
auto transcode(std::string_view str) noexcept -> std::conditional_t< std::is_same_v< Char, char >, std::string_view, std::basic_string< Char >> -> auto
Transcodes a UTF-8 string into another UTF encoding.
template <typename Char>
auto transcode(std::wstring_view str) noexcept -> std::conditional_t< std::is_same_v< Char, wchar_t >, std::wstring_view, std::basic_string< Char >> -> auto
Transcodes a UTF wide string into another UTF encoding.
template <typename Char>
auto transcode(std::u16string_view str) noexcept -> std::conditional_t< std::is_same_v< Char, char16_t >, std::u16string_view, std::basic_string< Char >> -> auto
Transcodes a UTF-16 string into another UTF encoding.
template <typename Char>
auto transcode(std::u32string_view str) noexcept -> std::conditional_t< std::is_same_v< Char, char32_t >, std::u32string_view, std::basic_string< Char >> -> auto
Transcodes a UTF-32 string into another UTF encoding.
template <typename Char>
auto transcode(std::u8string_view str) noexcept -> std::conditional_t< std::is_same_v< Char, char8_t >, std::u8string_view, std::basic_string< Char >> -> auto
Transcodes a UTF-8 string into another UTF encoding.
template <typename S, size_t R, size_t C>
auto transpose(const matrix<S, R, C>& m) -> matrix<S, C, R> constexpr noexcept
Returns a transposed copy of a matrix.
auto trim(std::string_view str) -> std::string_view constexpr noexcept
Trims whitespace from both ends of a UTF-8 string.
auto trim(std::wstring_view str) -> std::wstring_view constexpr noexcept
Trims whitespace from both ends of a UTF wide string.
auto trim(std::u16string_view str) -> std::u16string_view constexpr noexcept
Trims whitespace from both ends of a UTF-16 string.
auto trim(std::u32string_view str) -> std::u32string_view constexpr noexcept
Trims whitespace from both ends of a UTF-32 string.
auto trim(std::u8string_view str) -> std::u8string_view constexpr noexcept
Trims whitespace from both ends of a UTF-8 string.
auto trim_left(std::string_view str) -> std::string_view constexpr noexcept
Trims whitespace from the left end of a UTF-8 string.
auto trim_left(std::wstring_view str) -> std::wstring_view constexpr noexcept
Trims whitespace from the left end of a UTF wide string.
auto trim_left(std::u16string_view str) -> std::u16string_view constexpr noexcept
Trims whitespace from the left end of a UTF-16 string.
auto trim_left(std::u32string_view str) -> std::u32string_view constexpr noexcept
Trims whitespace from the left end of a UTF-32 string.
auto trim_left(std::u8string_view str) -> std::u8string_view constexpr noexcept
Trims whitespace from the left end of a UTF-8 string.
auto trim_right(std::string_view str) -> std::string_view constexpr noexcept
Trims whitespace from the right end of a UTF-8 string.
auto trim_right(std::wstring_view str) -> std::wstring_view constexpr noexcept
Trims whitespace from the right end of a UTF wide string.
auto trim_right(std::u16string_view str) -> std::u16string_view constexpr noexcept
Trims whitespace from the right end of a UTF-16 string.
auto trim_right(std::u32string_view str) -> std::u32string_view constexpr noexcept
Trims whitespace from the right end of a UTF-32 string.
auto trim_right(std::u8string_view str) -> std::u8string_view constexpr noexcept
Trims whitespace from the right end of a UTF-8 string.
template <typename T>
auto unwrap(T val) -> std::underlying_type_t<T> constexpr noexcept
Unwraps an enum to it's raw integer equivalent.

Variables

template <typename T>
size_t alignment_of constexpr
The default alignment of a type.
template <typename... T>
bool all_arithmetic constexpr
Are all of the named types arithmetic or reference-to-arithmetic?
template <typename... T>
bool all_array constexpr
Are all of the named types arrays, or references to arrays?
template <typename... T>
bool all_bounded_array constexpr
Are all of the named types a bounded array (T[N]), or a reference to one?
template <typename... T>
bool all_const constexpr
Are all of the named types const or reference-to-const?
template <typename To, typename... From>
bool all_convertible_to constexpr
True if all of the types named by From are implicitly or explicitly convertible to To.
template <typename... T>
bool all_cv constexpr
Are all of the named types const and/or volatile-qualified, or references to const and/or volatile-qualified?
template <typename... T>
bool all_cvref constexpr
Are all of the named types const, volatile, or a reference?
template <typename... T>
bool all_enum constexpr
Are all of the named types enums or reference-to-enum?
template <typename To, typename... From>
bool all_explicitly_convertible_to constexpr
True if all of the types named by From are explicitly convertible to To.
template <typename To, typename... From>
bool all_explicitly_nothrow_convertible_to constexpr
True if all of the types named by From are explicitly nothrow-convertible to To.
template <typename... T>
bool all_floating_point constexpr
Are all of the named types floating-point or reference-to-floating-point?
template <typename... T>
bool all_function constexpr
Are all of the named types free/static functions, or references to them?
template <typename... T>
bool all_function_pointer constexpr
Are all of the named types free/static function pointers, or references to them?
template <typename To, typename... From>
bool all_implicitly_convertible_to constexpr
True if all of the types named by From are implicitly convertible to To.
template <typename To, typename... From>
bool all_implicitly_nothrow_convertible_to constexpr
True if all of the types named by From are implicitly nothrow-convertible to To.
template <typename... T>
bool all_integer constexpr
Are all of the named types arithmetic integers, or reference to them?
template <typename... T>
bool all_integral constexpr
Are all of the named types integral or reference-to-integral?
template <typename... T>
bool all_legacy_enum constexpr
Are all of the named types pre-C++11 unscoped enums, or references to one?
template <typename To, typename... From>
bool all_nothrow_convertible_to constexpr
True if all of the types named by From are implicitly or explicitly nothrow-convertible to To.
template <typename T, typename... U>
bool all_same constexpr
True if all the named types are exactly the same.
template <typename... T>
bool all_scoped_enum constexpr
Are all of the named types C++11 scoped enum classes, or references to one?
template <typename... T>
bool all_signed constexpr
Are all of the named types signed or reference-to-signed?
template <typename... T>
bool all_unbounded_array constexpr
Are all of the named types an unbounded array (T[]), or a reference to one?
template <typename... T>
bool all_unsigned constexpr
Are all of the named types unsigned or reference-to-unsigned?
template <typename... T>
bool all_volatile constexpr
Are all of the named types volatile or reference-to-volatile?
template <typename From, typename To>
bool allow_implicit_bit_cast constexpr
Allows the library to implicitly convert via bit casting in some situations.
template <typename... T>
bool always_false constexpr
Evaluates to false but with delayed, type-dependent evaluation.
template <typename... T>
bool any_arithmetic constexpr
Are any of the named types arithmetic or reference-to-arithmetic?
template <typename... T>
bool any_array constexpr
Are any of the named types arrays, or references to arrays?
template <typename... T>
bool any_bounded_array constexpr
Are any of the named types a bounded array (T[N]), or a reference to one?
template <typename... T>
bool any_const constexpr
Are any of the named types const or reference-to-const?
template <typename... T>
bool any_cv constexpr
Are any of the named types const and/or volatile-qualified, or references to const and/or volatile-qualified?
template <typename... T>
bool any_cvref constexpr
Are any of the named types const, volatile, or a reference?
template <typename... T>
bool any_enum constexpr
Are any of the named types enums or reference-to-enum?
template <typename... T>
bool any_floating_point constexpr
Are any of the named types floating-point or reference-to-floating-point?
template <typename... T>
bool any_function constexpr
Are any of the named types free/static functions, or references to them?
template <typename... T>
bool any_function_pointer constexpr
Are any of the named types free/static function pointers, or references to them?
template <typename... T>
bool any_integer constexpr
Are any of the named types arithmetic integers, or reference to them?
template <typename... T>
bool any_integral constexpr
Are any of the named types integral or reference-to-integral?
template <typename... T>
bool any_legacy_enum constexpr
Are any of the named types pre-C++11 unscoped enums, or references to one?
template <typename T, typename... U>
bool any_same constexpr
True if T is exactly the same as one or more of the types named by U.
template <typename... T>
bool any_scoped_enum constexpr
Are any of the named types C++11 scoped enum classes, or references to one?
template <typename... T>
bool any_signed constexpr
Are any of the named types signed or reference-to-signed?
template <typename... T>
bool any_unbounded_array constexpr
Are any of the named types an unbounded array (T[]), or a reference to one?
template <typename... T>
bool any_unsigned constexpr
Are any of the named types unsigned or reference-to-unsigned?
template <typename... T>
bool any_volatile constexpr
Are any of the named types volatile or reference-to-volatile?
template <typename T>
size_t arity constexpr
Returns the arity (parameter count) of a function, function pointer, stateless lambda, or class/union type with an unambiguous operator() overload.
template <typename T>
bool decays_to_function_pointer_by_unary_plus constexpr
Evaluates to true if an instance of T decays to a free-function pointer by explicit unary plus.
template <typename T>
bool decays_to_pointer_by_unary_plus constexpr
Evaluates to true if an instance of T decays to a pointer by explicit unary plus.
template <typename... T>
epsilon_type<T...> default_epsilon constexpr
The default floating-point epsilon value used when comparing floating-point types named by T.
size_t dynamic_extent constexpr
Indicates the number of elements covered by a span should be dynamically-determined at runtime.
template <typename T, typename U = T>
bool has_addition_operator constexpr
True if a pair of types has an addition operator (T + U).
template <typename T>
bool has_arrow_operator constexpr
True if a type has an arrow operator (T->).
template <typename T, typename U = T>
bool has_bitwise_and_operator constexpr
True if a pair of types has a bitwise AND operator (T & U).
template <typename T, typename U = T>
bool has_bitwise_lsh_operator constexpr
True if a pair of types has a bitwise left-shift operator (T << U).
template <typename T>
bool has_bitwise_not_operator constexpr
True if a type has a unary bitwise NOT operator (~T).
template <typename T, typename U = T>
bool has_bitwise_or_operator constexpr
True if a pair of types has a bitwise OR operator (T | U).
template <typename T, typename U = T>
bool has_bitwise_rsh_operator constexpr
True if a pair of types has a bitwise right-shift operator (T >> U).
template <typename T, typename U = T>
bool has_bitwise_xor_operator constexpr
True if a pair of types has a bitwise XOR operator (T ^ U).
template <typename T>
bool has_data_member_function constexpr
True if a type has a member function data() returning a pointer.
template <typename T, typename U = T>
bool has_division_operator constexpr
True if a pair of types has a division operator (T / U).
template <typename T, typename U = T>
bool has_equality_operator constexpr
True if a pair of types has an equality operator (T == U).
template <typename T, typename U = T>
bool has_greater_than_operator constexpr
True if a pair of types has a greater-than operator (T > U).
template <typename T, typename U = T>
bool has_greater_than_or_equal_operator constexpr
True if a pair of types has a greater-than-or-equal operator (T >= U).
template <typename T>
bool has_indirection_operator constexpr
True if a type has an indirection operator (*T).
template <typename T, typename U = T>
bool has_inequality_operator constexpr
True if a pair of types has an inequality operator (T != U).
template <typename T, typename U = T>
bool has_less_than_operator constexpr
True if a pair of types has a less-than operator (T < U).
template <typename T, typename U = T>
bool has_less_than_or_equal_operator constexpr
True if a pair of types has a less-than-or-equal operator (T <= U).
template <typename T, typename U = T>
bool has_logical_and_operator constexpr
True if a pair of types has a logical AND operator (T && U).
template <typename T>
bool has_logical_not_operator constexpr
True if a type has a unary logical NOT operator (!T).
template <typename T, typename U = T>
bool has_logical_or_operator constexpr
True if a pair of types has a logical OR operator (T || U).
template <typename T, typename U = T>
bool has_modulo_operator constexpr
True if a pair of types has an modulo operator (T % U).
template <typename T, typename U = T>
bool has_multiplication_operator constexpr
True if a pair of types has a multiplication operator (T * U).
template <typename T>
bool has_post_decrement_operator constexpr
True if a type has a post-decrement operator (T--).
template <typename T>
bool has_post_increment_operator constexpr
True if a type has a post-increment operator (T++).
template <typename T>
bool has_pre_decrement_operator constexpr
True if a type has a pre-decrement operator (--T).
template <typename T>
bool has_pre_increment_operator constexpr
True if a type has a pre-increment operator (++T).
template <typename T>
bool has_size_member_function constexpr
True if a type has a member function size() returning an arithmetic integral type.
template <typename T, typename U = size_t>
bool has_subscript_operator constexpr
True if a pair of types has a subscript operator (T[U]).
template <typename T, typename U = T>
bool has_subtraction_operator constexpr
True if a pair of types has a subtraction operator (T - U).
template <typename T>
bool has_unambiguous_function_call_operator constexpr
True if a type has single non-template operator() overload.
template <typename T>
bool has_unary_minus_operator constexpr
True if a type has a unary minus operator (-T).
template <typename T>
bool has_unary_plus_operator constexpr
True if a type has a unary plus operator (+T).
template <typename T, typename U, typename... V>
size_t index_of_type constexpr
The index of the first appearance of the type T in the type list [U, V...].
template <typename Child, typename Parent>
bool inherits_from constexpr
Does Child inherit from Parent?
template <typename Child, typename Parent, typename... Parents>
bool inherits_from_all constexpr
Does Child inherit from all of the types named by Parent?
template <typename Child, typename Parent, typename... Parents>
bool inherits_from_any constexpr
Does Child inherit from any of the types named by Parent?
template <typename T>
bool is_arithmetic constexpr
Is a type arithmetic or reference-to-arithmetic?
template <typename T>
bool is_array constexpr
Is a type an array, or reference to one?
template <typename T>
bool is_bounded_array constexpr
Is a type a bounded array (T[N]), or reference to one?
template <typename T>
bool is_character constexpr
Is a type a built-in text character (code unit) type, or reference to one?
template <typename T>
bool is_code_unit constexpr
Is a type a built-in text code unit (character) type, or reference to one?
template <typename T>
bool is_const constexpr
Is a type const or reference-to-const?
template <typename From, typename To>
bool is_convertible constexpr
True if From is implicitly or explicitly convertible to To.
template <typename From, typename... To>
bool is_convertible_to_all constexpr
True if From is implicitly or explicitly convertible to all of the types named by To.
template <typename From, typename... To>
bool is_convertible_to_any constexpr
True if From is implicitly or explicitly convertible to any of the types named by To.
template <typename T>
bool is_cv constexpr
Is a type const and/or volatile-qualified?
template <typename T>
bool is_cvref constexpr
Is a type const, volatile, or a reference?
template <template<typename...> typename Trait, typename... Args>
auto is_detected constexpr
Detects if a type supports an interface.
template <typename T>
bool is_enum constexpr
Is a type an enum or reference-to-enum?
template <typename From, typename To>
bool is_explicitly_convertible constexpr
True if From is explicitly convertible to To.
template <typename From, typename... To>
bool is_explicitly_convertible_to_all constexpr
True if From is explicitly convertible to all of the types named by To.
template <typename From, typename... To>
bool is_explicitly_convertible_to_any constexpr
True if From is explicitly convertible to any of the types named by To.
template <typename From, typename To>
bool is_explicitly_nothrow_convertible constexpr
True if From is explicitly nothrow-convertible to To.
template <typename From, typename... To>
bool is_explicitly_nothrow_convertible_to_all constexpr
True if From is explicitly nothrow-convertible to all of the types named by To.
template <typename From, typename... To>
bool is_explicitly_nothrow_convertible_to_any constexpr
True if From is explicitly nothrow-convertible to any of the types named by To.
template <typename T>
bool is_extended_arithmetic constexpr
Is a type a nonstandard 'extended' arithmetic type, or a reference to one?
template <typename T>
bool is_floating_point constexpr
Is a type a floating-point or reference-to-floating-point?
template <typename T>
bool is_function constexpr
Is a type a free/static function, or reference to one?
template <typename T>
bool is_function_pointer constexpr
Is a type a free/static function pointer, or reference to one?
template <typename From, typename To>
bool is_implicitly_convertible constexpr
True if From is implicitly convertible to To.
template <typename From, typename... To>
bool is_implicitly_convertible_to_all constexpr
True if From is implicitly convertible to all of the types named by To.
template <typename From, typename... To>
bool is_implicitly_convertible_to_any constexpr
True if From is implicitly convertible to any of the types named by To.
template <typename From, typename To>
bool is_implicitly_nothrow_convertible constexpr
True if From is implicitly nothrow-convertible to To.
template <typename From, typename... To>
bool is_implicitly_nothrow_convertible_to_all constexpr
True if From is implicitly nothrow-convertible to all of the types named by To.
template <typename From, typename... To>
bool is_implicitly_nothrow_convertible_to_any constexpr
True if From is implicitly nothrow-convertible to any of the types named by To.
template <typename T>
bool is_integer constexpr
Is a type an arithmetic integer type, or reference to one?
template <typename T>
bool is_integral constexpr
Is a type an integral type or a reference to an integral type?
template <typename T>
bool is_iterable constexpr
Returns true if a type is a bounded array or a class type having begin() and end() iterators (as members, in the std namespace, or found via ADL).
template <typename T>
bool is_legacy_enum constexpr
Is a type a pre-C++11 unscoped enum, or reference to one?
template <typename T>
bool is_mutex_like constexpr
True if a type has a lock interface compatible with std::mutex.
template <typename From, typename To>
bool is_nothrow_convertible constexpr
True if From is implicitly or explicitly nothrow-convertible to To.
template <typename From, typename... To>
bool is_nothrow_convertible_to_all constexpr
True if From is implicitly or explicitly nothrow-convertible to all of the types named by To.
template <typename From, typename... To>
bool is_nothrow_convertible_to_any constexpr
True if From is implicitly or explicitly nothrow-convertible to any of the types named by To.
template <typename T>
bool is_scoped_enum constexpr
Is a type a C++11 scoped enum class, or reference to one?
template <typename T>
bool is_shared_mutex_like constexpr
True if a type has a lock interface compatible with std::shared_mutex.
template <typename T>
bool is_signed constexpr
Is a type signed or reference-to-signed?
template <typename T>
bool is_standard_arithmetic constexpr
Is a type one of the standard c++ arithmetic types, or a reference to one?
template <typename T, typename CompatibleWithFunc = void>
bool is_stateless_lambda constexpr
Evaluates to true if T is a stateless lambda type, or a reference to one.
template <typename T>
bool is_trivially_manifestable constexpr
Evaluates to true if T is an empty class/union with trivial default constructor and destructor, or a reference to one.
template <typename T>
bool is_tuple_like constexpr
True if the type implements std::tuple_size and std::tuple_element.
template <typename T>
bool is_unbounded_array constexpr
Is a type an unbounded array (T[]), or reference to one?
template <typename T>
bool is_unsigned constexpr
Is a type unsigned or reference-to-unsigned?
template <typename T>
bool is_volatile constexpr
Is a type volatile or reference-to-volatile?
template <typename T>
size_t pointer_rank constexpr
The rank of a pointer.
template <typename... T>
size_t total_size constexpr
The sum of sizeof() for all of the types named by T.
template <typename T>
size_t tuple_size constexpr
Equivalent to std::tuple_size_v, but safe to use in SFINAE contexts.
template <typename T>
auto type_name constexpr
A muu::fixed_string containing the name of a type.
template <typename... T>
auto type_name_list constexpr
A muu::fixed_string containing a comma-delimited list of type names.

Enum documentation

enum class muu::uuid_variant: uint8_t
#include <muu/uuid.h>

A UUID variant as per RFC 4122.

Enumerators
none

No variant specified.

standard

The 'standard' variant outlaid in RFC 4122.

reserved_ncs

Reserved for backward compatibility.

reserved_microsoft

Reserved for backward compatibility.

reserved_future

Reserved for backward compatibility.

enum class muu::uuid_version: uint8_t
#include <muu/uuid.h>

A UUID version as per RFC 4122.

Enumerators
none

No version specified.

time

Version 1: Time-based UUID.

dce

Version 2: DCE Security version, with embedded POSIX UIDs.

name_md5

Version 3: Name-based UUID generated using MD5 hashing.

random

Version 4: Randomly-generated UUID.

name_sha1

Version 5: Name-based UUID generated using SHA-1 hashing.

unknown

Unknown or non-standard version.

Function documentation

template <typename S, size_t D>
delta_scalar_type muu::angle(const vector<S, D>& v1, const vector<S, D>& v2) constexpr noexcept

Calculates the angle between two vectors.

Parameters
v1 A vector.
v2 A vector.
Returns The angle between v1 and v2 (in radians).

template <typename S, size_t D>
vector<S, D> muu::clamp(const vector<S, D>& v, const vector<S, D>& low, const vector<S, D>& high) constexpr noexcept

Componentwise clamps a vector between two others.

template <typename S, size_t D>
delta_scalar_type muu::consteval_distance(const vector<S, D>& p1, const vector<S, D>& p2) consteval noexcept

Returns the distance between two points.

template <typename S, size_t D>
delta_scalar_type muu::consteval_length(const vector<S, D>& v) consteval noexcept

Returns the length (magnitude) of a vector.

template <typename S, size_t D>
vector<S, D> muu::consteval_normalize(const vector<S, D>& v) consteval noexcept

Normalizes a vector.

Parameters
v The vector to normalize.
Returns A normalized copy of the input vector.

template <typename S>
product_type muu::cross(const vector<S, 3>& lhs, const vector<S, 3>& rhs) constexpr noexcept

Returns the cross product of two three-dimensional vectors.

template <typename S, size_t R, size_t C>
determinant_type muu::determinant(const matrix<S, R, C>& m) constexpr noexcept

Calculates the determinant of a matrix.

template <typename S, size_t D>
delta_type muu::direction(const vector<S, D>& from, const vector<S, D>& to, delta_scalar_type& distance_out) constexpr noexcept

Returns the normalized direction vector from one position to another.

Parameters
from The start position.
to The end position.
distance_out An output param to receive the distance between the two points.
Returns A normalized direction vector pointing from the start position to the end position.

template <typename S, size_t D>
delta_type muu::direction(const vector<S, D>& from, const vector<S, D>& to) constexpr noexcept

Returns the normalized direction vector from one position to another.

Parameters
from The start position.
to The end position.
Returns A normalized direction vector pointing from the start position to the end position.

template <typename S, size_t D>
delta_scalar_type muu::distance(const vector<S, D>& p1, const vector<S, D>& p2) constexpr noexcept

Returns the distance between two points.

template <typename S, size_t D>
delta_scalar_type muu::distance_squared(const vector<S, D>& p1, const vector<S, D>& p2) constexpr noexcept

Returns the squared distance between two points.

template <typename S>
S muu::dot(const quaternion<S>& q1, const quaternion<S>& q2) constexpr noexcept

Returns the dot product of two quaternions.

template <typename S, size_t D>
product_scalar_type muu::dot(const vector<S, D>& v1, const vector<S, D>& v2) constexpr noexcept

Returns the dot product of two vectors.

template <typename S, size_t R, size_t C>
inverse_type muu::invert(const matrix<S, R, C>& m) constexpr noexcept

Returns the inverse of a matrix.

template <typename S, size_t D>
delta_scalar_type muu::length(const vector<S, D>& v) constexpr noexcept

Returns the length (magnitude) of a vector.

template <typename S, size_t D>
delta_scalar_type muu::length_squared(const vector<S, D>& v) constexpr noexcept

Returns the squared length of a vector.

template <typename S, size_t D, typename... T>
vector<S, D> muu::max(const vector<S, D>& v1, const vector<S, D>& v2, const T&... vecs) constexpr noexcept

Returns the componentwise maximum of two or more vectors.

template <typename S, size_t D, typename... T>
vector<S, D> muu::min(const vector<S, D>& v1, const vector<S, D>& v2, const T&... vecs) constexpr noexcept

Returns the componentwise minimum of two or more vectors.

template <typename S>
quaternion<S> muu::normalize(const quaternion<S>& q) constexpr noexcept

Normalizes a quaternion.

Parameters
q The quaternion to normalize.
Returns A normalized copy of the input quaternion.

template <typename S, size_t D>
vector<S, D> muu::normalize(const vector<S, D>& v, delta_scalar_type& length_out) constexpr noexcept

Normalizes a vector.

Parameters
v The vector to normalize.
length_out An output param to receive the length of the vector pre-normalization.
Returns A normalized copy of the input vector.

template <typename S, size_t D>
vector<S, D> muu::normalize(const vector<S, D>& v) constexpr noexcept

Normalizes a vector.

Parameters
v The vector to normalize.
Returns A normalized copy of the input vector.

#include <muu/plane.h>
template <typename S>
bool muu::normalized(const plane<S>& p) constexpr noexcept

Returns true if a plane is normalized.

template <typename S>
bool muu::normalized(const quaternion<S>& q) constexpr noexcept

Returns true if a quaternion is normalized (i.e. has a length of 1).

template <typename S, size_t D>
bool muu::normalized(const vector<S, D>& v) constexpr noexcept

Returns true if a vector is normalized (i.e. has a length of 1).

template <typename S, size_t R, size_t C>
matrix<S, R, C> muu::orthonormalize(const matrix<S, R, C>& m) constexpr noexcept

Returns a copy of a matrix with the 3x3 part orthonormalized.

template <typename S>
quaternion<S> muu::slerp(const quaternion<S>& start, const quaternion<S>& finish, S alpha) constexpr noexcept

Performs a spherical-linear interpolation between two quaternions.

template <typename S, size_t R, size_t C>
matrix<S, C, R> muu::transpose(const matrix<S, R, C>& m) constexpr noexcept

Returns a transposed copy of a matrix.