From 81f2865fcc51d4d6fe4be2bc1b1174f37c617452 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 --- deps/ox/src/ox/std/CMakeLists.txt | 1 + deps/ox/src/ox/std/bit.cpp | 14 ++++++++++++++ deps/ox/src/ox/std/bit.hpp | 5 ----- 3 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 deps/ox/src/ox/std/bit.cpp diff --git a/deps/ox/src/ox/std/CMakeLists.txt b/deps/ox/src/ox/std/CMakeLists.txt index 26aa613c..ed79b4ac 100644 --- a/deps/ox/src/ox/std/CMakeLists.txt +++ b/deps/ox/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/deps/ox/src/ox/std/bit.cpp b/deps/ox/src/ox/std/bit.cpp new file mode 100644 index 00000000..6f4a60a8 --- /dev/null +++ b/deps/ox/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/deps/ox/src/ox/std/bit.hpp b/deps/ox/src/ox/std/bit.hpp index 5fd3bf86..61915217 100644 --- a/deps/ox/src/ox/std/bit.hpp +++ b/deps/ox/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); - }