diff options
author | Shauren <shauren.trinity@gmail.com> | 2024-12-16 11:56:03 +0100 |
---|---|---|
committer | Ovahlord <dreadkiller@gmx.de> | 2024-12-16 16:43:42 +0100 |
commit | 4220ec8eeec571ec4f384a1a6dc87532d920429c (patch) | |
tree | c5a5669b3fb056855631034fb1930ad4d1cec491 /src/common | |
parent | 445b4ed1158a5f2feabbc2976f04b04a8233facb (diff) |
Core/Misc: Fixed build with c++23 enabled
Closes #30511
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/Utilities/advstd.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/common/Utilities/advstd.h b/src/common/Utilities/advstd.h index 42acf5653ed..47261837272 100644 --- a/src/common/Utilities/advstd.h +++ b/src/common/Utilities/advstd.h @@ -53,13 +53,13 @@ template <typename To, typename From, } // std::ranges::contains -#ifndef __cpp_lib_ranges_contains -#include <algorithm> // for std::ranges::find -#include <functional> // for std::ranges::equal_to, std::identity -#include <iterator> // for std::input_iterator, std::sentinel_for, std::projected +#include <algorithm> namespace advstd::ranges { +#ifndef __cpp_lib_ranges_contains +#include <functional> // for std::ranges::equal_to, std::identity +#include <iterator> // for std::input_iterator, std::sentinel_for, std::projected struct Contains { template<std::input_iterator I, std::sentinel_for<I> S, class T, class Proj = std::identity> @@ -78,7 +78,9 @@ struct Contains return std::ranges::find(std::move(first), last, value, proj) != last; } } inline constexpr contains; -} +#else +using std::ranges::contains; #endif +} #endif |