From e1229e05aba7554363b2aa9874bd383b5923ee8b Mon Sep 17 00:00:00 2001 From: Steven Le Rouzic Date: Mon, 25 Mar 2024 23:28:26 +0100 Subject: Basic console API & API registry implementation --- deimos/core/base.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'deimos/core/base.h') diff --git a/deimos/core/base.h b/deimos/core/base.h index ea14610..0669f07 100644 --- a/deimos/core/base.h +++ b/deimos/core/base.h @@ -46,6 +46,8 @@ struct uint128 { uint64 high; uint64 low; + + constexpr bool operator==(const uint128& other) const = default; }; struct SourceLocation @@ -96,5 +98,13 @@ constexpr T&& forward(deimos::RemoveReference&& t) noexcept // NOLINT return static_cast(t); } +template +constexpr T exchange(T& obj, U&& new_value) +{ + T old_value = std::move(obj); + obj = std::forward(new_value); + return old_value; +} + } // namespace std -- cgit