libdonut  2.3.2
Application framework for cross-platform game development in C++20
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
donut Namespace Reference

Namespaces

 application
 
 audio
 
 base64
 
 events
 
 graphics
 
 json
 
 numbers
 
 obj
 
 random
 
 reflection
 
 unicode
 
 xml
 

Classes

class  AtlasPacker
 Axis-aligned rectangle packer for expandable square texture atlases. More...
 
class  Color
 Normalized floating-point RGBA color type with 32 bits per component. More...
 
class  File
 Unique handle to a file in the virtual Filesystem. More...
 
struct  FilesystemOptions
 Configuration options for a virtual Filesystem. More...
 
class  Filesystem
 Persistent system for managing the virtual filesystem. More...
 
class  LinearMemoryResource
 
class  LinearAllocator
 
class  LinearBuffer
 
class  LooseQuadtree
 Quadtree-based space subdivision container, optimized for intersection queries between 2D axis-aligned boxes. More...
 
struct  Overloaded
 Visitor type for combining callable objects, such as lambdas, into an overload set. More...
 
struct  LineSegment
 Generic line segment between two points. More...
 
struct  Sphere
 Generic sphere shape with a center and radius. More...
 
struct  Circle
 Flat 2D circle shape with a center and radius. More...
 
struct  Capsule
 Generic capsule shape with a center line segment and radius. More...
 
struct  Box
 Generic axis-aligned box shape with minimum and maximum extents. More...
 
struct  Rectangle
 Flat 2D axis-aligned rectangle shape with a position and size. More...
 
class  Time
 Time duration value wrapper. More...
 
class  UniqueHandle
 Generic nullable RAII resource handle with exclusive ownership of a resource that is automatically destroyed on handle destruction. More...
 
class  Variant
 Tagged union value type that holds a value of one of the given types. More...
 
struct  Monostate
 Unit type for representing an empty alternative in Variant. More...
 
struct  BadVariantAccess
 Exception type that is thrown on an attempt to erroneously access an inactive alternative of a Variant when using a safe access function such as Variant::get(). More...
 

Typedefs

template<std::size_t Index, typename B >
using linear_buffer_alternative_t = typename linear_buffer_alternative< Index, B >::type
 
template<length_t L, typename T >
using Point = vec< L, T >
 Generic point in space. More...
 
template<length_t L, typename T >
using Length = vec< L, T >
 Generic length in space. More...
 
template<std::size_t Index, typename V >
using variant_alternative_t = typename variant_alternative< Index, V >::type
 Get the type of the variant alternative with a given index in a variant type. More...
 

Enumerations

enum class  FilesystemMountPriority { LOWER , HIGHER }
 Mount priority for a newly mounted archive to a virtual Filesystem, relative to all previously mounted archives. More...
 

Functions

template<typename... Functors>
 Overloaded (Functors...) -> Overloaded< Functors... >
 
template<length_t L, typename T >
constexpr Box< L, T > getAabbOf (const LineSegment< L, T > &line) noexcept
 Get the axis-aligned bounding box of a line segment. More...
 
template<length_t L, typename T >
constexpr Box< L, T > getAabbOf (const Sphere< L, T > &sphere) noexcept
 Get the axis-aligned bounding box of a sphere. More...
 
template<typename T >
constexpr Box< 2, T > getAabbOf (const Circle< T > &circle) noexcept
 Get the axis-aligned bounding box of a circle. More...
 
template<length_t L, typename T >
constexpr Box< L, T > getAabbOf (const Capsule< L, T > &capsule) noexcept
 Get the axis-aligned bounding box of a capsule. More...
 
template<length_t L, typename T >
constexpr Box< L, T > getAabbOf (const Box< L, T > &box) noexcept
 Get the axis-aligned bounding box of an axis-aligned box. More...
 
template<typename T >
constexpr Box< 2, T > getAabbOf (const Rectangle< T > &rectangle) noexcept
 Get the axis-aligned bounding box of a rectangle. More...
 
template<length_t L, typename T >
constexpr bool intersects (const Sphere< L, T > &a, const Sphere< L, T > &b) noexcept
 Check if two spheres intersect. More...
 
template<typename T >
constexpr bool intersects (const Circle< T > &a, const Circle< T > &b) noexcept
 Check if two cirlces intersect. More...
 
template<length_t L, typename T >
constexpr bool intersects (const Box< L, T > &a, const Box< L, T > &b) noexcept
 Check if two axis-aligned boxes intersect. More...
 
template<typename T >
constexpr bool intersects (const Rectangle< T > &a, const Rectangle< T > &b) noexcept
 Check if two rectangles intersect. More...
 
template<typename T >
constexpr bool intersects (const Circle< T > &a, const Sphere< 2, T > &b) noexcept
 Check if a circle intersects with a sphere. More...
 
