mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +00:00
AK: Replace 'consteval' with 'constexpr' in some Variant helpers
CLion and/or clangd didn't like the consteval and highlighted visit() as an error, just replace it with constexpr as it makes no difference here.
This commit is contained in:
parent
04d68117c2
commit
9cf1c382df
Notes:
sideshowbarker
2024-07-17 19:44:11 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/9cf1c382dfe Pull-request: https://github.com/SerenityOS/serenity/pull/12235 Reviewed-by: https://github.com/awesomekling Reviewed-by: https://github.com/sin-ack ✅
1 changed files with 2 additions and 2 deletions
|
@ -81,7 +81,7 @@ struct Variant<IndexType, InitialIndex> {
|
|||
template<typename IndexType, typename... Ts>
|
||||
struct VisitImpl {
|
||||
template<typename RT, typename T, size_t I, typename Fn>
|
||||
static consteval bool has_explicitly_named_overload()
|
||||
static constexpr bool has_explicitly_named_overload()
|
||||
{
|
||||
// If we're not allowed to make a member function pointer and call it directly (without explicitly resolving it),
|
||||
// we have a templated function on our hands (or a function overload set).
|
||||
|
@ -90,7 +90,7 @@ struct VisitImpl {
|
|||
}
|
||||
|
||||
template<typename ReturnType, typename T, typename Visitor, auto... Is>
|
||||
static consteval bool should_invoke_const_overload(IndexSequence<Is...>)
|
||||
static constexpr bool should_invoke_const_overload(IndexSequence<Is...>)
|
||||
{
|
||||
// Scan over all the different visitor functions, if none of them are suitable for calling with `T const&`, avoid calling that first.
|
||||
return ((has_explicitly_named_overload<ReturnType, T, Is, typename Visitor::Types::template Type<Is>>()) || ...);
|
||||
|
|
Loading…
Reference in a new issue