mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-03 20:34:26 +02:00
std::ratio<1> set as a default for unit
This commit is contained in:
@@ -36,7 +36,7 @@ namespace units {
|
|||||||
template<Unit U = struct ampere, Number Rep = double>
|
template<Unit U = struct ampere, Number Rep = double>
|
||||||
using current = quantity<dimension_current, U, Rep>;
|
using current = quantity<dimension_current, U, Rep>;
|
||||||
|
|
||||||
struct ampere : unit<dimension_current, std::ratio<1>> {};
|
struct ampere : unit<dimension_current> {};
|
||||||
template<> struct upcasting_traits<upcast_from<ampere>> : upcast_to<ampere> {};
|
template<> struct upcasting_traits<upcast_from<ampere>> : upcast_to<ampere> {};
|
||||||
|
|
||||||
inline namespace literals {
|
inline namespace literals {
|
||||||
|
@@ -37,7 +37,7 @@ namespace units {
|
|||||||
using length = quantity<dimension_length, U, Rep>;
|
using length = quantity<dimension_length, U, Rep>;
|
||||||
|
|
||||||
// SI units
|
// SI units
|
||||||
struct meter : unit<dimension_length, std::ratio<1>> {};
|
struct meter : unit<dimension_length> {};
|
||||||
template<> struct upcasting_traits<upcast_from<meter>> : upcast_to<meter> {};
|
template<> struct upcasting_traits<upcast_from<meter>> : upcast_to<meter> {};
|
||||||
|
|
||||||
struct millimeter : milli<meter> {};
|
struct millimeter : milli<meter> {};
|
||||||
|
@@ -36,7 +36,7 @@ namespace units {
|
|||||||
template<Unit U = struct candela, Number Rep = double>
|
template<Unit U = struct candela, Number Rep = double>
|
||||||
using luminous_intensity = quantity<dimension_luminous_intensity, U, Rep>;
|
using luminous_intensity = quantity<dimension_luminous_intensity, U, Rep>;
|
||||||
|
|
||||||
struct candela : unit<dimension_luminous_intensity, std::ratio<1>> {};
|
struct candela : unit<dimension_luminous_intensity> {};
|
||||||
template<> struct upcasting_traits<upcast_from<candela>> : upcast_to<candela> {};
|
template<> struct upcasting_traits<upcast_from<candela>> : upcast_to<candela> {};
|
||||||
|
|
||||||
inline namespace literals {
|
inline namespace literals {
|
||||||
|
@@ -36,7 +36,7 @@ namespace units {
|
|||||||
template<Unit U = struct mole, Number Rep = double>
|
template<Unit U = struct mole, Number Rep = double>
|
||||||
using substance = quantity<dimension_substance, U, Rep>;
|
using substance = quantity<dimension_substance, U, Rep>;
|
||||||
|
|
||||||
struct mole : unit<dimension_substance, std::ratio<1>> {};
|
struct mole : unit<dimension_substance> {};
|
||||||
template<> struct upcasting_traits<upcast_from<mole>> : upcast_to<mole> {};
|
template<> struct upcasting_traits<upcast_from<mole>> : upcast_to<mole> {};
|
||||||
|
|
||||||
inline namespace literals {
|
inline namespace literals {
|
||||||
|
@@ -36,7 +36,7 @@ namespace units {
|
|||||||
template<Unit U = struct kelvin, Number Rep = double>
|
template<Unit U = struct kelvin, Number Rep = double>
|
||||||
using temperature = quantity<dimension_temperature, U, Rep>;
|
using temperature = quantity<dimension_temperature, U, Rep>;
|
||||||
|
|
||||||
struct kelvin : unit<dimension_temperature, std::ratio<1>> {};
|
struct kelvin : unit<dimension_temperature> {};
|
||||||
template<> struct upcasting_traits<upcast_from<kelvin>> : upcast_to<kelvin> {};
|
template<> struct upcasting_traits<upcast_from<kelvin>> : upcast_to<kelvin> {};
|
||||||
|
|
||||||
inline namespace literals {
|
inline namespace literals {
|
||||||
|
@@ -36,7 +36,7 @@ namespace units {
|
|||||||
template<Unit U = struct second, Number Rep = double>
|
template<Unit U = struct second, Number Rep = double>
|
||||||
using time = quantity<dimension_time, U, Rep>;
|
using time = quantity<dimension_time, U, Rep>;
|
||||||
|
|
||||||
struct second : unit<dimension_time, std::ratio<1>> {};
|
struct second : unit<dimension_time> {};
|
||||||
template<> struct upcasting_traits<upcast_from<second>> : upcast_to<second> {};
|
template<> struct upcasting_traits<upcast_from<second>> : upcast_to<second> {};
|
||||||
|
|
||||||
struct nanosecond : nano<second> {};
|
struct nanosecond : nano<second> {};
|
||||||
|
@@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
namespace units {
|
namespace units {
|
||||||
|
|
||||||
template<Dimension D, Ratio R>
|
template<Dimension D, Ratio R = std::ratio<1>>
|
||||||
requires (R::num > 0)
|
requires (R::num > 0)
|
||||||
struct unit : upcast_base<unit<D, R>> {
|
struct unit : upcast_base<unit<D, R>> {
|
||||||
using dimension = D;
|
using dimension = D;
|
||||||
|
Reference in New Issue
Block a user