diff --git a/example/box_example.cpp b/example/box_example.cpp index 52779218..9ff5a40d 100644 --- a/example/box_example.cpp +++ b/example/box_example.cpp @@ -21,7 +21,6 @@ // SOFTWARE. #include -#include #include #include #include diff --git a/src/core/include/units/generic/dimensionless.h b/src/core/include/units/generic/dimensionless.h deleted file mode 100644 index da6dc0ae..00000000 --- a/src/core/include/units/generic/dimensionless.h +++ /dev/null @@ -1,38 +0,0 @@ -// The MIT License (MIT) -// -// Copyright (c) 2018 Mateusz Pusz -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -#pragma once - -#include -#include - -namespace units { - -struct dimensionless; // defined in -struct one; // defined in - -// clang-format off -inline constexpr struct percent : named_unit<"%", mag * one> {} percent; -inline constexpr struct per_mille : named_unit * one> {} per_mille; -// clang-format on - -} // namespace units diff --git a/src/core/include/units/unit.h b/src/core/include/units/unit.h index 89f279ba..f3d83ab3 100644 --- a/src/core/include/units/unit.h +++ b/src/core/include/units/unit.h @@ -398,8 +398,9 @@ struct derived_unit : detail::expr_fractions, Us...> {}; * * Unit of a dimensionless quantity. */ -inline constexpr struct one : derived_unit<> { -} one; +// clang-format off +inline constexpr struct one : derived_unit<> {} one; +// clang-format on namespace detail { @@ -721,6 +722,12 @@ inline constexpr decltype(U * U) square; template inline constexpr decltype(U * U * U) cubic; +// common dimensionless units +// clang-format off +inline constexpr struct percent : named_unit<"%", mag * one> {} percent; +inline constexpr struct per_mille : named_unit * one> {} per_mille; +// clang-format on + // get_unit_symbol diff --git a/test/unit_test/runtime/fmt_test.cpp b/test/unit_test/runtime/fmt_test.cpp index e5efee04..d6ffa4bd 100644 --- a/test/unit_test/runtime/fmt_test.cpp +++ b/test/unit_test/runtime/fmt_test.cpp @@ -24,7 +24,6 @@ #include #include #include -#include #include #include #include diff --git a/test/unit_test/static/si_test.cpp b/test/unit_test/static/si_test.cpp index b10b987b..38b512b5 100644 --- a/test/unit_test/static/si_test.cpp +++ b/test/unit_test/static/si_test.cpp @@ -22,7 +22,6 @@ #include #include -#include #include namespace { diff --git a/test/unit_test/static/unit_test.cpp b/test/unit_test/static/unit_test.cpp index a69cb765..f5bc7b9e 100644 --- a/test/unit_test/static/unit_test.cpp +++ b/test/unit_test/static/unit_test.cpp @@ -22,7 +22,6 @@ #include "test_tools.h" #include -#include #include #include #include