std::experimental::pmr:: null_memory_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 | ||||
|
null_memory_resource
|
||||
| Type-erased allocator support for existing classes | ||||
|
memory_resource
*
null_memory_resource
(
)
noexcept
;
|
(库基础TS) | |
返回一个指向不执行任何分配的
memory_resource
的指针。
返回值
返回一个指向静态存储期对象的指针
p
,该对象派生自
std::experimental::pmr::memory_resource
,并具有以下特性:
-
其
allocate()函数始终抛出 std::bad_alloc ; -
其
deallocate()函数不产生任何效果; -
对于任意
memory_resource对象r,p->is_equal(r)返回&r == p。
每次调用此函数时都会返回相同的值。