template<typename T >
constexpr bool intersects (const Sphere< 2, T > &a, const Circle< T > &b) noexcept
 Check if a sphere intersects with a circle. More...
 
template<typename T >
constexpr bool intersects (const Rectangle< T > &a, const Box< 2, T > &b) noexcept
 Check if a rectangle intersects with an axis-aligned box. More...
 
template<typename T >
constexpr bool intersects (const Box< 2, T > &a, const Rectangle< T > &b) noexcept
 Check if an axis-aligned box intersects with a rectangle. More...
 
template<length_t L, typename T >
constexpr bool intersects (const Sphere< L, T > &a, const Box< L, T > &b) noexcept
 Check if a sphere intersects with an axis-aligned box. More...
 
template<length_t L, typename T >
constexpr bool intersects (const Box< L, T > &a, const Sphere< L, T > &b) noexcept
 Check if an axis-aligned box intersects with a sphere. More...
 
template<typename T >
constexpr bool intersects (const Circle< T > &a, const Box< 2, T > &b) noexcept
 Check if a circle intersects with an axis-aligned box. More...
 
template<typename T >
constexpr bool intersects (const Box< 2, T > &a, const Circle< T > &b) noexcept
 Check if an axis-aligned box intersects with a circle. More...
 
template<typename T >
constexpr bool intersects (const Sphere< 2, T > &a, const Rectangle< T > &b) noexcept
 Check if a sphere intersects with a rectangle. More...
 
template<typename T >
constexpr bool intersects (const Rectangle< T > &a, const Sphere< 2, T > &b) noexcept
 Check if a rectangle intersects with a sphere. More...
 
template<typename T >
constexpr bool intersects (const Circle< T > &a, const Rectangle< T > &b) noexcept
 Check if a circle intersects with a rectangle. More...
 
template<typename T >
constexpr bool intersects (const Rectangle< T > &a, const Circle< T > &b) noexcept
 Check if a rectangle intersects with a circle. More...
 
template<length_t L, typename T >
constexpr bool intersects (const Sphere< L, T > &a, const Capsule< L, T > &b) noexcept
 Check if a sphere intersects with a capsule. More...
 
template<length_t L, typename T >
constexpr bool intersects (const Capsule< L, T > &a, const Sphere< L, T > &b) noexcept
 Check if a capsule intersects with a sphere. More...
 
template<typename T >
constexpr bool intersects (const Circle< T > &a, const Capsule< 2, T > &b) noexcept
 Check if a circle intersects with a capsule. More...
 
template<typename T >
constexpr bool intersects (const Capsule< 2, T > &a, const Circle< T > &b) noexcept
 Check if a capsule intersects with a circle. More...
 
template<length_t L, typename T >
constexpr bool intersects (const Sphere< L, T > &a, const LineSegment< L, T > &b) noexcept
 Check if a sphere intersects with a line segment. More...
 
template<length_t L, typename T >
constexpr bool intersects (const LineSegment< L, T > &a, const Sphere< L, T > &b) noexcept
 Check if a line segment intersects with a sphere. More...
 
template<typename T >
constexpr bool intersects (const Circle< T > &a, const LineSegment< 2, T > &b) noexcept
 Check if a circle intersects with a line segment. More...
 
template<typename T >
constexpr bool intersects (const LineSegment< 2, T > &a, const Circle< T > &b) noexcept
 Check if a line segment intersects with a circle. More...
 
template<typename T , typename Period >
constexpr Time< T, Period > operator* (Time< T, Period > a, T b) noexcept
 
template<typename T , typename Period >
constexpr Time< T, Period > operator* (T a, Time< T, Period > b) noexcept
 
template<typename T , typename Period >
constexpr Time< T, Period > operator/ (Time< T, Period > a, T b) noexcept
 
template<length_t L, typename T , typename Period >
constexpr vec< L, T > operator* (vec< L, T > a, Time< T, Period > b) noexcept
 
template<length_t L, typename T , typename Period >
constexpr vec< L, T > operator* (Time< T, Period > a, vec< L, T > b) noexcept
 
template<length_t L, typename T , typename Period >
constexpr vec< L, T > operator/ (vec< L, T > a, Time< T, Period > b) noexcept
 
template<length_t L, typename T , typename Period >
constexpr vec< L, T > operator/ (Time< T, Period > a, vec< L, T > b) noexcept
 
constexpr bool operator== (Monostate, Monostate) noexcept
 Compare two monostates for equality. More...
 
constexpr std::strong_ordering operator<=> (Monostate, Monostate) noexcept
 Compare two monostates. More...
 
template<typename Visitor , detail::derived_from_template_specialization_of< Variant > V>
constexpr decltype(auto) visit (Visitor &&visitor, V &&variant)
 Call a visitor functor with the currently active underlying value of a variant. More...
 
