Skip to content

Commit

Permalink
refactor: one_rep moved to a primary units namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
mpusz committed Dec 29, 2020
1 parent dd20790 commit 671f891
Show file tree
Hide file tree
Showing 52 changed files with 546 additions and 546 deletions.
28 changes: 14 additions & 14 deletions src/include/units/data/base/information.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#pragma once

#include <units/bits/one_rep.h>
#include <units/one_rep.h>
#include <units/base_dimension.h>
#include <units/data/prefixes.h>
#include <units/unit.h>
Expand Down Expand Up @@ -74,19 +74,19 @@ constexpr auto operator"" _q_PiB(unsigned long long l) { return information<pebi

namespace unit_constants {

inline constexpr auto b = information<bit, detail::one_rep>{};
inline constexpr auto Kib = information<kibibit, detail::one_rep>{};
inline constexpr auto Mib = information<mebibit, detail::one_rep>{};
inline constexpr auto Gib = information<gibibit, detail::one_rep>{};
inline constexpr auto Tib = information<tebibit, detail::one_rep>{};
inline constexpr auto Pib = information<pebibit, detail::one_rep>{};

inline constexpr auto B = information<byte, detail::one_rep>{};
inline constexpr auto KiB = information<kibibyte, detail::one_rep>{};
inline constexpr auto MiB = information<mebibyte, detail::one_rep>{};
inline constexpr auto GiB = information<gibibyte, detail::one_rep>{};
inline constexpr auto TiB = information<tebibyte, detail::one_rep>{};
inline constexpr auto PiB = information<pebibyte, detail::one_rep>{};
inline constexpr auto b = information<bit, one_rep>{};
inline constexpr auto Kib = information<kibibit, one_rep>{};
inline constexpr auto Mib = information<mebibit, one_rep>{};
inline constexpr auto Gib = information<gibibit, one_rep>{};
inline constexpr auto Tib = information<tebibit, one_rep>{};
inline constexpr auto Pib = information<pebibit, one_rep>{};

inline constexpr auto B = information<byte, one_rep>{};
inline constexpr auto KiB = information<kibibyte, one_rep>{};
inline constexpr auto MiB = information<mebibyte, one_rep>{};
inline constexpr auto GiB = information<gibibyte, one_rep>{};
inline constexpr auto TiB = information<tebibyte, one_rep>{};
inline constexpr auto PiB = information<pebibyte, one_rep>{};

} // namespace unit_constants

Expand Down
12 changes: 6 additions & 6 deletions src/include/units/data/derived/bitrate.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ constexpr auto operator"" _q_Pib_per_s(unsigned long long l) { return bitrate<pe

namespace unit_constants {

inline constexpr auto b_per_s = bitrate<bit_per_second, detail::one_rep>{};
inline constexpr auto Kib_per_s = bitrate<kibibit_per_second, detail::one_rep>{};
inline constexpr auto Mib_per_s = bitrate<mebibit_per_second, detail::one_rep>{};
inline constexpr auto Gib_per_s = bitrate<gibibit_per_second, detail::one_rep>{};
inline constexpr auto Tib_per_s = bitrate<tebibit_per_second, detail::one_rep>{};
inline constexpr auto Pib_per_s = bitrate<pebibit_per_second, detail::one_rep>{};
inline constexpr auto b_per_s = bitrate<bit_per_second, one_rep>{};
inline constexpr auto Kib_per_s = bitrate<kibibit_per_second, one_rep>{};
inline constexpr auto Mib_per_s = bitrate<mebibit_per_second, one_rep>{};
inline constexpr auto Gib_per_s = bitrate<gibibit_per_second, one_rep>{};
inline constexpr auto Tib_per_s = bitrate<tebibit_per_second, one_rep>{};
inline constexpr auto Pib_per_s = bitrate<pebibit_per_second, one_rep>{};

} // namespace unit_constants

Expand Down
12 changes: 6 additions & 6 deletions src/include/units/bits/one_rep.h → src/include/units/one_rep.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include <units/customization_points.h>
#include <type_traits>

namespace units::detail {
namespace units {

struct one_rep {
template<QuantityValue Rep>
Expand All @@ -50,19 +50,19 @@ struct one_rep {
[[nodiscard]] auto operator<=>(const one_rep&) const = default;
};

} // namespace units::detail
} // namespace units

namespace std {
template<>
struct common_type<units::detail::one_rep, units::detail::one_rep> {
using type = units::detail::one_rep;
struct common_type<units::one_rep, units::one_rep> {
using type = units::one_rep;
};
template<units::QuantityValue Rep>
struct common_type<units::detail::one_rep, Rep> {
struct common_type<units::one_rep, Rep> {
using type = Rep;
};
template<units::QuantityValue Rep>
struct common_type<Rep, units::detail::one_rep> {
struct common_type<Rep, units::one_rep> {
using type = Rep;
};

Expand Down
4 changes: 2 additions & 2 deletions src/include/units/physical/si/base/amount_of_substance.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#pragma once

#include <units/bits/one_rep.h>
#include <units/one_rep.h>
#include <units/physical/dimensions/amount_of_substance.h>
#include <units/physical/si/prefixes.h>
#include <units/quantity.h>
Expand All @@ -46,7 +46,7 @@ constexpr auto operator"" _q_mol(long double l) { return amount_of_substance<mol

namespace unit_constants {

inline constexpr auto mol = amount_of_substance<mole, detail::one_rep>{};
inline constexpr auto mol = amount_of_substance<mole, one_rep>{};

} // namespace unit_constants

Expand Down
44 changes: 22 additions & 22 deletions src/include/units/physical/si/base/electric_current.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#pragma once

#include <units/bits/one_rep.h>
#include <units/one_rep.h>
#include <units/physical/dimensions/electric_current.h>
#include <units/physical/si/prefixes.h>
#include <units/quantity.h>
Expand Down Expand Up @@ -146,27 +146,27 @@ constexpr auto operator"" _q_YA(long double l) { return electric_current<yottaam

namespace unit_constants {

inline constexpr auto A = electric_current<ampere, detail::one_rep>{};
inline constexpr auto yA = electric_current<yoctoampere, detail::one_rep>{};
inline constexpr auto zA = electric_current<zeptoampere, detail::one_rep>{};
inline constexpr auto aA = electric_current<attoampere, detail::one_rep>{};
inline constexpr auto fA = electric_current<femtoampere, detail::one_rep>{};
inline constexpr auto pA = electric_current<picoampere, detail::one_rep>{};
inline constexpr auto nA = electric_current<nanoampere, detail::one_rep>{};
inline constexpr auto uA = electric_current<microampere, detail::one_rep>{};
inline constexpr auto mA = electric_current<milliampere, detail::one_rep>{};
inline constexpr auto cA = electric_current<centiampere, detail::one_rep>{};
inline constexpr auto dA = electric_current<deciampere, detail::one_rep>{};
inline constexpr auto daA = electric_current<decaampere, detail::one_rep>{};
inline constexpr auto hA = electric_current<hectoampere, detail::one_rep>{};
inline constexpr auto kA = electric_current<kiloampere, detail::one_rep>{};
inline constexpr auto MA = electric_current<megaampere, detail::one_rep>{};
inline constexpr auto GA = electric_current<gigaampere, detail::one_rep>{};
inline constexpr auto TA = electric_current<teraampere, detail::one_rep>{};
inline constexpr auto PA = electric_current<petaampere, detail::one_rep>{};
inline constexpr auto EA = electric_current<exaampere, detail::one_rep>{};
inline constexpr auto ZA = electric_current<zettaampere, detail::one_rep>{};
inline constexpr auto YA = electric_current<yottaampere, detail::one_rep>{};
inline constexpr auto A = electric_current<ampere, one_rep>{};
inline constexpr auto yA = electric_current<yoctoampere, one_rep>{};
inline constexpr auto zA = electric_current<zeptoampere, one_rep>{};
inline constexpr auto aA = electric_current<attoampere, one_rep>{};
inline constexpr auto fA = electric_current<femtoampere, one_rep>{};
inline constexpr auto pA = electric_current<picoampere, one_rep>{};
inline constexpr auto nA = electric_current<nanoampere, one_rep>{};
inline constexpr auto uA = electric_current<microampere, one_rep>{};
inline constexpr auto mA = electric_current<milliampere, one_rep>{};
inline constexpr auto cA = electric_current<centiampere, one_rep>{};
inline constexpr auto dA = electric_current<deciampere, one_rep>{};
inline constexpr auto daA = electric_current<decaampere, one_rep>{};
inline constexpr auto hA = electric_current<hectoampere, one_rep>{};
inline constexpr auto kA = electric_current<kiloampere, one_rep>{};
inline constexpr auto MA = electric_current<megaampere, one_rep>{};
inline constexpr auto GA = electric_current<gigaampere, one_rep>{};
inline constexpr auto TA = electric_current<teraampere, one_rep>{};
inline constexpr auto PA = electric_current<petaampere, one_rep>{};
inline constexpr auto EA = electric_current<exaampere, one_rep>{};
inline constexpr auto ZA = electric_current<zettaampere, one_rep>{};
inline constexpr auto YA = electric_current<yottaampere, one_rep>{};

} // namespace unit_constants

Expand Down
46 changes: 23 additions & 23 deletions src/include/units/physical/si/base/length.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#pragma once

#include <units/bits/one_rep.h>
#include <units/one_rep.h>
#include <units/physical/dimensions/length.h>
#include <units/physical/si/prefixes.h>
#include <units/quantity.h>
Expand Down Expand Up @@ -152,28 +152,28 @@ constexpr auto operator"" _q_au(long double l) { return length<astronomical_unit

namespace unit_constants {

inline constexpr auto m = length<metre, detail::one_rep>{};
inline constexpr auto ym = length<yoctometre, detail::one_rep>{};
inline constexpr auto zm = length<zeptometre, detail::one_rep>{};
inline constexpr auto am = length<attometre, detail::one_rep>{};
inline constexpr auto fm = length<femtometre, detail::one_rep>{};
inline constexpr auto pm = length<picometre, detail::one_rep>{};
inline constexpr auto nm = length<nanometre, detail::one_rep>{};
inline constexpr auto um = length<micrometre, detail::one_rep>{};
inline constexpr auto mm = length<millimetre, detail::one_rep>{};
inline constexpr auto cm = length<centimetre, detail::one_rep>{};
inline constexpr auto dm = length<decimetre, detail::one_rep>{};
inline constexpr auto dam = length<decametre, detail::one_rep>{};
inline constexpr auto hm = length<hectometre, detail::one_rep>{};
inline constexpr auto km = length<kilometre, detail::one_rep>{};
inline constexpr auto Mm = length<megametre, detail::one_rep>{};
inline constexpr auto Gm = length<gigametre, detail::one_rep>{};
inline constexpr auto Tm = length<terametre, detail::one_rep>{};
inline constexpr auto Pm = length<petametre, detail::one_rep>{};
inline constexpr auto Em = length<exametre, detail::one_rep>{};
inline constexpr auto Zm = length<zettametre, detail::one_rep>{};
inline constexpr auto Ym = length<yottametre, detail::one_rep>{};
inline constexpr auto au = length<astronomical_unit, detail::one_rep>{};
inline constexpr auto m = length<metre, one_rep>{};
inline constexpr auto ym = length<yoctometre, one_rep>{};
inline constexpr auto zm = length<zeptometre, one_rep>{};
inline constexpr auto am = length<attometre, one_rep>{};
inline constexpr auto fm = length<femtometre, one_rep>{};
inline constexpr auto pm = length<picometre, one_rep>{};
inline constexpr auto nm = length<nanometre, one_rep>{};
inline constexpr auto um = length<micrometre, one_rep>{};
inline constexpr auto mm = length<millimetre, one_rep>{};
inline constexpr auto cm = length<centimetre, one_rep>{};
inline constexpr auto dm = length<decimetre, one_rep>{};
inline constexpr auto dam = length<decametre, one_rep>{};
inline constexpr auto hm = length<hectometre, one_rep>{};
inline constexpr auto km = length<kilometre, one_rep>{};
inline constexpr auto Mm = length<megametre, one_rep>{};
inline constexpr auto Gm = length<gigametre, one_rep>{};
inline constexpr auto Tm = length<terametre, one_rep>{};
inline constexpr auto Pm = length<petametre, one_rep>{};
inline constexpr auto Em = length<exametre, one_rep>{};
inline constexpr auto Zm = length<zettametre, one_rep>{};
inline constexpr auto Ym = length<yottametre, one_rep>{};
inline constexpr auto au = length<astronomical_unit, one_rep>{};

} // namespace unit_constants

Expand Down
44 changes: 22 additions & 22 deletions src/include/units/physical/si/base/luminous_intensity.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#pragma once

#include <units/bits/one_rep.h>
#include <units/one_rep.h>
#include <units/physical/dimensions/luminous_intensity.h>
#include <units/physical/si/prefixes.h>
#include <units/quantity.h>
Expand Down Expand Up @@ -146,27 +146,27 @@ constexpr auto operator"" _q_Ycd(long double l) { return luminous_intensity<yott

namespace unit_constants {

inline constexpr auto cd = luminous_intensity<candela, detail::one_rep>{};
inline constexpr auto ycd = luminous_intensity<yoctocandela, detail::one_rep>{};
inline constexpr auto zcd = luminous_intensity<zeptocandela, detail::one_rep>{};
inline constexpr auto acd = luminous_intensity<attocandela, detail::one_rep>{};
inline constexpr auto fcd = luminous_intensity<femtocandela, detail::one_rep>{};
inline constexpr auto pcd = luminous_intensity<picocandela, detail::one_rep>{};
inline constexpr auto ncd = luminous_intensity<nanocandela, detail::one_rep>{};
inline constexpr auto ucd = luminous_intensity<microcandela, detail::one_rep>{};
inline constexpr auto mcd = luminous_intensity<millicandela, detail::one_rep>{};
inline constexpr auto ccd = luminous_intensity<centicandela, detail::one_rep>{};
inline constexpr auto dcd = luminous_intensity<decicandela, detail::one_rep>{};
inline constexpr auto dacd = luminous_intensity<decacandela, detail::one_rep>{};
inline constexpr auto hcd = luminous_intensity<hectocandela, detail::one_rep>{};
inline constexpr auto kcd = luminous_intensity<kilocandela, detail::one_rep>{};
inline constexpr auto Mcd = luminous_intensity<megacandela, detail::one_rep>{};
inline constexpr auto Gcd = luminous_intensity<gigacandela, detail::one_rep>{};
inline constexpr auto Tcd = luminous_intensity<teracandela, detail::one_rep>{};
inline constexpr auto Pcd = luminous_intensity<petacandela, detail::one_rep>{};
inline constexpr auto Ecd = luminous_intensity<exacandela, detail::one_rep>{};
inline constexpr auto Zcd = luminous_intensity<zettacandela, detail::one_rep>{};
inline constexpr auto Ycd = luminous_intensity<yottacandela, detail::one_rep>{};
inline constexpr auto cd = luminous_intensity<candela, one_rep>{};
inline constexpr auto ycd = luminous_intensity<yoctocandela, one_rep>{};
inline constexpr auto zcd = luminous_intensity<zeptocandela, one_rep>{};
inline constexpr auto acd = luminous_intensity<attocandela, one_rep>{};
inline constexpr auto fcd = luminous_intensity<femtocandela, one_rep>{};
inline constexpr auto pcd = luminous_intensity<picocandela, one_rep>{};
inline constexpr auto ncd = luminous_intensity<nanocandela, one_rep>{};
inline constexpr auto ucd = luminous_intensity<microcandela, one_rep>{};
inline constexpr auto mcd = luminous_intensity<millicandela, one_rep>{};
inline constexpr auto ccd = luminous_intensity<centicandela, one_rep>{};
inline constexpr auto dcd = luminous_intensity<decicandela, one_rep>{};
inline constexpr auto dacd = luminous_intensity<decacandela, one_rep>{};
inline constexpr auto hcd = luminous_intensity<hectocandela, one_rep>{};
inline constexpr auto kcd = luminous_intensity<kilocandela, one_rep>{};
inline constexpr auto Mcd = luminous_intensity<megacandela, one_rep>{};
inline constexpr auto Gcd = luminous_intensity<gigacandela, one_rep>{};
inline constexpr auto Tcd = luminous_intensity<teracandela, one_rep>{};
inline constexpr auto Pcd = luminous_intensity<petacandela, one_rep>{};
inline constexpr auto Ecd = luminous_intensity<exacandela, one_rep>{};
inline constexpr auto Zcd = luminous_intensity<zettacandela, one_rep>{};
inline constexpr auto Ycd = luminous_intensity<yottacandela, one_rep>{};

} // namespace unit_constants

Expand Down
88 changes: 44 additions & 44 deletions src/include/units/physical/si/base/mass.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#pragma once

#include <units/bits/one_rep.h>
#include <units/one_rep.h>
#include <units/physical/dimensions/mass.h>
#include <units/physical/si/prefixes.h>
#include <units/quantity.h>
Expand Down Expand Up @@ -258,49 +258,49 @@ constexpr auto operator"" _q_Da(long double l) { return mass<dalton, long double

namespace unit_constants {

inline constexpr auto g = mass<gram, detail::one_rep>{};
inline constexpr auto yg = mass<yoctogram, detail::one_rep>{};
inline constexpr auto zg = mass<zeptogram, detail::one_rep>{};
inline constexpr auto ag = mass<attogram, detail::one_rep>{};
inline constexpr auto fg = mass<femtogram, detail::one_rep>{};
inline constexpr auto pg = mass<picogram, detail::one_rep>{};
inline constexpr auto ng = mass<nanogram, detail::one_rep>{};
inline constexpr auto ug = mass<microgram, detail::one_rep>{};
inline constexpr auto mg = mass<milligram, detail::one_rep>{};
inline constexpr auto cg = mass<centigram, detail::one_rep>{};
inline constexpr auto dg = mass<decigram, detail::one_rep>{};
inline constexpr auto dag = mass<decagram, detail::one_rep>{};
inline constexpr auto hg = mass<hectogram, detail::one_rep>{};
inline constexpr auto kg = mass<kilogram, detail::one_rep>{};
inline constexpr auto Mg = mass<megagram, detail::one_rep>{};
inline constexpr auto Gg = mass<gigagram, detail::one_rep>{};
inline constexpr auto Tg = mass<teragram, detail::one_rep>{};
inline constexpr auto Pg = mass<petagram, detail::one_rep>{};
inline constexpr auto Eg = mass<exagram, detail::one_rep>{};
inline constexpr auto Zg = mass<zettagram, detail::one_rep>{};
inline constexpr auto Yg = mass<yottagram, detail::one_rep>{};
inline constexpr auto t = mass<tonne, detail::one_rep>{};
inline constexpr auto yt = mass<yoctotonne, detail::one_rep>{};
inline constexpr auto zt = mass<zeptotonne, detail::one_rep>{};
inline constexpr auto at = mass<attotonne, detail::one_rep>{};
inline constexpr auto ft = mass<femtotonne, detail::one_rep>{};
inline constexpr auto pt = mass<picotonne, detail::one_rep>{};
inline constexpr auto nt = mass<nanotonne, detail::one_rep>{};
inline constexpr auto ut = mass<microtonne, detail::one_rep>{};
inline constexpr auto mt = mass<millitonne, detail::one_rep>{};
inline constexpr auto ct = mass<centitonne, detail::one_rep>{};
inline constexpr auto dt = mass<decitonne, detail::one_rep>{};
inline constexpr auto dat = mass<decatonne, detail::one_rep>{};
inline constexpr auto ht = mass<hectotonne, detail::one_rep>{};
inline constexpr auto kt = mass<kilotonne, detail::one_rep>{};
inline constexpr auto Mt = mass<megatonne, detail::one_rep>{};
inline constexpr auto Gt = mass<gigatonne, detail::one_rep>{};
inline constexpr auto Tt = mass<teratonne, detail::one_rep>{};
inline constexpr auto Pt = mass<petatonne, detail::one_rep>{};
inline constexpr auto Et = mass<exatonne, detail::one_rep>{};
inline constexpr auto Zt = mass<zettatonne, detail::one_rep>{};
inline constexpr auto Yt = mass<yottatonne, detail::one_rep>{};
inline constexpr auto Da = mass<dalton, detail::one_rep>{};
inline constexpr auto g = mass<gram, one_rep>{};
inline constexpr auto yg = mass<yoctogram, one_rep>{};
inline constexpr auto zg = mass<zeptogram, one_rep>{};
inline constexpr auto ag = mass<attogram, one_rep>{};
inline constexpr auto fg = mass<femtogram, one_rep>{};
inline constexpr auto pg = mass<picogram, one_rep>{};
inline constexpr auto ng = mass<nanogram, one_rep>{};
inline constexpr auto ug = mass<microgram, one_rep>{};
inline constexpr auto mg = mass<milligram, one_rep>{};
inline constexpr auto cg = mass<centigram, one_rep>{};
inline constexpr auto dg = mass<decigram, one_rep>{};
inline constexpr auto dag = mass<decagram, one_rep>{};
inline constexpr auto hg = mass<hectogram, one_rep>{};
inline constexpr auto kg = mass<kilogram, one_rep>{};
inline constexpr auto Mg = mass<megagram, one_rep>{};
inline constexpr auto Gg = mass<gigagram, one_rep>{};
inline constexpr auto Tg = mass<teragram, one_rep>{};
inline constexpr auto Pg = mass<petagram, one_rep>{};
inline constexpr auto Eg = mass<exagram, one_rep>{};
inline constexpr auto Zg = mass<zettagram, one_rep>{};
inline constexpr auto Yg = mass<yottagram, one_rep>{};
inline constexpr auto t = mass<tonne, one_rep>{};
inline constexpr auto yt = mass<yoctotonne, one_rep>{};
inline constexpr auto zt = mass<zeptotonne, one_rep>{};
inline constexpr auto at = mass<attotonne, one_rep>{};
inline constexpr auto ft = mass<femtotonne, one_rep>{};
inline constexpr auto pt = mass<picotonne, one_rep>{};
inline constexpr auto nt = mass<nanotonne, one_rep>{};
inline constexpr auto ut = mass<microtonne, one_rep>{};
inline constexpr auto mt = mass<millitonne, one_rep>{};
inline constexpr auto ct = mass<centitonne, one_rep>{};
inline constexpr auto dt = mass<decitonne, one_rep>{};
inline constexpr auto dat = mass<decatonne, one_rep>{};
inline constexpr auto ht = mass<hectotonne, one_rep>{};
inline constexpr auto kt = mass<kilotonne, one_rep>{};
inline constexpr auto Mt = mass<megatonne, one_rep>{};
inline constexpr auto Gt = mass<gigatonne, one_rep>{};
inline constexpr auto Tt = mass<teratonne, one_rep>{};
inline constexpr auto Pt = mass<petatonne, one_rep>{};
inline constexpr auto Et = mass<exatonne, one_rep>{};
inline constexpr auto Zt = mass<zettatonne, one_rep>{};
inline constexpr auto Yt = mass<yottatonne, one_rep>{};
inline constexpr auto Da = mass<dalton, one_rep>{};

} // namespace unit_constants

Expand Down
Loading

0 comments on commit 671f891

Please sign in to comment.