From f2ed8648b56086b046b7dcc92850695e9917c8be Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Wed, 26 Jan 2022 21:14:32 -0600 Subject: [PATCH] [ox/std] Move bit.hpp static_asserts to cpp file (synced from 81f2865fcc51d4d6fe4be2bc1b1174f37c617452) --- src/ox/std/CMakeLists.txt | 1 + src/ox/std/bit.cpp | 14 ++++++++++++++ src/ox/std/bit.hpp | 5 ----- 3 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 src/ox/std/bit.cpp diff --git a/src/ox/std/CMakeLists.txt b/src/ox/std/CMakeLists.txt index 26aa613c0..ed79b4ac4 100644 --- a/src/ox/std/CMakeLists.txt +++ b/src/ox/std/CMakeLists.txt @@ -20,6 +20,7 @@ target_compile_definitions( add_library( OxStd assert.cpp + bit.cpp buffer.cpp buildinfo.cpp byteswap.cpp diff --git a/src/ox/std/bit.cpp b/src/ox/std/bit.cpp new file mode 100644 index 000000000..6f4a60a87 --- /dev/null +++ b/src/ox/std/bit.cpp @@ -0,0 +1,14 @@ +/* + * Copyright 2015 - 2022 gary@drinkingtea.net + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include "bit.hpp" + +static_assert(ox::onMask(1) == 0b0001); +static_assert(ox::onMask(2) == 0b0011); +static_assert(ox::onMask(3) == 0b0111); +static_assert(ox::onMask(4) == 0b1111); diff --git a/src/ox/std/bit.hpp b/src/ox/std/bit.hpp index 5fd3bf865..61915217b 100644 --- a/src/ox/std/bit.hpp +++ b/src/ox/std/bit.hpp @@ -55,9 +55,4 @@ template template constexpr auto MaxValue = onMask(); -static_assert(onMask(1) == 1); -static_assert(onMask(2) == 3); -static_assert(onMask(3) == 7); -static_assert(onMask(4) == 15); - }