MT Core (C++)
Core library for replacing C++ standard in project usage
|
#include "mtcore/math/core.hpp"
#include "mtcore/math/templates.hpp"
#include "mtcore/meta/base.hpp"
#include <numbers>
#include <ratio>
Go to the source code of this file.
Classes | |
struct | mtcore::units::Unit< UnitCategory, S, PiPow, Tr, exp > |
Represents a single unit of measurement. More... | |
struct | mtcore::units::Units< Unit< Id, S, PiPow, Tr, Exp >, Mappings... > |
struct | mtcore::units::Units<> |
struct | mtcore::units::UnitValue< Underlying, Units<> > |
Specialization where units list is empty (basically a "unitless" value) Can be directly cast to a numeric type. More... | |
struct | mtcore::units::UnitValue< Underlying, Units< U1, UnitsSub... > > |
Represents a unit value with a specific, non-empty unit list. More... | |
Namespaces | |
namespace | mtcore |
Core library for C++ with Zig-related functionality. | |
namespace | mtcore::units |
Base namespace for units. | |
namespace | mtcore::units::dimensions |
Represents prebuilt dimensions for units. | |
Concepts | |
concept | mtcore::units::IsUnit |
Concept to check that a type is a unit. | |
concept | mtcore::units::IsUnitValue |
Concept to check something is a unit value. | |
Macros | |
#define | MTCORE_DEF_UNIT_NAME_NO_ABBREV(NS, UNIT) |
#define | MTCORE_DEF_UNIT_NAME_SYM(NS, UNIT, ABBREV, SYM) |
#define | MTCORE_DEF_UNIT_NAME_STRS(NS, UNIT, NAME, US_NAME, ABBREV, ABBREV_ASCII, ABBREV_US, SYMBOL) |
#define | MTCORE_DEF_UNIT_NAME(NS, UNIT, ABBREV) |
#define | MTCORE_DEF_UNIT_NAME_DIFF_US(NS, UNIT, US_NAME, ABBREV) |
#define | MTCORE_DEF_UNIT_NAME_UNIC_ABB(NS, UNIT, US_NAME, ABBREV, UNIC_ABB) |
#define | MTCORE_DEF_UNIT_NAME_SI_PREFIXES_SMALL(NS, UNIT, US_NAME, ABBREV) |
#define | MTCORE_DEF_UNIT_NAME_SI_PREFIXES_LARGE(NS, UNIT, US_NAME, ABBREV) |
#define | MTCORE_DEF_UNIT_NAME_SI(NS, UNIT, US_NAME, ABBREV) |
Functions | |
template<std::floating_point Val, typename... Dims> | |
constexpr UnitValue< Val, Units< Dims... > > | mtcore::units::operator* (Val lhs, const Units< Dims... > &) |
Multiply a number with units to get a unit value. | |
template<typename... Dims1, typename... Dims2> | |
constexpr auto | mtcore::units::operator* (const Units< Dims1... > &, const Units< Dims2... > &) |
Multiply units to combine them. | |
template<typename... Dims1, typename... Dims2> | |
constexpr auto | mtcore::units::operator/ (const Units< Dims1... > &, const Units< Dims2... > &) |
Divide units to combine them. | |
template<std::floating_point Val, typename... Dims> | |
constexpr auto | mtcore::units::operator/ (Val lhs, const Units< Dims... > &) |
Divide units with a number to get a unit value. | |
template<typename U1, typename Us1, typename U2, typename Us2> | |
constexpr auto | mtcore::units::operator* (const UnitValue< U1, Us1 > &lhs, const UnitValue< U2, Us2 > &rhs) |
Multiply unit values together. | |
template<typename U1, typename Us1, typename U2, typename Us2> | |
constexpr auto | mtcore::units::operator/ (const UnitValue< U1, Us1 > &lhs, const UnitValue< U2, Us2 > &rhs) |
Divide unit values. | |
template<std::floating_point I, typename U, typename Us> | |
constexpr auto | mtcore::units::operator/ (I value, UnitValue< U, Us > lhs) |
Divide a number with a unit value. | |
template<std::floating_point I, typename U, typename Us> | |
constexpr auto | mtcore::units::operator/ (UnitValue< U, Us > lhs, I value) |
Divide a unit value with a number. | |
template<std::integral I, typename U, typename Us> | |
constexpr auto | mtcore::units::operator/ (I value, const UnitValue< U, Us > &lhs) |
Divide a number with a unit value. | |
template<std::floating_point Val, typename U, typename Us> | |
constexpr UnitValue< U, Us > | mtcore::units::operator* (const UnitValue< U, Us > &lhs, Val rhs) |
Multiply a unit value with a number. | |
template<std::floating_point Val, typename U, typename Us> | |
constexpr UnitValue< Val, Us > | mtcore::units::operator* (Val lhs, const UnitValue< U, Us > &rhs) |
Multiply a unit value with a number. | |
template<typename U, typename Us, typename... Dims> | |
constexpr auto | mtcore::units::operator* (UnitValue< U, Us > lhs, const Units< Dims... > &u) |
Multiply a unit value with units to combine them. | |
template<typename U, typename Us, typename... Dims> | |
constexpr auto | mtcore::units::operator/ (UnitValue< U, Us > lhs, const Units< Dims... > &u) |
Divide a unit value with units to combine them. | |
Variables | |
constexpr size_t | mtcore::units::dimensions::LENGTH = 0 |
For units representing length. | |
constexpr size_t | mtcore::units::dimensions::MASS = 1 |
For units representing mass. | |
constexpr size_t | mtcore::units::dimensions::TIME = 2 |
For units representing time. | |
constexpr size_t | mtcore::units::dimensions::ANGLE = 3 |
For units representing angles. | |
constexpr size_t | mtcore::units::dimensions::CURRENT = 4 |
For units representing current (electricity) | |
constexpr size_t | mtcore::units::dimensions::TEMPERATURE = 5 |
For units representing temperature. | |
constexpr size_t | mtcore::units::dimensions::SUBSTANCE = 6 |
For units representing substance. | |
constexpr size_t | mtcore::units::dimensions::LUMINOSITY = 7 |
For units representing luminosity. | |
constexpr size_t | mtcore::units::dimensions::STORAGE = 8 |
For units representing storage. | |
#define MTCORE_DEF_UNIT_NAME | ( | NS, | |
UNIT, | |||
ABBREV ) |
Definition at line 915 of file units/base.hpp.
#define MTCORE_DEF_UNIT_NAME_DIFF_US | ( | NS, | |
UNIT, | |||
US_NAME, | |||
ABBREV ) |
Definition at line 926 of file units/base.hpp.
#define MTCORE_DEF_UNIT_NAME_NO_ABBREV | ( | NS, | |
UNIT ) |
Definition at line 882 of file units/base.hpp.
#define MTCORE_DEF_UNIT_NAME_SI | ( | NS, | |
UNIT, | |||
US_NAME, | |||
ABBREV ) |
Definition at line 966 of file units/base.hpp.
#define MTCORE_DEF_UNIT_NAME_SI_PREFIXES_LARGE | ( | NS, | |
UNIT, | |||
US_NAME, | |||
ABBREV ) |
Definition at line 957 of file units/base.hpp.
#define MTCORE_DEF_UNIT_NAME_SI_PREFIXES_SMALL | ( | NS, | |
UNIT, | |||
US_NAME, | |||
ABBREV ) |
Definition at line 948 of file units/base.hpp.
#define MTCORE_DEF_UNIT_NAME_STRS | ( | NS, | |
UNIT, | |||
NAME, | |||
US_NAME, | |||
ABBREV, | |||
ABBREV_ASCII, | |||
ABBREV_US, | |||
SYMBOL ) |
Definition at line 904 of file units/base.hpp.
#define MTCORE_DEF_UNIT_NAME_SYM | ( | NS, | |
UNIT, | |||
ABBREV, | |||
SYM ) |
Definition at line 893 of file units/base.hpp.
#define MTCORE_DEF_UNIT_NAME_UNIC_ABB | ( | NS, | |
UNIT, | |||
US_NAME, | |||
ABBREV, | |||
UNIC_ABB ) |
Definition at line 937 of file units/base.hpp.