std::ratio<1> set as a default for unit

This commit is contained in:
Mateusz Pusz
2019-05-09 19:54:18 -06:00
parent 1bbbd02f1c
commit a63b5ab111
7 changed files with 7 additions and 7 deletions

View File

@@ -36,7 +36,7 @@ namespace units {
template<Unit U = struct ampere, Number Rep = double>
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> {};
inline namespace literals {

View File

@@ -37,7 +37,7 @@ namespace units {
using length = quantity<dimension_length, U, Rep>;
// 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> {};
struct millimeter : milli<meter> {};

View File

@@ -36,7 +36,7 @@ namespace units {
template<Unit U = struct candela, Number Rep = double>
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> {};
inline namespace literals {

View File

@@ -36,7 +36,7 @@ namespace units {
template<Unit U = struct mole, Number Rep = double>
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> {};
inline namespace literals {

View File

@@ -36,7 +36,7 @@ namespace units {
template<Unit U = struct kelvin, Number Rep = double>
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> {};
inline namespace literals {

View File

@@ -36,7 +36,7 @@ namespace units {
template<Unit U = struct second, Number Rep = double>
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> {};
struct nanosecond : nano<second> {};

View File

@@ -27,7 +27,7 @@
namespace units {
template<Dimension D, Ratio R>
template<Dimension D, Ratio R = std::ratio<1>>
requires (R::num > 0)
struct unit : upcast_base<unit<D, R>> {
using dimension = D;