mirror of
https://github.com/SerenityOS/serenity
synced 2024-07-09 12:00:49 +00:00
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.
This commit is contained in:
parent
f2ba44cbdf
commit
a595345e7c
|
@ -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.
|
// Disabling formatting for that doesn't help either.
|
||||||
//
|
//
|
||||||
// clang-format off
|
// clang-format off
|
||||||
|
#ifndef AK_DONT_REPLACE_STD
|
||||||
namespace std {
|
namespace std {
|
||||||
|
|
||||||
// NOTE: These are in the "std" namespace since some compilers and static analyzers rely on it.
|
// 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
|
// clang-format on
|
||||||
|
|
||||||
using std::forward;
|
using std::forward;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user