template<typename T , typename... Ts>
constexpr bool holds_alternative (const Variant< Ts... > &variant) noexcept
 Check if a variant currently holds the alternative with the given type. More...
 
template<typename T , typename... Ts>
constexpr T & get (Variant< Ts... > &variant)
 Access the underlying value with the given type of a variant. More...
 
template<typename T , typename... Ts>
constexpr const T & get (const Variant< Ts... > &variant)
 Access the underlying value with the given type of a variant. More...
 
template<std::size_t Index, typename... Ts>
constexpr variant_alternative_t< Index, Variant< Ts... > > & get (Variant< Ts... > &variant)
 Access the underlying value with the given index of a variant. More...
 
template<std::size_t Index, typename... Ts>
constexpr const variant_alternative_t< Index, Variant< Ts... > > & get (const Variant< Ts... > &variant)
 Access the underlying value with the given index of a variant. More...
 
template<typename T , typename... Ts>
constexpr T * get_if (Variant< Ts... > *variant) noexcept
 Access the underlying value with the given type of a variant if it is the currently active alternative. More...
 
template<typename T , typename... Ts>
constexpr const T * get_if (const Variant< Ts... > *variant) noexcept
 Access the underlying value with the given type of a variant if it is the currently active alternative. More...
 
template<std::size_t Index, typename... Ts>
constexpr variant_alternative_t< Index, Variant< Ts... > > * get_if (Variant< Ts... > *variant) noexcept
 Access the underlying value with the given index of a variant if it is the currently active alternative. More...
 
template<std::size_t Index, typename... Ts>
constexpr const variant_alternative_t< Index, Variant< Ts... > > * get_if (const Variant< Ts... > *variant) noexcept
 Access the underlying value with the given index of a variant if it is the currently active alternative. More...
 
template<typename... Ts>
constexpr bool operator== (const Variant< Ts... > &a, const Variant< Ts... > &b)
 Compare two variants for equality. More...
 
template<typename... Ts>
constexpr bool operator!= (const Variant< Ts... > &a, const Variant< Ts... > &b)
 Compare two variants for inequality. More...
 
template<typename... Ts>
constexpr bool operator< (const Variant< Ts... > &a, const Variant< Ts... > &b)
 Check if a variant is less than another variant. More...
 
template<typename... Ts>
constexpr bool operator<= (const Variant< Ts... > &a, const Variant< Ts... > &b)
 Check if a variant is less than or equal to another variant. More...
 
template<typename... Ts>
constexpr bool operator> (const Variant< Ts... > &a, const Variant< Ts... > &b)
 Check if a variant is greater than another variant. More...
 
template<typename... Ts>
constexpr bool operator>= (const Variant< Ts... > &a, const Variant< Ts... > &b)
 Check if a variant is greater than or equal to another variant. More...
 
template<typename... Ts>
constexpr std::common_comparison_category_t< std::compare_three_way_result_t< Ts >... > operator<=> (const Variant< Ts... > &a, const Variant< Ts... > &b)
 Compare two variants. More...
 
template<typename V >
constexpr detail::Matcher< V > match (V &&variant)
 Choose a function overload to execute based on the active alternative of a variant. More...
 

Variables

template<typename T , typename B >
constexpr bool linear_buffer_has_alternative_v = linear_buffer_has_alternative<T, B>::value
 
template<typename T , typename B >
constexpr std::size_t linear_buffer_index_v = linear_buffer_index<T, B>::value
 
template<typename B >
constexpr std::size_t linear_buffer_size_v = linear_buffer_size<B>::value
 
template<typename T , typename V >
constexpr bool variant_has_alternative_v = variant_has_alternative<T, V>::value
 Check if a variant type has a given type as one of its possible alternatives. More...
 
template<typename T , typename V >
constexpr std::size_t variant_index_v = variant_index<T, V>::value
 Get the index of the variant alternative with a given type in a variant type. More...
 
template<typename V >
constexpr std::size_t variant_size_v = variant_size<V>::value
 Get the number of alternative types of a variant type. More...
 

Typedef Documentation

◆ linear_buffer_alternative_t

template<std::size_t Index, typename B >
using donut::linear_buffer_alternative_t = typedef typename linear_buffer_alternative<Index, B>::type

◆ Point

template<length_t L, typename T >
using donut::Point = typedef vec<L, T>

Generic point in space.

Template Parameters
Lnumber of vector dimensions.
Tcomponent type for vector coordinates.

◆ Length

template<length_t L, typename T >
using donut::Length = typedef vec<L, T>

Generic length in space.

Template Parameters
Lnumber of vector dimensions.
Tcomponent type for vector coordinates.

◆ variant_alternative_t

template<std::size_t Index, typename V >
using donut::variant_alternative_t = typedef typename variant_alternative<Index, V>::type

