[ox/std] Cleanup

This commit is contained in:
Gary Talent 2024-04-29 22:48:22 -05:00
parent be1f90955b
commit 43e2e2155b
3 changed files with 7 additions and 8 deletions

View File

@ -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); return min(ox::max(v, lo), hi);
} }
template<typename I> template<typename I, typename E>
[[nodiscard]] [[nodiscard]]
constexpr I pow(I v, int e) noexcept { constexpr I pow(I v, E e) noexcept {
I out = 1; I out = 1;
for (I i = 0; i < e; i++) { for (E i = 0; i < e; ++i) {
out *= v; out *= v;
} }
return out; return out;

View File

@ -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(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) { if (&other != this) {
set(other.data(), other.len()); set(other.data(), other.len());
} }

View File

@ -16,8 +16,8 @@
namespace std { namespace std {
template<typename T> template<typename T>
constexpr typename ox::remove_reference<T>::type &&move(T &&t) noexcept { constexpr ox::remove_reference_t<T> &&move(T &&t) noexcept {
return static_cast<typename ox::remove_reference<T>::type&&>(t); return static_cast<ox::remove_reference_t<T>&&>(t);
} }
template<typename T> template<typename T>