From 3c0d80179c0f2053fb2b892ee9af47200cb5d539 Mon Sep 17 00:00:00 2001 From: Steven Le Rouzic Date: Fri, 29 Mar 2024 00:18:28 +0100 Subject: Separate the std-lite stuff --- deimos/core/base.h | 38 +------------------------------------- 1 file changed, 1 insertion(+), 37 deletions(-) (limited to 'deimos/core/base.h') diff --git a/deimos/core/base.h b/deimos/core/base.h index 0cc48b1..5ff9090 100644 --- a/deimos/core/base.h +++ b/deimos/core/base.h @@ -73,13 +73,6 @@ struct SourceLocation {} }; -template struct RemoveReferenceT { using Type = T; }; -template struct RemoveReferenceT { using Type = T; }; -template struct RemoveReferenceT { using Type = T; }; -template using RemoveReference = RemoveReferenceT::Type; - -template constexpr bool kIsTriviallyDestructible = __is_trivially_destructible(T); - } // namespace deimos constexpr void* operator new(deimos::uint64, void* ptr) @@ -87,34 +80,5 @@ constexpr void* operator new(deimos::uint64, void* ptr) return ptr; } -namespace std -{ - -template -constexpr deimos::RemoveReference&& move(T&& t) noexcept -{ - return static_cast&&>(t); -} - -template -constexpr T&& forward(deimos::RemoveReference& t) noexcept -{ - return static_cast(t); -} - -template -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 +#include "deimos/core/std.h" -- cgit