Get the type of the variant alternative with a given index in a variant type.

Template Parameters
Indexindex of the variant alternative type to get.
Vvariant type.

Enumeration Type Documentation

◆ FilesystemMountPriority

Mount priority for a newly mounted archive to a virtual Filesystem, relative to all previously mounted archives.

Enumerator
LOWER 

Mount the archive at a lower priority than any previously mounted archive, meaning files in already mounted archives will be preferred when choosing which host file to map a virtual filepath to.

HIGHER 

Mount the archive at a higher priority than any previously mounted archive, meaning files in the new archive will be preferred when choosing which host file to map a virtual filepath to.

Function Documentation

◆ Overloaded()

template<typename... Functors>
donut::Overloaded ( Functors...  ) -> Overloaded< Functors... >

◆ getAabbOf() [1/6]

template<length_t L, typename T >
constexpr Box<L, T> donut::getAabbOf ( const LineSegment< L, T > &  line)
constexprnoexcept

Get the axis-aligned bounding box of a line segment.

Parameters
lineline segment to get the bounding box of.
Returns
an axis-aligned box that contains the entire line segment.
Examples
example_game.cpp.

◆ getAabbOf() [2/6]

template<length_t L, typename T >
constexpr Box<L, T> donut::getAabbOf ( const Sphere< L, T > &  sphere)
constexprnoexcept

Get the axis-aligned bounding box of a sphere.

Parameters
spheresphere to get the bounding box of.
Returns
an axis-aligned box that contains the entire sphere.

◆ getAabbOf() [3/6]

template<typename T >
constexpr Box<2, T> donut::getAabbOf ( const Circle< T > &  circle)
constexprnoexcept

Get the axis-aligned bounding box of a circle.

Parameters
circlecircle to get the bounding box of.
Returns
an axis-aligned box that contains the entire circle.

◆ getAabbOf() [4/6]

template<length_t L, typename T >
constexpr Box<L, T> donut::getAabbOf ( const Capsule< L, T > &  capsule)
constexprnoexcept

Get the axis-aligned bounding box of a capsule.

Parameters
capsulecapsule to get the bounding box of.
Returns
an axis-aligned box that contains the entire capsule.

◆ getAabbOf() [5/6]

template<length_t L, typename T >
constexpr Box<L, T> donut::getAabbOf ( const Box< L, T > &  box)
constexprnoexcept

Get the axis-aligned bounding box of an axis-aligned box.

Parameters
boxaxis-aligned box to get the bounding box of.
Returns
an axis-aligned box that contains the entire axis-aligned box.

◆ getAabbOf() [6/6]

template<typename T >
constexpr Box<2, T> donut::getAabbOf ( const Rectangle< T > &  rectangle)
constexprnoexcept

Get the axis-aligned bounding box of a rectangle.

Parameters
rectanglerectangle to get the bounding box of.
Returns
an axis-aligned box that contains the entire rectangle.

◆ intersects() [1/24]

template<length_t L, typename T >
constexpr bool donut::intersects ( const Sphere< L, T > &  a,
const Sphere< L, T > &  b 
)
constexprnoexcept

Check if two spheres intersect.

Parameters
afirst sphere.
bsecond sphere.
Returns
true if the first and second spheres are colliding with each other, false otherwise.
Examples
example_game.cpp.

◆ intersects() [2/24]

template<typename T >
constexpr bool donut::intersects ( const Circle< T > &  a,
const Circle< T > &  b 
)
constexprnoexcept

Check if two cirlces intersect.

Parameters
afirst circle.
bsecond circle.
Returns
true if the first and second circles are colliding with each other, false otherwise.

◆ intersects() [3/24]

template<length_t L, typename T >
constexpr bool donut::intersects ( const Box< L, T > &  a,
const Box< L, T > &  b 
)
constexprnoexcept

Check if two axis-aligned boxes intersect.

Parameters
afirst box.
bsecond box.
Returns
true if the first and second boxes are colliding with each other, false otherwise.

◆ intersects() [4/24]

template<typename T >
constexpr bool donut::intersects ( const Rectangle< T > &  a,
const Rectangle< T > &  b 
)
constexprnoexcept

Check if two rectangles intersect.

Parameters
afirst rectangle.
bsecond rectangle.
Returns
true if the first and second rectangles are colliding with each other, false otherwise.

◆ intersects() [5/24]

template<typename T >
constexpr bool donut::intersects ( const Circle< T > &  a,
const Sphere< 2, T > &  b 
)
constexprnoexcept

Check if a circle intersects with a sphere.

Parameters
acircle.
bsphere.
Returns
true if the circle and sphere are colliding with each other, false otherwise.

◆ intersects() [6/24]

template<typename T >
constexpr bool donut::intersects ( const Sphere< 2, T > &  a,
const Circle< T > &  b 
)
constexprnoexcept

