std::experimental::pmr:: new_delete_resource
From cppreference.net
<
cpp
|
experimental
C++
Experimental
| Technical Specification | ||||
| Filesystem library (filesystem TS) | ||||
| Library fundamentals (library fundamentals TS) | ||||
| Library fundamentals 2 (library fundamentals TS v2) | ||||
| Library fundamentals 3 (library fundamentals TS v3) | ||||
| Extensions for parallelism (parallelism TS) | ||||
| Extensions for parallelism 2 (parallelism TS v2) | ||||
| Extensions for concurrency (concurrency TS) | ||||
| Extensions for concurrency 2 (concurrency TS v2) | ||||
| Concepts (concepts TS) | ||||
| Ranges (ranges TS) | ||||
| Reflection (reflection TS) | ||||
| Mathematical special functions (special functions TR) | ||||
| Experimental Non-TS | ||||
| Pattern Matching | ||||
| Linear Algebra | ||||
| std::execution | ||||
| Contracts | ||||
| 2D Graphics |
Polymorphic allocator library
Convenience aliases for containers using
polymorphic_allocator
|
||||
| Memory resource classes | ||||
| Global memory resources | ||||
|
new_delete_resource
|
||||
| Type-erased allocator support for existing classes | ||||
|
memory_resource
*
new_delete_resource
(
)
noexcept
;
|
(库基础技术规范) | |
返回指向使用全局
operator new
和
operator delete
分配内存的
memory_resource
指针。
返回值
返回一个指向静态存储期对象的指针
p
,该对象派生自
std::experimental::pmr::memory_resource
,并具有以下特性:
-
其
allocate()函数使用::operator new分配内存; -
其
deallocate()函数使用::operator delete释放内存; -
对于任意
memory_resourcer,p->is_equal(r)返回&r == p。
每次调用此函数时都会返回相同的值。