summaryrefslogtreecommitdiff
path: root/AK/StdLibExtras.h
diff options
context:
space:
mode:
authorStephan Unverwerth <s.unverwerth@serenityos.org>2021-09-04 14:20:27 +0200
committerAndreas Kling <kling@serenityos.org>2021-09-04 16:32:54 +0200
commita595345e7c1db3b9e05ca165f06f815adc69a703 (patch)
treea8c4bbb911d289dd85e520de6cf2377b02c0a562 /AK/StdLibExtras.h
parentf2ba44cbdf76939672c5ff7f88e35ab05f20ae44 (diff)
downloadserenity-a595345e7c1db3b9e05ca165f06f815adc69a703.zip
AK: Make declaration of std::move and std::forward optional
This introduces a new define AK_DONT_REPLACE_STD that disables our own implementation of std::move and std::forward. Some ports include both STL and AK headers which causes conflicts when trying to resolve those functions. The port can define AK_DONT_REPLACE_STD before including Serenity headers in that case.
Diffstat (limited to 'AK/StdLibExtras.h')
-rw-r--r--AK/StdLibExtras.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/AK/StdLibExtras.h b/AK/StdLibExtras.h
index 2479f2b410..9413e77346 100644
--- a/AK/StdLibExtras.h
+++ b/AK/StdLibExtras.h
@@ -20,6 +20,7 @@ constexpr auto round_up_to_power_of_two(T value, U power_of_two) requires(IsInte
// Disabling formatting for that doesn't help either.
//
// clang-format off
+#ifndef AK_DONT_REPLACE_STD
namespace std {
// NOTE: These are in the "std" namespace since some compilers and static analyzers rely on it.
@@ -44,6 +45,7 @@ constexpr T&& move(T& arg)
}
}
+#endif
// clang-format on
using std::forward;