Check if a sphere intersects with a circle.

Parameters
asphere.
bcircle.
Returns
true if the sphere and circle are colliding with each other, false otherwise.

◆ intersects() [7/24]

template<typename T >
constexpr bool donut::intersects ( const Rectangle< T > &  a,
const Box< 2, T > &  b 
)
constexprnoexcept

Check if a rectangle intersects with an axis-aligned box.

Parameters
arectangle.
bbox.
Returns
true if the rectangle and box are colliding with each other, false otherwise.

◆ intersects() [8/24]

template<typename T >
constexpr bool donut::intersects ( const Box< 2, T > &  a,
const Rectangle< T > &  b 
)
constexprnoexcept

Check if an axis-aligned box intersects with a rectangle.

Parameters
abox.
brectangle.
Returns
true if the box and rectangle are colliding with each other, false otherwise.

◆ intersects() [9/24]

template<length_t L, typename T >
constexpr bool donut::intersects ( const Sphere< L, T > &  a,
const Box< L, T > &  b 
)
constexprnoexcept

Check if a sphere intersects with an axis-aligned box.

Parameters
asphere.
bbox.
Returns
true if the sphere and box are colliding with each other, false otherwise.

◆ intersects() [10/24]

template<length_t L, typename T >
constexpr bool donut::intersects ( const Box< L, T > &  a,
const Sphere< L, T > &  b 
)
constexprnoexcept

Check if an axis-aligned box intersects with a sphere.

Parameters
abox.
bsphere.
Returns
true if the box and sphere are colliding with each other, false otherwise.

◆ intersects() [11/24]

template<typename T >
constexpr bool donut::intersects ( const Circle< T > &  a,
const Box< 2, T > &  b 
)
constexprnoexcept

Check if a circle intersects with an axis-aligned box.

Parameters
acircle.
bbox.
Returns
true if the circle and box are colliding with each other, false otherwise.

◆ intersects() [12/24]

template<typename T >
constexpr bool donut::intersects ( const Box< 2, T > &  a,
const Circle< T > &  b 
)
constexprnoexcept

Check if an axis-aligned box intersects with a circle.

Parameters
abox.
bcircle.
Returns
true if the box and circle are colliding with each other, false otherwise.

◆ intersects() [13/24]

template<typename T >
constexpr bool donut::intersects ( const Sphere< 2, T > &  a,
const Rectangle< T > &  b 
)
constexprnoexcept

Check if a sphere intersects with a rectangle.

Parameters
asphere.
brectangle.
Returns
true if the sphere and rectangle are colliding with each other, false otherwise.

◆ intersects() [14/24]

template<typename T >
constexpr bool donut::intersects ( const Rectangle< T > &  a,
const Sphere< 2, T > &  b 
)
constexprnoexcept

Check if a rectangle intersects with a sphere.

Parameters
arectangle.
bsphere.
Returns
true if the rectangle and sphere are colliding with each other, false otherwise.

◆ intersects() [15/24]

template<typename T >
constexpr bool donut::intersects ( const Circle< T > &  a,
const Rectangle< T > &  b 
)
constexprnoexcept

Check if a circle intersects with a rectangle.

Parameters
acircle.
brectangle.
Returns
true if the circle and rectangle are colliding with each other, false otherwise.

◆ intersects() [16/24]

template<typename T >
constexpr bool donut::intersects ( const Rectangle< T > &  a,
const Circle< T > &  b 
)
constexprnoexcept

Check if a rectangle intersects with a circle.

Parameters
arectangle.
bcircle.
Returns
true if the rectangle and circle are colliding with each other, false otherwise.

◆ intersects() [17/24]

template<length_t L, typename T >
constexpr bool donut::intersects ( const Sphere< L, T > &  a,
const Capsule< L, T > &  b 
)
constexprnoexcept

Check if a sphere intersects with a capsule.

Parameters
asphere.
bcapsule.
Returns
true if the sphere and capsule are colliding with each other, false otherwise.

◆ intersects() [18/24]

template<length_t L, typename T >
constexpr bool donut::intersects ( const Capsule< L, T > &  a,
const Sphere< L, T > &  b 
)
constexprnoexcept

Check if a capsule intersects with a sphere.

Parameters
acapsule.
bsphere.
Returns
true if the capsule and sphere are colliding with each other, false otherwise.

◆ intersects() [19/24]

template<typename T >
constexpr bool donut::intersects ( const Circle< T > &  a,
const Capsule< 2, T > &  b 
)
constexprnoexcept

Check if a circle intersects with a capsule.

Parameters
acircle.
bcapsule.
Returns
true if the circle and capsule are colliding with each other, false otherwise.

◆ intersects() [20/24]

