================
@@ -0,0 +1,155 @@
+=========================
+C++ Type Aware Allocators
+=========================
+
+.. contents::
+   :local:
+
+Introduction
+============
+
+Clang includes an implementation of P2719 "Type-aware allocation and 
deallocation
+functions".
+
+This is a feature that extends the semantics of `new`, `new[]`, `delete` and
+`delete[]` operators to expose the type being allocated to the operator. This
+can be used to customize allocation of types without needing to modify the
+type declaration, or via template definitions fully generic type aware
+allocators.
+
+P2719 introduces a type-identity tag as valid parameter type for all allocation
+operators. This tag is a default initialized value of type 
`std::type_identity<T>`
+where T is the type being allocated or deallocated.  Unlike the other placement
+arguments this tag is passed as the first parameter to the operator.
+
+The most basic use case is as follows
+
+.. code-block:: c++
+
+  #include <new>
+  #include <type_identity>
----------------
zwuis wrote:

`<type_traits>`

https://github.com/llvm/llvm-project/pull/148576
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to