diff --git a/deps/ox/src/ox/std/CMakeLists.txt b/deps/ox/src/ox/std/CMakeLists.txt index e062f434..c4546fd0 100644 --- a/deps/ox/src/ox/std/CMakeLists.txt +++ b/deps/ox/src/ox/std/CMakeLists.txt @@ -26,6 +26,7 @@ add_library( byteswap.cpp fmt.cpp heapmgr.cpp + math.cpp memops.cpp random.cpp substitutes.cpp diff --git a/deps/ox/src/ox/std/math.cpp b/deps/ox/src/ox/std/math.cpp new file mode 100644 index 00000000..ca4d2bbb --- /dev/null +++ b/deps/ox/src/ox/std/math.cpp @@ -0,0 +1,23 @@ +/* + * 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 "math.hpp" + +namespace ox { + +static_assert(min(2, 1) == 1); +static_assert(min(1, 2) == 1); + +static_assert(max(2, 1) == 2); +static_assert(max(1, 2) == 2); + +static_assert(clamp(2, 1, 3) == 2); +static_assert(clamp(1, 2, 3) == 2); +static_assert(clamp(3, 1, 2) == 2); + +}