template<typename T >
constexpr bool donut::intersects ( const Capsule< 2, T > &  a,
const Circle< T > &  b 
)
constexprnoexcept

Check if a capsule intersects with a circle.

Parameters
acapsule.
bcircle.
Returns
true if the capsule and circle are colliding with each other, false otherwise.

◆ intersects() [21/24]

template<length_t L, typename T >
constexpr bool donut::intersects ( const Sphere< L, T > &  a,
const LineSegment< L, T > &  b 
)
constexprnoexcept

Check if a sphere intersects with a line segment.

Parameters
asphere.
bline segment.
Returns
true if the sphere and line segment are colliding with each other, false otherwise.

◆ intersects() [22/24]

template<length_t L, typename T >
constexpr bool donut::intersects ( const LineSegment< L, T > &  a,
const Sphere< L, T > &  b 
)
constexprnoexcept

Check if a line segment intersects with a sphere.

Parameters
aline segment.
bsphere.
Returns
true if the line segment and sphere are colliding with each other, false otherwise.

◆ intersects() [23/24]

template<typename T >
constexpr bool donut::intersects ( const Circle< T > &  a,
const LineSegment< 2, T > &  b 
)
constexprnoexcept

Check if a circle intersects with a line segment.

Parameters
acircle.
bline segment.
Returns
true if the circle and line segment are colliding with each other, false otherwise.

◆ intersects() [24/24]

template<typename T >
constexpr bool donut::intersects ( const LineSegment< 2, T > &  a,
const Circle< T > &  b 
)
constexprnoexcept

Check if a line segment intersects with a circle.

Parameters
aline segment.
bcircle.
Returns
true if the line segment and circle are colliding with each other, false otherwise.

◆ operator*() [1/4]

template<typename T , typename Period >
constexpr Time<T, Period> donut::operator* ( Time< T, Period >  a,
b 
)
constexprnoexcept

◆ operator*() [2/4]

template<typename T , typename Period >
constexpr Time<T, Period> donut::operator* ( a,
Time< T, Period >  b 
)
constexprnoexcept

◆ operator/() [1/3]

template<typename T , typename Period >
constexpr Time<T, Period> donut::operator/ ( Time< T, Period >  a,
b 
)
constexprnoexcept

◆ operator*() [3/4]

template<length_t L, typename T , typename Period >
constexpr vec<L, T> donut::operator* ( vec< L, T >  a,
Time< T, Period >  b 
)
constexprnoexcept

◆ operator*() [4/4]

template<length_t L, typename T , typename Period >
constexpr vec<L, T> donut::operator* ( Time< T, Period >  a,
vec< L, T >  b 
)
constexprnoexcept

◆ operator/() [2/3]

template<length_t L, typename T , typename Period >
constexpr vec<L, T> donut::operator/ ( vec< L, T >  a,
Time< T, Period >  b 
)
constexprnoexcept

◆ operator/() [3/3]

template<length_t L, typename T , typename Period >
constexpr vec<L, T> donut::operator/ ( Time< T, Period >  a,
vec< L, T >  b 
)
constexprnoexcept

◆ operator==() [1/2]

constexpr bool donut::operator== ( Monostate  ,
Monostate   
)
constexprnoexcept

Compare two monostates for equality.

This function always returns true, since monostates are empty unit values containing no state, meaning they are always equal.

Returns
true.

◆ operator<=>() [1/2]

constexpr std::strong_ordering donut::operator<=> ( Monostate  ,
Monostate   
)
constexprnoexcept

Compare two monostates.

This function always returns equal, since monostates are empty unit values containing no state, meaning they are always equal.

Returns
a strong ordering representing equality.

◆ visit()

template<typename Visitor , detail::derived_from_template_specialization_of< Variant > V>
constexpr decltype(auto) donut::visit ( Visitor &&  visitor,
V &&  variant 
)
constexpr

Call a visitor functor with the currently active underlying value of a variant.

Parameters
visitorcallable object that is overloaded to accept any of the variant alternatives as a parameter.
variantvariant whose underlying value to pass to the visitor.
Returns
the result of calling the visitor with the currently active variant alternative value.
Exceptions
BadVariantAccessif the variant is in the valueless by exception state.
anyexception thrown by the visitor.
See also
match()

◆ holds_alternative()

template<typename T , typename... Ts>
constexpr bool donut::holds_alternative ( const Variant< Ts... > &  variant)
constexprnoexcept

Check if a variant currently holds the alternative with the given type.

Check if a variant currently holds the alternative with the given index.

Template Parameters
Talternative type to check for. Must be one of the variant's listed alternative types.
Parameters
variantthe variant to check.
Returns
true if the variant holds a value of the given type, false otherwise.
See also
Variant::is()
Template Parameters
Indexalternative index to check for. Must be within the range of the variant's list of alternative types.
Parameters
variantthe variant to check.
Returns
true if the variant holds a value of the given alternative index, false otherwise.
See also
Variant::is()

