From dd9f1b20cb7e1a3889256c9473af3c79700bf7a2 Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Tue, 9 Apr 2019 17:22:15 +0200 Subject: [PATCH] literals namespace made inline --- src/include/units/si/frequency.h | 4 +--- src/include/units/si/length.h | 2 +- src/include/units/si/time.h | 4 +--- src/include/units/si/velocity.h | 4 +--- test/test_quantity.cpp | 2 -- test/test_units.cpp | 2 +- 6 files changed, 5 insertions(+), 13 deletions(-) diff --git a/src/include/units/si/frequency.h b/src/include/units/si/frequency.h index d54f0ac8..319a0a05 100644 --- a/src/include/units/si/frequency.h +++ b/src/include/units/si/frequency.h @@ -54,9 +54,7 @@ namespace units { template concept bool Frequency = Quantity && std::experimental::ranges::Same; - // ... - - namespace literals { + inline namespace literals { // mHz constexpr auto operator""_mHz(unsigned long long l) { return frequency(l); } diff --git a/src/include/units/si/length.h b/src/include/units/si/length.h index 9381110f..48766f21 100644 --- a/src/include/units/si/length.h +++ b/src/include/units/si/length.h @@ -64,7 +64,7 @@ namespace units { template concept bool Length = Quantity && std::experimental::ranges::Same; - namespace literals { + inline namespace literals { // mm constexpr auto operator""_mm(unsigned long long l) { return length(l); } diff --git a/src/include/units/si/time.h b/src/include/units/si/time.h index 3d412cd6..02e65bac 100644 --- a/src/include/units/si/time.h +++ b/src/include/units/si/time.h @@ -55,9 +55,7 @@ namespace units { template concept bool Time = Quantity && std::experimental::ranges::Same; - // ... - - namespace literals { + inline namespace literals { // ns constexpr auto operator""_ns(unsigned long long l) { return time(l); } diff --git a/src/include/units/si/velocity.h b/src/include/units/si/velocity.h index 8233bc8e..379bfcc2 100644 --- a/src/include/units/si/velocity.h +++ b/src/include/units/si/velocity.h @@ -46,9 +46,7 @@ namespace units { template concept bool Velocity = Quantity && std::experimental::ranges::Same; - // ... - - namespace literals { + inline namespace literals { // mps constexpr auto operator""_mps(unsigned long long l) { return velocity(l); } diff --git a/test/test_quantity.cpp b/test/test_quantity.cpp index 00aebc3a..9bb00ed9 100644 --- a/test/test_quantity.cpp +++ b/test/test_quantity.cpp @@ -26,7 +26,6 @@ #include using namespace units; -using namespace units::literals; namespace { @@ -76,7 +75,6 @@ namespace std { namespace { using namespace units; - using namespace units::literals; // class invariants diff --git a/test/test_units.cpp b/test/test_units.cpp index 5f089570..9900a73f 100644 --- a/test/test_units.cpp +++ b/test/test_units.cpp @@ -27,8 +27,8 @@ #include namespace { + using namespace units; - using namespace units::literals; // frequency