mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-03 04:50:29 +00:00
AK: Add a Decay helper for Concepts
This commit is contained in:
parent
b7d19476f2
commit
dfe2cf3a40
Notes:
sideshowbarker
2024-07-17 22:47:09 +09:00
Author: https://github.com/Hendiadyoin1 Commit: https://github.com/SerenityOS/serenity/commit/dfe2cf3a409 Pull-request: https://github.com/SerenityOS/serenity/pull/10808 Reviewed-by: https://github.com/alimpfard Reviewed-by: https://github.com/linusg Reviewed-by: https://github.com/trflynn89 ✅
1 changed files with 16 additions and 0 deletions
|
@ -557,6 +557,22 @@ inline constexpr bool IsSpecializationOf = false;
|
|||
template<template<typename...> typename U, typename... Us>
|
||||
inline constexpr bool IsSpecializationOf<U<Us...>, U> = true;
|
||||
|
||||
template<typename T>
|
||||
struct __decay {
|
||||
typedef Detail::RemoveCVReference<T> type;
|
||||
};
|
||||
template<typename T>
|
||||
struct __decay<T[]> {
|
||||
typedef T* type;
|
||||
};
|
||||
template<typename T, decltype(sizeof(T)) N>
|
||||
struct __decay<T[N]> {
|
||||
typedef T* type;
|
||||
};
|
||||
// FIXME: Function decay
|
||||
template<typename T>
|
||||
using Decay = typename __decay<T>::type;
|
||||
|
||||
}
|
||||
using AK::Detail::AddConst;
|
||||
using AK::Detail::AddLvalueReference;
|
||||
|
|
Loading…
Reference in a new issue