From cfdf380c05e1e6be92719a72b8b50e5a035de872 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Fri, 3 May 2024 18:43:35 -0400 Subject: [PATCH] xo-unit: move wdith2x helper template to own .hpp file --- include/xo/unit/scaled_unit.hpp | 23 +------------------ include/xo/unit/width2x.hpp | 39 +++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 22 deletions(-) create mode 100644 include/xo/unit/width2x.hpp diff --git a/include/xo/unit/scaled_unit.hpp b/include/xo/unit/scaled_unit.hpp index dce63a90..de1e724f 100644 --- a/include/xo/unit/scaled_unit.hpp +++ b/include/xo/unit/scaled_unit.hpp @@ -5,7 +5,7 @@ #pragma once -#include "natural_unit.hpp" +#include "width2x.hpp" namespace xo { namespace qty { @@ -55,27 +55,6 @@ namespace xo { } namespace detail { - template - struct width2x; - - template <> - struct width2x { - using type = std::int32_t; - }; - - template <> - struct width2x { - using type = std::int64_t; - }; - - template <> - struct width2x { - using type = __int128_t; - }; - - template - using width2x_t = width2x::type; - template , typename OuterScale = ratio::ratio> diff --git a/include/xo/unit/width2x.hpp b/include/xo/unit/width2x.hpp new file mode 100644 index 00000000..6047486c --- /dev/null +++ b/include/xo/unit/width2x.hpp @@ -0,0 +1,39 @@ +/** @file width2x.hpp + * + * Author: Roland Conybeare + **/ + +#pragma once + +#include "natural_unit.hpp" +#include + +namespace xo { + namespace qty { + namespace detail { + template + struct width2x; + + template <> + struct width2x { + using type = std::int32_t; + }; + + template <> + struct width2x { + using type = std::int64_t; + }; + + template <> + struct width2x { + using type = __int128_t; + }; + + template + using width2x_t = width2x::type; + } + + } /*namespace qty*/ +} /*namespace xo*/ + +/** end width2x.hpp **/