[libc++] Add the __is_replaceable type trait (#132408)
That type trait represents whether move-assigning an object is equivalent to destroying it and then move-constructing a new one from the same argument. This will be useful in a few places where we may want to destroy + construct instead of doing an assignment, in particular when implementing some container operations in terms of relocation. This is effectively adding a library emulation of P2786R12's is_replaceable trait, similarly to what we do for trivial relocation. Eventually, we can replace this library emulation by the real compiler-backed trait. This is building towards #129328.
This commit is contained in:
@@ -272,6 +272,10 @@ module std_core [system] {
|
||||
header "__type_traits/is_referenceable.h"
|
||||
export std_core.type_traits.integral_constant
|
||||
}
|
||||
module is_replaceable {
|
||||
header "__type_traits/is_replaceable.h"
|
||||
export std_core.type_traits.integral_constant
|
||||
}
|
||||
module is_same {
|
||||
header "__type_traits/is_same.h"
|
||||
export std_core.type_traits.integral_constant
|
||||
|
||||
Reference in New Issue
Block a user