Skip to content

Commit

Permalink
std::ratio<1> set as a default for unit
Browse files Browse the repository at this point in the history
  • Loading branch information
mpusz committed May 10, 2019
1 parent 1bbbd02 commit a63b5ab
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/include/units/current.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/include/units/length.h
Original file line number Diff line number Diff line change
Expand Up @@ -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> {};
Expand Down
2 changes: 1 addition & 1 deletion src/include/units/luminous_intensity.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/include/units/substance.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/include/units/temperature.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/include/units/time.h
Original file line number Diff line number Diff line change
Expand Up @@ -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> {};
Expand Down
2 changes: 1 addition & 1 deletion src/include/units/unit.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a63b5ab

Please sign in to comment.