xo-unit: refactor: native_unit2 -> native_unit + consistent .hpp
This commit is contained in:
parent
c9ec702915
commit
1142d7e68a
3 changed files with 11 additions and 11 deletions
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "dim_util2.hpp"
|
||||
#include "native_unit.hpp"
|
||||
#include "xo/ratio/ratio.hpp"
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
|
|
|
|||
|
|
@ -19,9 +19,9 @@ namespace xo {
|
|||
* A basis_unit2 is expressed as a multiple of a native_unit2
|
||||
*
|
||||
**/
|
||||
struct native_unit2 {
|
||||
struct native_unit {
|
||||
public:
|
||||
constexpr native_unit2(dim native_dim,
|
||||
constexpr native_unit(dim native_dim,
|
||||
const native_unit2_abbrev_type & abbrev_str)
|
||||
: native_dim_{native_dim},
|
||||
abbrev_str_{abbrev_str}
|
||||
|
|
@ -35,12 +35,12 @@ namespace xo {
|
|||
native_unit2_abbrev_type abbrev_str_;
|
||||
};
|
||||
|
||||
static constexpr native_unit2 native_unit2_v[n_dim] = {
|
||||
native_unit2(dim::mass, native_unit2_abbrev_type::from_chars("g")),
|
||||
native_unit2(dim::distance, native_unit2_abbrev_type::from_chars("m")),
|
||||
native_unit2(dim::time, native_unit2_abbrev_type::from_chars("s")),
|
||||
native_unit2(dim::currency, native_unit2_abbrev_type::from_chars("ccy")),
|
||||
native_unit2(dim::price, native_unit2_abbrev_type::from_chars("px")),
|
||||
static constexpr native_unit native_unit2_v[n_dim] = {
|
||||
native_unit(dim::mass, native_unit2_abbrev_type::from_chars("g")),
|
||||
native_unit(dim::distance, native_unit2_abbrev_type::from_chars("m")),
|
||||
native_unit(dim::time, native_unit2_abbrev_type::from_chars("s")),
|
||||
native_unit(dim::currency, native_unit2_abbrev_type::from_chars("ccy")),
|
||||
native_unit(dim::price, native_unit2_abbrev_type::from_chars("px")),
|
||||
};
|
||||
|
||||
} /*namespace qty*/
|
||||
|
|
@ -10,7 +10,7 @@
|
|||
#include "xo/unit/bpu2.hpp"
|
||||
#include "xo/unit/bpu2_iostream.hpp"
|
||||
#include "xo/unit/basis_unit2.hpp"
|
||||
#include "xo/unit/dim_util2.hpp"
|
||||
#include "xo/unit/native_unit.hpp"
|
||||
#include "xo/reflect/Reflect.hpp"
|
||||
//#include "xo/cxxutil/demangle.hpp"
|
||||
#include "xo/indentlog/scope.hpp"
|
||||
|
|
@ -28,7 +28,7 @@ namespace xo {
|
|||
using xo::qty::Quantity2;
|
||||
using xo::qty::dim;
|
||||
using xo::qty::basis_unit2_abbrev_type;
|
||||
using xo::qty::native_unit2;
|
||||
using xo::qty::native_unit;
|
||||
using xo::qty::native_unit2_v;
|
||||
using xo::qty::scalefactor_ratio_type;
|
||||
using xo::qty::units::scaled_native_unit2_abbrev;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue