mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-25 17:25:08 +02:00
AK: Loosen the restrictions on non-copyable/non-movable containers
If a type is non-move constructible but move assignable, its container type may still be move assignable. Similairly, if a type is non-copy constructible but copy assignable, its container type may still be copy assignable.
This commit is contained in:
committed by
Andrew Kaster
parent
eff9d4881c
commit
50bc6fb9d9
Notes:
github-actions[bot]
2025-04-23 03:20:44 +00:00
Author: https://github.com/yyny Commit: https://github.com/LadybirdBrowser/ladybird/commit/50bc6fb9d93 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4310 Reviewed-by: https://github.com/ADKaster ✅ Reviewed-by: https://github.com/DanShaders Reviewed-by: https://github.com/Hendiadyoin1 Reviewed-by: https://github.com/alimpfard ✅
@@ -26,14 +26,14 @@ public: \
|
||||
c(c const&) = default; \
|
||||
c& operator=(c const&) = default
|
||||
|
||||
#define AK_MAKE_CONDITIONALLY_NONMOVABLE(c, ...) \
|
||||
public: \
|
||||
c(c&&) \
|
||||
requires(!(AK::Detail::IsMoveConstructible __VA_ARGS__)) \
|
||||
= delete; \
|
||||
c& operator=(c&&) \
|
||||
requires(!(AK::Detail::IsMoveConstructible __VA_ARGS__) \
|
||||
|| !(AK::Detail::IsDestructible __VA_ARGS__)) \
|
||||
#define AK_MAKE_CONDITIONALLY_NONMOVABLE(c, ...) \
|
||||
public: \
|
||||
c(c&&) \
|
||||
requires(!(AK::Detail::IsMoveConstructible __VA_ARGS__)) \
|
||||
= delete; \
|
||||
c& operator=(c&&) \
|
||||
requires(!((AK::Detail::IsMoveConstructible __VA_ARGS__) || (AK::Detail::IsMoveAssignable __VA_ARGS__)) \
|
||||
|| !(AK::Detail::IsDestructible __VA_ARGS__)) \
|
||||
= delete
|
||||
|
||||
#define AK_MAKE_CONDITIONALLY_MOVABLE(c, T) \
|
||||
@@ -41,14 +41,14 @@ public: \
|
||||
c(c&&) = default; \
|
||||
c& operator=(c&&) = default
|
||||
|
||||
#define AK_MAKE_CONDITIONALLY_NONCOPYABLE(c, ...) \
|
||||
public: \
|
||||
c(c const&) \
|
||||
requires(!(AK::Detail::IsCopyConstructible __VA_ARGS__)) \
|
||||
= delete; \
|
||||
c& operator=(c const&) \
|
||||
requires(!(AK::Detail::IsCopyConstructible __VA_ARGS__) \
|
||||
|| !(AK::Detail::IsDestructible __VA_ARGS__)) \
|
||||
#define AK_MAKE_CONDITIONALLY_NONCOPYABLE(c, ...) \
|
||||
public: \
|
||||
c(c const&) \
|
||||
requires(!(AK::Detail::IsCopyConstructible __VA_ARGS__)) \
|
||||
= delete; \
|
||||
c& operator=(c const&) \
|
||||
requires(!((AK::Detail::IsCopyConstructible __VA_ARGS__) || (AK::Detail::IsCopyAssignable __VA_ARGS__)) \
|
||||
|| !(AK::Detail::IsDestructible __VA_ARGS__)) \
|
||||
= delete
|
||||
|
||||
#define AK_MAKE_CONDITIONALLY_COPYABLE(c, ...) \
|
||||
|
||||
Reference in New Issue
Block a user