downcasting_traits renamed to downcast_traits

- downcasting_traits -> downcast_traits
- downcasting_traits_t -> downcast_traits_t
- downcast_from -> downcast_base_t
- downcast_to removed
This commit is contained in:
Mateusz Pusz committed 2019-09-20 18:36:14 +02:00
1 parent da11f41529
commit 0cffcf7849
32 files changed
+118 -129

No files matched your search

+2 -2
View File
@@ -27,13 +27,13 @@
namespace units {
struct acceleration : make_dimension_t<exp<velocity, 1>, exp<base_dim_time, -1>> {};
template<> struct downcasting_traits<downcast_from<acceleration>> : downcast_to<acceleration> {};
template<> struct downcast_traits<downcast_base_t<acceleration>> : std::type_identity<acceleration> {};
template<typename T>
concept bool Acceleration = QuantityOf<T, acceleration>;
struct metre_per_second_sq : derived_unit<acceleration, metre, second> {};
template<> struct downcasting_traits<downcast_from<metre_per_second_sq>> : downcast_to<metre_per_second_sq> {};
template<> struct downcast_traits<downcast_base_t<metre_per_second_sq>> : std::type_identity<metre_per_second_sq> {};
inline namespace literals {
+6 -6
View File
@@ -27,25 +27,25 @@
namespace units {
struct area : make_dimension_t<exp<base_dim_length, 2>> {};
template<> struct downcasting_traits<downcast_from<area>> : downcast_to<area> {};
template<> struct downcast_traits<downcast_base_t<area>> : std::type_identity<area> {};
template<typename T>
concept bool Area = QuantityOf<T, area>;
struct square_millimetre : derived_unit<area, millimetre> {};
template<> struct downcasting_traits<downcast_from<square_millimetre>> : downcast_to<square_millimetre> {};
template<> struct downcast_traits<downcast_base_t<square_millimetre>> : std::type_identity<square_millimetre> {};
struct square_centimetre : derived_unit<area, centimetre> {};
template<> struct downcasting_traits<downcast_from<square_centimetre>> : downcast_to<square_centimetre> {};
template<> struct downcast_traits<downcast_base_t<square_centimetre>> : std::type_identity<square_centimetre> {};
struct square_metre : derived_unit<area, metre> {};
template<> struct downcasting_traits<downcast_from<square_metre>> : downcast_to<square_metre> {};
template<> struct downcast_traits<downcast_base_t<square_metre>> : std::type_identity<square_metre> {};
struct square_kilometre : derived_unit<area, kilometre, metre> {};
template<> struct downcasting_traits<downcast_from<square_kilometre>> : downcast_to<square_kilometre> {};
template<> struct downcast_traits<downcast_base_t<square_kilometre>> : std::type_identity<square_kilometre> {};
struct square_foot : derived_unit<area, foot> {};
template<> struct downcasting_traits<downcast_from<square_foot>> : downcast_to<square_foot> {};
template<> struct downcast_traits<downcast_base_t<square_foot>> : std::type_identity<square_foot> {};
inline namespace literals {
+2 -2
View File
@@ -29,13 +29,13 @@
namespace units {
struct capacitance : make_dimension_t<exp<electric_charge, 1>, exp<voltage, -1>> {};
template<> struct downcasting_traits<downcast_from<capacitance>> : downcast_to<capacitance> {};
template<> struct downcast_traits<downcast_base_t<capacitance>> : std::type_identity<capacitance> {};
template<typename T>
concept bool Capacitance = QuantityOf<T, capacitance>;
struct farad : derived_unit<capacitance, kilogram, metre, second, ampere> {};
template<> struct downcasting_traits<downcast_from<farad>> : downcast_to<farad> {};
template<> struct downcast_traits<downcast_base_t<farad>> : std::type_identity<farad> {};
inline namespace literals {
+2 -2
View File
@@ -28,13 +28,13 @@
namespace units {
struct current : make_dimension_t<exp<base_dim_current, 1>> {};
template<> struct downcasting_traits<downcast_from<current>> : downcast_to<current> {};
template<> struct downcast_traits<downcast_base_t<current>> : std::type_identity<current> {};
template<typename T>
concept bool Current = QuantityOf<T, current>;
struct ampere : unit<current> {};
template<> struct downcasting_traits<downcast_from<ampere>> : downcast_to<ampere> {};
template<> struct downcast_traits<downcast_base_t<ampere>> : std::type_identity<ampere> {};
inline namespace literals {
@@ -29,13 +29,13 @@
namespace units {
struct electric_charge : make_dimension_t<exp<base_dim_time, 1>, exp<base_dim_current, 1>> {};
template<> struct downcasting_traits<downcast_from<electric_charge>> : downcast_to<electric_charge> {};
template<> struct downcast_traits<downcast_base_t<electric_charge>> : std::type_identity<electric_charge> {};
template<typename T>
concept bool ElectricCharge = QuantityOf<T, electric_charge>;
struct coulomb : derived_unit<electric_charge, second, ampere> {};
template<> struct downcasting_traits<downcast_from<coulomb>> : downcast_to<coulomb> {};
template<> struct downcast_traits<downcast_base_t<coulomb>> : std::type_identity<coulomb> {};
inline namespace literals {
+2 -2
View File
@@ -29,13 +29,13 @@
namespace units {
struct energy : make_dimension_t<exp<force, 1>, exp<length, 1>> {};
template<> struct downcasting_traits<downcast_from<energy>> : downcast_to<energy> {};
template<> struct downcast_traits<downcast_base_t<energy>> : std::type_identity<energy> {};
template<typename T>
concept bool Energy = QuantityOf<T, energy>;
struct joule : derived_unit<energy, kilogram, metre, second> {};
template<> struct downcasting_traits<downcast_from<joule>> : downcast_to<joule> {};
template<> struct downcast_traits<downcast_base_t<joule>> : std::type_identity<joule> {};
inline namespace literals {
+2 -2
View File
@@ -29,13 +29,13 @@
namespace units {
struct force : make_dimension_t<exp<base_dim_mass, 1>, exp<acceleration, 1>> {};
template<> struct downcasting_traits<downcast_from<force>> : downcast_to<force> {};
template<> struct downcast_traits<downcast_base_t<force>> : std::type_identity<force> {};
template<typename T>
concept bool Force = QuantityOf<T, force>;
struct newton : derived_unit<force, kilogram, metre, second> {};
template<> struct downcasting_traits<downcast_from<newton>> : downcast_to<newton> {};
template<> struct downcast_traits<downcast_base_t<newton>> : std::type_identity<newton> {};
inline namespace literals {
+7 -7
View File
@@ -28,28 +28,28 @@
namespace units {
struct frequency : make_dimension_t<exp<base_dim_time, -1>> {};
template<> struct downcasting_traits<downcast_from<frequency>> : downcast_to<frequency> {};
template<> struct downcast_traits<downcast_base_t<frequency>> : std::type_identity<frequency> {};
template<typename T>
concept bool Frequency = QuantityOf<T, frequency>;
struct hertz : derived_unit<frequency, second> {};
template<> struct downcasting_traits<downcast_from<hertz>> : downcast_to<hertz> {};
template<> struct downcast_traits<downcast_base_t<hertz>> : std::type_identity<hertz> {};
struct millihertz : milli<hertz> {};
template<> struct downcasting_traits<downcast_from<millihertz>> : downcast_to<millihertz> {};
template<> struct downcast_traits<downcast_base_t<millihertz>> : std::type_identity<millihertz> {};
struct kilohertz : kilo<hertz> {};
template<> struct downcasting_traits<downcast_from<kilohertz>> : downcast_to<kilohertz> {};
template<> struct downcast_traits<downcast_base_t<kilohertz>> : std::type_identity<kilohertz> {};
struct megahertz : mega<hertz> {};
template<> struct downcasting_traits<downcast_from<megahertz>> : downcast_to<megahertz> {};
template<> struct downcast_traits<downcast_base_t<megahertz>> : std::type_identity<megahertz> {};
struct gigahertz : giga<hertz> {};
template<> struct downcasting_traits<downcast_from<gigahertz>> : downcast_to<gigahertz> {};
template<> struct downcast_traits<downcast_base_t<gigahertz>> : std::type_identity<gigahertz> {};
struct terahertz : tera<hertz> {};
template<> struct downcasting_traits<downcast_from<terahertz>> : downcast_to<terahertz> {};
template<> struct downcast_traits<downcast_base_t<terahertz>> : std::type_identity<terahertz> {};
inline namespace literals {
+9 -9
View File
@@ -28,23 +28,23 @@
namespace units {
struct length : make_dimension_t<exp<base_dim_length, 1>> {};
template<> struct downcasting_traits<downcast_from<length>> : downcast_to<length> {};
template<> struct downcast_traits<downcast_base_t<length>> : std::type_identity<length> {};
template<typename T>
concept bool Length = QuantityOf<T, length>;
// SI units
struct metre : unit<length> {};
template<> struct downcasting_traits<downcast_from<metre>> : downcast_to<metre> {};
template<> struct downcast_traits<downcast_base_t<metre>> : std::type_identity<metre> {};
struct millimetre : milli<metre> {};
template<> struct downcasting_traits<downcast_from<millimetre>> : downcast_to<millimetre> {};
template<> struct downcast_traits<downcast_base_t<millimetre>> : std::type_identity<millimetre> {};
struct centimetre : centi<metre> {};
template<> struct downcasting_traits<downcast_from<centimetre>> : downcast_to<centimetre> {};
template<> struct downcast_traits<downcast_base_t<centimetre>> : std::type_identity<centimetre> {};
struct kilometre : kilo<metre> {};
template<> struct downcasting_traits<downcast_from<kilometre>> : downcast_to<kilometre> {};
template<> struct downcast_traits<downcast_base_t<kilometre>> : std::type_identity<kilometre> {};
inline namespace literals {
@@ -68,16 +68,16 @@ namespace units {
// US customary units
struct yard : unit<length, ratio<9'144, 10'000>> {};
template<> struct downcasting_traits<downcast_from<yard>> : downcast_to<yard> {};
template<> struct downcast_traits<downcast_base_t<yard>> : std::type_identity<yard> {};
struct foot : unit<length, ratio_multiply<ratio<1, 3>, yard::ratio>> {};
template<> struct downcasting_traits<downcast_from<foot>> : downcast_to<foot> {};
template<> struct downcast_traits<downcast_base_t<foot>> : std::type_identity<foot> {};
struct inch : unit<length, ratio_multiply<ratio<1, 12>, foot::ratio>> {};
template<> struct downcasting_traits<downcast_from<inch>> : downcast_to<inch> {};
template<> struct downcast_traits<downcast_base_t<inch>> : std::type_identity<inch> {};
struct mile : unit<length, ratio_multiply<ratio<1'760>, yard::ratio>> {};
template<> struct downcasting_traits<downcast_from<mile>> : downcast_to<mile> {};
template<> struct downcast_traits<downcast_base_t<mile>> : std::type_identity<mile> {};
inline namespace literals {
@@ -28,13 +28,13 @@
namespace units {
struct luminous_intensity : make_dimension_t<exp<base_dim_luminous_intensity, 1>> {};
template<> struct downcasting_traits<downcast_from<luminous_intensity>> : downcast_to<luminous_intensity> {};
template<> struct downcast_traits<downcast_base_t<luminous_intensity>> : std::type_identity<luminous_intensity> {};
template<typename T>
concept bool LuminousIntensity = QuantityOf<T, luminous_intensity>;
struct candela : unit<luminous_intensity> {};
template<> struct downcasting_traits<downcast_from<candela>> : downcast_to<candela> {};
template<> struct downcast_traits<downcast_base_t<candela>> : std::type_identity<candela> {};
inline namespace literals {
+3 -3
View File
@@ -28,16 +28,16 @@
namespace units {
struct mass : make_dimension_t<exp<base_dim_mass, 1>> {};
template<> struct downcasting_traits<downcast_from<mass>> : downcast_to<mass> {};
template<> struct downcast_traits<downcast_base_t<mass>> : std::type_identity<mass> {};
template<typename T>
concept bool Mass = QuantityOf<T, mass>;
struct gram : unit<mass, ratio<1, 1000>> {};
template<> struct downcasting_traits<downcast_from<gram>> : downcast_to<gram> {};
template<> struct downcast_traits<downcast_base_t<gram>> : std::type_identity<gram> {};
struct kilogram : kilo<gram> {};
template<> struct downcasting_traits<downcast_from<kilogram>> : downcast_to<kilogram> {};
template<> struct downcast_traits<downcast_base_t<kilogram>> : std::type_identity<kilogram> {};
inline namespace literals {
+2 -2
View File
@@ -28,13 +28,13 @@
namespace units {
struct power : make_dimension_t<exp<energy, 1>, exp<base_dim_time, -1>> {};
template<> struct downcasting_traits<downcast_from<power>> : downcast_to<power> {};
template<> struct downcast_traits<downcast_base_t<power>> : std::type_identity<power> {};
template<typename T>
concept bool Power = QuantityOf<T, power>;
struct watt : derived_unit<power, kilogram, metre, second> {};
template<> struct downcasting_traits<downcast_from<watt>> : downcast_to<watt> {};
template<> struct downcast_traits<downcast_base_t<watt>> : std::type_identity<watt> {};
inline namespace literals {
+2 -2
View File
@@ -29,13 +29,13 @@
namespace units {
struct pressure : make_dimension_t<exp<force, 1>, exp<area, -1>> {};
template<> struct downcasting_traits<downcast_from<pressure>> : downcast_to<pressure> {};
template<> struct downcast_traits<downcast_base_t<pressure>> : std::type_identity<pressure> {};
template<typename T>
concept bool Pressure = QuantityOf<T, pressure>;
struct pascal : derived_unit<pressure, kilogram, metre, second> {};
template<> struct downcasting_traits<downcast_from<pascal>> : downcast_to<pascal> {};
template<> struct downcast_traits<downcast_base_t<pascal>> : std::type_identity<pascal> {};
inline namespace literals {
+2 -2
View File
@@ -28,13 +28,13 @@
namespace units {
struct substance : make_dimension_t<exp<base_dim_substance, 1>> {};
template<> struct downcasting_traits<downcast_from<substance>> : downcast_to<substance> {};
template<> struct downcast_traits<downcast_base_t<substance>> : std::type_identity<substance> {};
template<typename T>
concept bool Substance = QuantityOf<T, substance>;
struct mole : unit<substance> {};
template<> struct downcasting_traits<downcast_from<mole>> : downcast_to<mole> {};
template<> struct downcast_traits<downcast_base_t<mole>> : std::type_identity<mole> {};
inline namespace literals {
+2 -2
View File
@@ -28,13 +28,13 @@
namespace units {
struct temperature : make_dimension_t<exp<base_dim_temperature, 1>> {};
template<> struct downcasting_traits<downcast_from<temperature>> : downcast_to<temperature> {};
template<> struct downcast_traits<downcast_base_t<temperature>> : std::type_identity<temperature> {};
template<typename T>
concept bool ThermodynamicTemperature = QuantityOf<T, temperature>;
struct kelvin : unit<temperature> {};
template<> struct downcasting_traits<downcast_from<kelvin>> : downcast_to<kelvin> {};
template<> struct downcast_traits<downcast_base_t<kelvin>> : std::type_identity<kelvin> {};
inline namespace literals {
+7 -7
View File
@@ -28,28 +28,28 @@
namespace units {
struct time : make_dimension_t<exp<base_dim_time, 1>> {};
template<> struct downcasting_traits<downcast_from<time>> : downcast_to<time> {};
template<> struct downcast_traits<downcast_base_t<time>> : std::type_identity<time> {};
template<typename T>
concept bool Time = QuantityOf<T, time>;
struct second : unit<time> {};
template<> struct downcasting_traits<downcast_from<second>> : downcast_to<second> {};
template<> struct downcast_traits<downcast_base_t<second>> : std::type_identity<second> {};
struct nanosecond : nano<second> {};
template<> struct downcasting_traits<downcast_from<nanosecond>> : downcast_to<nanosecond> {};
template<> struct downcast_traits<downcast_base_t<nanosecond>> : std::type_identity<nanosecond> {};
struct microsecond : micro<second> {};
template<> struct downcasting_traits<downcast_from<microsecond>> : downcast_to<microsecond> {};
template<> struct downcast_traits<downcast_base_t<microsecond>> : std::type_identity<microsecond> {};
struct millisecond : milli<second> {};
template<> struct downcasting_traits<downcast_from<millisecond>> : downcast_to<millisecond> {};
template<> struct downcast_traits<downcast_base_t<millisecond>> : std::type_identity<millisecond> {};
struct minute : unit<time, ratio<60>> {};
template<> struct downcasting_traits<downcast_from<minute>> : downcast_to<minute> {};
template<> struct downcast_traits<downcast_base_t<minute>> : std::type_identity<minute> {};
struct hour : unit<time, ratio<3600>> {};
template<> struct downcasting_traits<downcast_from<hour>> : downcast_to<hour> {};
template<> struct downcast_traits<downcast_base_t<hour>> : std::type_identity<hour> {};
inline namespace literals {
+4 -4
View File
@@ -28,19 +28,19 @@
namespace units {
struct velocity : make_dimension_t<exp<base_dim_length, 1>, exp<base_dim_time, -1>> {};
template<> struct downcasting_traits<downcast_from<velocity>> : downcast_to<velocity> {};
template<> struct downcast_traits<downcast_base_t<velocity>> : std::type_identity<velocity> {};
template<typename T>
concept bool Velocity = QuantityOf<T, velocity>;
struct metre_per_second : derived_unit<velocity, metre, second> {};
template<> struct downcasting_traits<downcast_from<metre_per_second>> : downcast_to<metre_per_second> {};
template<> struct downcast_traits<downcast_base_t<metre_per_second>> : std::type_identity<metre_per_second> {};
struct kilometre_per_hour : derived_unit<velocity, kilometre, hour> {};
template<> struct downcasting_traits<downcast_from<kilometre_per_hour>> : downcast_to<kilometre_per_hour> {};
template<> struct downcast_traits<downcast_base_t<kilometre_per_hour>> : std::type_identity<kilometre_per_hour> {};
struct mile_per_hour : derived_unit<velocity, mile, hour> {};
template<> struct downcasting_traits<downcast_from<mile_per_hour>> : downcast_to<mile_per_hour> {};
template<> struct downcast_traits<downcast_base_t<mile_per_hour>> : std::type_identity<mile_per_hour> {};
inline namespace literals {
+2 -2
View File
@@ -31,13 +31,13 @@
namespace units {
struct voltage : make_dimension_t<exp<power, 1>, exp<base_dim_current, -1>> {};
template<> struct downcasting_traits<downcast_from<voltage>> : downcast_to<voltage> {};
template<> struct downcast_traits<downcast_base_t<voltage>> : std::type_identity<voltage> {};
template<typename T>
concept bool Voltage = QuantityOf<T, voltage>;
struct volt : derived_unit<voltage, kilogram, metre, second, ampere> {};
template<> struct downcasting_traits<downcast_from<volt>> : downcast_to<volt> {};
template<> struct downcast_traits<downcast_base_t<volt>> : std::type_identity<volt> {};
inline namespace literals {
+6 -6
View File
@@ -27,25 +27,25 @@
namespace units {
struct volume : make_dimension_t<exp<base_dim_length, 3>> {};
template<> struct downcasting_traits<downcast_from<volume>> : downcast_to<volume> {};
template<> struct downcast_traits<downcast_base_t<volume>> : std::type_identity<volume> {};
template<typename T>
concept bool Volume = QuantityOf<T, volume>;
struct cubic_millimetre : derived_unit<volume, millimetre> {};
template<> struct downcasting_traits<downcast_from<cubic_millimetre>> : downcast_to<cubic_millimetre> {};
template<> struct downcast_traits<downcast_base_t<cubic_millimetre>> : std::type_identity<cubic_millimetre> {};
struct cubic_centimetre : derived_unit<volume, centimetre> {};
template<> struct downcasting_traits<downcast_from<cubic_centimetre>> : downcast_to<cubic_centimetre> {};
template<> struct downcast_traits<downcast_base_t<cubic_centimetre>> : std::type_identity<cubic_centimetre> {};
struct cubic_metre : derived_unit<volume, metre> {};
template<> struct downcasting_traits<downcast_from<cubic_metre>> : downcast_to<cubic_metre> {};
template<> struct downcast_traits<downcast_base_t<cubic_metre>> : std::type_identity<cubic_metre> {};
struct cubic_kilometre : derived_unit<volume, kilometre, metre> {};
template<> struct downcasting_traits<downcast_from<cubic_kilometre>> : downcast_to<cubic_kilometre> {};
template<> struct downcast_traits<downcast_base_t<cubic_kilometre>> : std::type_identity<cubic_kilometre> {};
struct cubic_foot : derived_unit<volume, foot> {};
template<> struct downcasting_traits<downcast_from<cubic_foot>> : downcast_to<cubic_foot> {};
template<> struct downcast_traits<downcast_base_t<cubic_foot>> : std::type_identity<cubic_foot> {};
inline namespace literals {