sandbox
Loading...
Searching...
No Matches
sbx::math::literals Namespace Reference

User-defined literals for degree and radian values. More...

Functions

constexpr auto operator""_deg (long double value) noexcept -> degree
 Creates a degree value from a long double literal. More...
 
constexpr auto operator""_deg (unsigned long long value) noexcept -> degree
 Creates a degree value from an unsigned integer literal. More...
 
constexpr auto operator""_rad (long double value) noexcept -> radian
 Creates a radian value from a long double literal. More...
 
constexpr auto operator""_rad (unsigned long long value) noexcept -> radian
 Creates a radian value from an unsigned integer literal. More...
 

Detailed Description

User-defined literals for degree and radian values.

These literals create values using the library's default scalar type (std::float_t).

Function Documentation

◆ operator""_deg() [1/2]

constexpr auto sbx::math::literals::operator""_deg ( long double  value) -> degree
constexprnoexcept

Creates a degree value from a long double literal.

Parameters
valueDegree literal.
Returns
Degree value.

◆ operator""_deg() [2/2]

constexpr auto sbx::math::literals::operator""_deg ( unsigned long long  value) -> degree
constexprnoexcept

Creates a degree value from an unsigned integer literal.

Parameters
valueDegree literal.
Returns
Degree value.

◆ operator""_rad() [1/2]

constexpr auto sbx::math::literals::operator""_rad ( long double  value) -> radian
constexprnoexcept

Creates a radian value from a long double literal.

Parameters
valueRadian literal.
Returns
Radian value.

◆ operator""_rad() [2/2]

constexpr auto sbx::math::literals::operator""_rad ( unsigned long long  value) -> radian
constexprnoexcept

Creates a radian value from an unsigned integer literal.

Parameters
valueRadian literal.
Returns
Radian value.