|
Phyth v0.1.0
A dimensional safe C++ header-only mechanics and electromagnetics simulation library.
|
Static registrar for unit types. More...
#include <UnitsRegistry.hpp>
Public Member Functions | |
| UnitRegistrar (const std::string &name, const std::string &symbol) | |
| Register the unit with the given name and symbol. | |
Static registrar for unit types.
UnitRegistrar registers a unit at static initialization time, before main() is called. This allows units to be registered automatically without requiring explicit registration calls.
| UnitT | The unit type to register |
Usage: // In a .cpp file or header (with inline): static UnitRegistrar<Meter> meterRegistrar("Meter", "m"); static UnitRegistrar<Second> secondRegistrar("Second", "s"); static UnitRegistrar<Newton> newtonRegistrar("Newton", "N");
Definition at line 122 of file UnitsRegistry.hpp.
|
inline |
Register the unit with the given name and symbol.
| name | Full unit name |
| symbol | Unit symbol |
Definition at line 129 of file UnitsRegistry.hpp.