From 43e2e2155b6a8f662c741185ab0e5aaf1d0ce077 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Mon, 29 Apr 2024 22:48:22 -0500 Subject: [PATCH] [ox/std] Cleanup --- deps/ox/src/ox/std/math.hpp | 6 +++--- deps/ox/src/ox/std/stringliteral.hpp | 5 ++--- deps/ox/src/ox/std/utility.hpp | 4 ++-- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/deps/ox/src/ox/std/math.hpp b/deps/ox/src/ox/std/math.hpp index 4c532ca9..18319a4f 100644 --- a/deps/ox/src/ox/std/math.hpp +++ b/deps/ox/src/ox/std/math.hpp @@ -48,11 +48,11 @@ constexpr const T &clamp(const T &v, const T &lo, const T &hi) noexcept requires return min(ox::max(v, lo), hi); } -template +template [[nodiscard]] -constexpr I pow(I v, int e) noexcept { +constexpr I pow(I v, E e) noexcept { I out = 1; - for (I i = 0; i < e; i++) { + for (E i = 0; i < e; ++i) { out *= v; } return out; diff --git a/deps/ox/src/ox/std/stringliteral.hpp b/deps/ox/src/ox/std/stringliteral.hpp index e6ddc4c2..0eafc76d 100644 --- a/deps/ox/src/ox/std/stringliteral.hpp +++ b/deps/ox/src/ox/std/stringliteral.hpp @@ -32,10 +32,9 @@ class StringLiteral: public detail::BaseStringView { constexpr explicit StringLiteral(const char *str, std::size_t len) noexcept: BaseStringView(str, len) {} - constexpr explicit StringLiteral(char const *str) noexcept: StringLiteral(str, ox::strlen(str)) { - } + constexpr explicit StringLiteral(char const *str) noexcept: StringLiteral(str, ox::strlen(str)) {} - constexpr auto &operator=(StringLiteral const&other) noexcept { + constexpr StringLiteral &operator=(StringLiteral const&other) noexcept { if (&other != this) { set(other.data(), other.len()); } diff --git a/deps/ox/src/ox/std/utility.hpp b/deps/ox/src/ox/std/utility.hpp index 5a69405a..70e60d97 100644 --- a/deps/ox/src/ox/std/utility.hpp +++ b/deps/ox/src/ox/std/utility.hpp @@ -16,8 +16,8 @@ namespace std { template -constexpr typename ox::remove_reference::type &&move(T &&t) noexcept { - return static_cast::type&&>(t); +constexpr ox::remove_reference_t &&move(T &&t) noexcept { + return static_cast&&>(t); } template