#include <boost/serialization/nvp.hpp>
#include <boost/exception/exception.hpp>
#include <boost/exception/info.hpp>
#include <duds/general/SignExtend.hpp>
#include <stdexcept>
#include <cstdint>
Go to the source code of this file.
|
| #define | DUDS_UNIT_VALUE(A, cd, K, kg, m, mol, s, rad, sr) |
| | Creates the internal value used by duds::Unit in a way that allows the compiler to generate a constant value. More...
|
| |
◆ DUDS_UNIT_VALUE
| #define DUDS_UNIT_VALUE |
( |
|
A, |
|
|
|
cd, |
|
|
|
K, |
|
|
|
kg, |
|
|
|
m, |
|
|
|
mol, |
|
|
|
s, |
|
|
|
rad, |
|
|
|
sr |
|
) |
| |
Value:(((A) & 0xF) | (((cd) & 0xF) << 4) | (((K) & 0xF) << 8) | \
(((kg) & 0xF) << 12) | (((m) & 0xF) << 16) | (((mol) & 0xF) << 20) | \
(((s) & 0xF) << 24) | (((rad) & 3) << 28) | (((sr) & 3) << 30))
Creates the internal value used by duds::Unit in a way that allows the compiler to generate a constant value.
The Unit constructor that takes the same set of parameters cannot be declared as constexpr, but using this macro along with duds::Unit::Unit(std::int32_t) makes a constant when all the macro's parameters are constants.
- Parameters
-
| A | The exponent for amperes. |
| cd | The exponent for candelas. |
| K | The exponent for kelvin. |
| kg | The exponent for kilograms. |
| m | The exponent for meters. |
| mol | The exponent for moles. |
| s | The exponent for seconds. |
| rad | The exponent for radians. |
| sr | The exponent for steradians. |
Definition at line 678 of file Unit.hpp.