Prefixed units support redesigned

This commit is contained in:
Mateusz Pusz
2019-10-18 15:34:46 +02:00
parent 95028d10a7
commit b864461636
30 changed files with 284 additions and 236 deletions
+4 -6
View File
@@ -35,12 +35,10 @@ namespace {
template<typename T>
concept DigitalInformation = units::QuantityOf<T, digital_information>;
using namespace units::hacks;
struct data_prefix {};
struct bit : units::coherent_derived_unit<bit, decltype("b"_fs), digital_information, data_prefix> {};
struct byte : units::derived_unit<byte, decltype("B"_fs), digital_information, units::ratio<8>> {};
struct bit : units::coherent_derived_unit<bit, "b", digital_information, data_prefix> {};
struct byte : units::derived_unit<byte, "B", digital_information, units::ratio<8>> {};
inline namespace literals {
@@ -65,11 +63,11 @@ namespace {
// power spectral density
struct power_spectral_density : derived_dimension<power_spectral_density, units::exp<voltage, 2>, units::exp<frequency, -1>> {};
struct sq_volt_per_hertz : coherent_derived_unit<sq_volt_per_hertz, decltype("V^2/Hz"_fs), power_spectral_density> {};
struct sq_volt_per_hertz : coherent_derived_unit<sq_volt_per_hertz, "V^2/Hz", power_spectral_density> {};
// amplitude spectral density
struct amplitude_spectral_density : derived_dimension<amplitude_spectral_density, units::exp<voltage, 1>, units::exp<frequency, -1, 2>> {};
struct volt_per_sqrt_hertz : coherent_derived_unit<volt_per_sqrt_hertz, decltype("V/Hz^(1/2)"_fs), amplitude_spectral_density> {};
struct volt_per_sqrt_hertz : coherent_derived_unit<volt_per_sqrt_hertz, "V/Hz^(1/2)", amplitude_spectral_density> {};
}
namespace {