diff options
author | Shauren <shauren.trinity@gmail.com> | 2024-12-16 11:56:03 +0100 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2024-12-16 11:56:03 +0100 |
commit | ed666e4e8c8026f8997fc8a0bfff2ee83f39a0d8 (patch) | |
tree | 8190b7187ddb5bf669a7adba1be0903e70046c51 /src/common | |
parent | bb583baef686ef3ce76e61852ae8aa1b211a1e2c (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 |