◆ get() [1/4]

template<typename T , typename... Ts>
constexpr T& donut::get ( Variant< Ts... > &  variant)
constexpr

Access the underlying value with the given type of a variant.

Template Parameters
Ttype of the currently active value to get. Must be one of the variant's listed alternative types.
Parameters
variantthe variant to get the value of.
Returns
a reference to the value held by the variant.
Exceptions
BadVariantAccessif the variant does not currently hold a value of the given type.
See also
Variant::get()

◆ get() [2/4]

template<typename T , typename... Ts>
constexpr const T& donut::get ( const Variant< Ts... > &  variant)
constexpr

Access the underlying value with the given type of a variant.

Template Parameters
Ttype of the currently active value to get. Must be one of the variant's listed alternative types.
Parameters
variantthe variant to get the value of.
Returns
a read-only reference to the value held by the variant.
Exceptions
BadVariantAccessif the variant does not currently hold a value of the given type.
See also
Variant::get()

◆ get() [3/4]

template<std::size_t Index, typename... Ts>
constexpr variant_alternative_t<Index, Variant<Ts...> >& donut::get ( Variant< Ts... > &  variant)
constexpr

Access the underlying value with the given index of a variant.

Template Parameters
Indexalternative index of the currently active value to get. Must be within the range of the variant's list of alternative types.
Parameters
variantthe variant to get the value of.
Returns
a reference to the value held by the variant.
Exceptions
BadVariantAccessif the variant does not currently hold the given alternative.
See also
Variant::get()

◆ get() [4/4]

template<std::size_t Index, typename... Ts>
constexpr const variant_alternative_t<Index, Variant<Ts...> >& donut::get ( const Variant< Ts... > &  variant)
constexpr

Access the underlying value with the given index of a variant.

Template Parameters
Indexalternative index of the currently active value to get. Must be within the range of the variant's list of alternative types.
Parameters
variantthe variant to get the value of.
Returns
a read-only reference to the value held by the variant.
Exceptions
BadVariantAccessif the variant does not currently hold the given alternative.
See also
Variant::get()

◆ get_if() [1/4]

template<typename T , typename... Ts>
constexpr T* donut::get_if ( Variant< Ts... > *  variant)
constexprnoexcept

Access the underlying value with the given type of a variant if it is the currently active alternative.

Template Parameters
Ttype of the value to get. Must be one of the variant's listed alternative types.
Parameters
variantnon-owning pointer to the variant to get the value of. Must not be nullptr.
Returns
a non-owning pointer to the value held by the variant, or nullptr if the variant does not currently hold a value of the given type.
See also
Variant::get_if()

◆ get_if() [2/4]

template<typename T , typename... Ts>
constexpr const T* donut::get_if ( const Variant< Ts... > *  variant)
constexprnoexcept

Access the underlying value with the given type of a variant if it is the currently active alternative.

Template Parameters
Ttype of the value to get. Must be one of the variant's listed alternative types.
Parameters
variantnon-owning read-only pointer to the variant to get the value of. Must not be nullptr.
Returns
a non-owning read-only pointer to the value held by the variant, or nullptr if the variant does not currently hold a value of the given type.
See also
Variant::get_if()

◆ get_if() [3/4]

template<std::size_t Index, typename... Ts>
constexpr variant_alternative_t<Index, Variant<Ts...> >* donut::get_if ( Variant< Ts... > *  variant)
constexprnoexcept

Access the underlying value with the given index of a variant if it is the currently active alternative.

Template Parameters
Indexalternative index of the value to get. Must be within the range of the variant's list of alternative types.
Parameters
variantnon-owning pointer to the variant to get the value of. Must not be nullptr.
Returns
a non-owning pointer to the value held by the variant, or nullptr if the variant does not currently hold the given alternative.
See also
Variant::get_if()

◆ get_if() [4/4]

template<std::size_t Index, typename... Ts>
constexpr const variant_alternative_t<Index, Variant<Ts...> >* donut::get_if ( const Variant< Ts... > *  variant)
constexprnoexcept

Access the underlying value with the given index of a variant if it is the currently active alternative.

Template Parameters
Indexalternative index of the value to get. Must be within the range of the variant's list of alternative types.
Parameters
variantnon-owning read-only pointer to the variant to get the value of. Must not be nullptr.
Returns
a non-owning read-only pointer to the value held by the variant, or nullptr if the variant does not currently hold the given alternative.
See also
Variant::get_if()

◆ operator==() [2/2]

template<typename... Ts>
constexpr bool donut::operator== ( const Variant< Ts... > &  a,
const Variant< Ts... > &  b 
)
constexpr

Compare two variants for equality.

