forked from mpusz/mp-units
Derived unit factory helpers refactored
This commit is contained in:
@@ -33,14 +33,14 @@ namespace data {
|
||||
template<typename T>
|
||||
concept DigitalInformation = units::QuantityOf<T, digital_information>;
|
||||
|
||||
struct data_prefix;
|
||||
struct data_prefix : units::prefix_type {};
|
||||
|
||||
struct kibi : units::prefix<kibi, data_prefix, units::ratio< 1'024>, "Ki"> {};
|
||||
struct mebi : units::prefix<mebi, data_prefix, units::ratio<1'048'576>, "Mi"> {};
|
||||
|
||||
struct bit : units::named_coherent_derived_unit<bit, "b", digital_information, data_prefix> {};
|
||||
struct bit : units::named_coherent_derived_unit<bit, digital_information, "b", data_prefix> {};
|
||||
struct kilobit : units::prefixed_derived_unit<kilobit, kibi, bit> {};
|
||||
struct byte : units::named_derived_unit<byte, "B", digital_information, units::ratio<8>> {};
|
||||
struct byte : units::named_scaled_derived_unit<byte, digital_information, "B", units::ratio<8>, data_prefix> {};
|
||||
struct kilobyte : units::prefixed_derived_unit<kilobyte, kibi, byte> {};
|
||||
|
||||
inline namespace literals {
|
||||
|
||||
@@ -31,11 +31,11 @@ namespace cgs {
|
||||
using units::gram;
|
||||
using units::second;
|
||||
struct centimetre_per_second : units::deduced_derived_unit<centimetre_per_second, units::velocity, centimetre, second> {};
|
||||
struct gal : units::named_deduced_derived_unit<gal, "Gal", units::acceleration, centimetre, second> {};
|
||||
struct dyne : units::named_deduced_derived_unit<dyne, "dyn", units::force, centimetre, gram, second> {};
|
||||
struct erg : units::named_deduced_derived_unit<erg, "erg", units::energy, centimetre, gram, second> {};
|
||||
struct ergps : units::named_deduced_derived_unit<ergps, "erg/s", units::power, centimetre, gram, second> {}; // TODO make it work for erg and non-named
|
||||
struct barye : units::named_deduced_derived_unit<barye, "Ba", units::pressure, centimetre, gram, second> {};
|
||||
struct gal : units::named_deduced_derived_unit<gal, units::acceleration, "Gal", units::no_prefix, centimetre, second> {};
|
||||
struct dyne : units::named_deduced_derived_unit<dyne, units::force, "dyn", units::no_prefix, centimetre, gram, second> {};
|
||||
struct erg : units::named_deduced_derived_unit<erg, units::energy, "erg", units::no_prefix, centimetre, gram, second> {};
|
||||
struct ergps : units::named_deduced_derived_unit<ergps, units::power, "erg/s", units::no_prefix, centimetre, gram, second> {}; // TODO make it work for erg and non-named
|
||||
struct barye : units::named_deduced_derived_unit<barye, units::pressure, "Ba", units::no_prefix, centimetre, gram, second> {};
|
||||
|
||||
|
||||
inline namespace literals {
|
||||
|
||||
@@ -35,14 +35,14 @@ namespace {
|
||||
template<typename T>
|
||||
concept DigitalInformation = units::QuantityOf<T, digital_information>;
|
||||
|
||||
struct data_prefix {};
|
||||
struct data_prefix : units::prefix_type {};
|
||||
|
||||
struct kibi : units::prefix<kibi, data_prefix, units::ratio< 1'024>, "Ki"> {};
|
||||
|
||||
struct bit : units::named_coherent_derived_unit<bit, "b", digital_information, data_prefix> {};
|
||||
struct bit : units::named_coherent_derived_unit<bit, digital_information, "b", data_prefix> {};
|
||||
struct kilobit : units::prefixed_derived_unit<kilobit, kibi, bit> {};
|
||||
|
||||
struct byte : units::named_derived_unit<byte, "B", digital_information, units::ratio<8>> {};
|
||||
struct byte : units::named_scaled_derived_unit<byte, digital_information, "B", units::ratio<8>, data_prefix> {};
|
||||
struct kilobyte : units::prefixed_derived_unit<kilobyte, kibi, byte> {};
|
||||
|
||||
inline namespace literals {
|
||||
|
||||
Reference in New Issue
Block a user