aboutsummaryrefslogtreecommitdiff
path: root/libs/kstd
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@ost.ch>2026-08-29 10:55:53 +0200
committerFelix Morgner <felix.morgner@ost.ch>2026-08-29 10:55:53 +0200
commite900e7888197a4b0aa3b97f5d158a4378e17b958 (patch)
tree009732dd1323ceb54840ccd997b515aef3e4fa4d /libs/kstd
parent0824a76b4f7294a74f4728084ca13070a4c8e7da (diff)
downloadkernel-e900e7888197a4b0aa3b97f5d158a4378e17b958.tar.xz
kernel-e900e7888197a4b0aa3b97f5d158a4378e17b958.zip
kstd: make UDL operators constevalHEADdevelop
Diffstat (limited to 'libs/kstd')
-rw-r--r--libs/kstd/kstd/units.hpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/libs/kstd/kstd/units.hpp b/libs/kstd/kstd/units.hpp
index 1a4826db..8f7fa532 100644
--- a/libs/kstd/kstd/units.hpp
+++ b/libs/kstd/kstd/units.hpp
@@ -64,42 +64,42 @@ namespace kstd
{
inline namespace units_literals
{
- constexpr auto operator""_B(unsigned long long value) noexcept -> bytes
+ consteval auto operator""_B(unsigned long long value) noexcept -> bytes
{
return bytes{value};
}
- constexpr auto operator""_KiB(unsigned long long value) noexcept -> bytes
+ consteval auto operator""_KiB(unsigned long long value) noexcept -> bytes
{
return KiB(value);
}
- constexpr auto operator""_MiB(unsigned long long value) noexcept -> bytes
+ consteval auto operator""_MiB(unsigned long long value) noexcept -> bytes
{
return MiB(value);
}
- constexpr auto operator""_GiB(unsigned long long value) noexcept -> bytes
+ consteval auto operator""_GiB(unsigned long long value) noexcept -> bytes
{
return GiB(value);
}
- constexpr auto operator""_B_off(unsigned long long value) noexcept -> offset
+ consteval auto operator""_B_off(unsigned long long value) noexcept -> offset
{
return offset{static_cast<offset::value_type>(value)};
}
- constexpr auto operator""_KiB_off(unsigned long long value) noexcept -> offset
+ consteval auto operator""_KiB_off(unsigned long long value) noexcept -> offset
{
return offset{static_cast<offset::value_type>(value * 1024)};
}
- constexpr auto operator""_MiB_off(unsigned long long value) noexcept -> offset
+ consteval auto operator""_MiB_off(unsigned long long value) noexcept -> offset
{
return offset{static_cast<offset::value_type>(value * 1024 * 1024)};
}
- constexpr auto operator""_GiB_off(unsigned long long value) noexcept -> offset
+ consteval auto operator""_GiB_off(unsigned long long value) noexcept -> offset
{
return offset{static_cast<offset::value_type>(value * 1024 * 1024 * 1024)};
}