Parameters
afirst variant.
bsecond variant.
Returns
true if the first and second variant hold the same alternative and their values compare equal, false otherwise.
Exceptions
anyexception thrown by the underlying comparison operator of the relevant alternative type.

◆ operator!=()

template<typename... Ts>
constexpr bool donut::operator!= ( const Variant< Ts... > &  a,
const Variant< Ts... > &  b 
)
constexpr

Compare two variants for inequality.

Parameters
afirst variant.
bsecond variant.
Returns
true if the first and second variant hold different alternatives or if their values do not compare equal, false otherwise.
Exceptions
anyexception thrown by the underlying comparison operator of the relevant alternative type.

◆ operator<()

template<typename... Ts>
constexpr bool donut::operator< ( const Variant< Ts... > &  a,
const Variant< Ts... > &  b 
)
constexpr

Check if a variant is less than another variant.

Parameters
afirst variant.
bsecond variant.
Returns
true if the first variant is less than the second variant, based on their active alternatives and values.
Exceptions
anyexception thrown by the underlying comparison operator of the relevant alternative type.

◆ operator<=()

template<typename... Ts>
constexpr bool donut::operator<= ( const Variant< Ts... > &  a,
const Variant< Ts... > &  b 
)
constexpr

Check if a variant is less than or equal to another variant.

Parameters
afirst variant.
bsecond variant.
Returns
true if the first variant is less than or equal to the second variant, based on their active alternatives and values.
Exceptions
anyexception thrown by the underlying comparison operator of the relevant alternative type.

◆ operator>()

template<typename... Ts>
constexpr bool donut::operator> ( const Variant< Ts... > &  a,
const Variant< Ts... > &  b 
)
constexpr

Check if a variant is greater than another variant.

Parameters
afirst variant.
bsecond variant.
Returns
true if the first variant is greater than the second variant, based on their active alternatives and values.
Exceptions
anyexception thrown by the underlying comparison operator of the relevant alternative type.

◆ operator>=()

template<typename... Ts>
constexpr bool donut::operator>= ( const Variant< Ts... > &  a,
const Variant< Ts... > &  b 
)
constexpr

Check if a variant is greater than or equal to another variant.

Parameters
afirst variant.
bsecond variant.
Returns
true if the first variant is greater than or equal to the second variant, based on their active alternatives and values.
Exceptions
anyexception thrown by the underlying comparison operator of the relevant alternative type.

◆ operator<=>() [2/2]

template<typename... Ts>
constexpr std::common_comparison_category_t<std::compare_three_way_result_t<Ts>...> donut::operator<=> ( const Variant< Ts... > &  a,
const Variant< Ts... > &  b 
)
constexpr

Compare two variants.

Parameters
afirst variant.
bsecond variant.
Returns
an ordering of the first and second variant, based on their active alternatives and values.
Exceptions
anyexception thrown by the underlying comparison operator of the relevant alternative type.

◆ match()

template<typename V >
constexpr detail::Matcher<V> donut::match ( V &&  variant)
constexpr

Choose a function overload to execute based on the active alternative of a variant.

Parameters
variantforwarding reference to the variant to match on.
Returns
an object containing the forwarded variant with a call operator that accepts a set of overloads that take each of the possible variant alternatives as a parameter and calls the overload corresponding to the currently active variant alternative. This call operator may throw BadVariantAccess if the variant is in the valueless by exception state.
Exceptions
anyexception thrown when forwarding the variant to the returned object.
See also
visit()

Variable Documentation

◆ linear_buffer_has_alternative_v

template<typename T , typename B >
constexpr bool donut::linear_buffer_has_alternative_v = linear_buffer_has_alternative<T, B>::value
inlineconstexpr

◆ linear_buffer_index_v

template<typename T , typename B >
constexpr std::size_t donut::linear_buffer_index_v = linear_buffer_index<T, B>::value
inlineconstexpr

◆ linear_buffer_size_v

template<typename B >
constexpr std::size_t donut::linear_buffer_size_v = linear_buffer_size<B>::value
inlineconstexpr

◆ variant_has_alternative_v

template<typename T , typename V >
constexpr bool donut::variant_has_alternative_v = variant_has_alternative<T, V>::value
inlineconstexpr

Check if a variant type has a given type as one of its possible alternatives.

Template Parameters
Talternative type to check for.
Vvariant type.

◆ variant_index_v

template<typename T , typename V >
constexpr std::size_t donut::variant_index_v = variant_index<T, V>::value
inlineconstexpr

Get the index of the variant alternative with a given type in a variant type.

Template Parameters
Ttype of the variant alternative to get the index of.
Vvariant type.

◆ variant_size_v

template<typename V >
constexpr std::size_t donut::variant_size_v = variant_size<V>::value
inlineconstexpr

Get the number of alternative types of a variant type.

Template Parameters
Vvariant type.