Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

<memory>

 

For the latest documentation on Visual Studio 2017 RC, see Visual Studio 2017 RC Documentation.

Defines a class, an operator, and several templates that help allocate and free objects.

#include <memory>  
  

Functions

addressofGets the true address of an object.
alignReturns a pointer to a range of a given size, based on the provided alignment and starting address.
allocate_sharedCreates a shared_ptr to objects that are allocated and constructed for a given type with a specified allocator.
checked_uninitialized_copySame as uninitialized_copy but enforces the use of a checked iterator as output iterator.
checked_uninitialized_fill_nSame as uninitialized_fill_n but enforces the use of a checked iterator as output iterator.
const_pointer_castConst cast to shared_ptr.
declare_no_pointersInforms a garbage collector that the characters starting at a specified address and falling within the indicated block size contain no traceable pointers.
declare_reachableInforms garbage collection that the indicated address is to allocated storage and is reachable.
default_deleteDeletes objects allocated with operator new. Suitable for use with unique_ptr.
dynamic_pointer_castDynamic cast to shared_ptr.
get_deleterGet deleter from shared_ptr.
get_pointer_safetyReturns the type of pointer safety assumed by any garbage collector.
get_temporary_bufferAllocates temporary storage for a sequence of elements that does not exceed a specified number of elements.
make_sharedCreates and returns a shared_ptr that points to the allocated object constructed from zero or more arguments using the default allocator.
make_uniqueCreates and returns a unique_ptr that points to the allocated object constructed from zero or more arguments.
owner_lessAllows ownership-based mixed comparisons of shared and weak pointers.
pointer_safetyAn enumeration of all the possible return values for get_pointer_safety.
return_temporary_bufferDeallocates the temporary memory that was allocated using the get_temporary_buffer template function.
static_pointer_castStatic cast to shared_ptr.
swapSwap two shared_ptr or weak_ptr objects.
unchecked_uninitialized_copySame as uninitialized_copy but allows the use of an unchecked iterator as output iterator when _SECURE_SCL=1 is defined.
unchecked_uninitialized_fill_nSame as uninitialized_fill_n but allows the use of an unchecked iterator as output iterator when _SECURE_SCL=1 is defined.
undeclare_no_pointersInforms a garbage collector that the characters in the memory block defined by a base address pointer and block size may now contain traceable pointers.
undeclare_reachableInforms a garbage_collector that a specified memory location is not reachable.
uninitialized_copyCopies objects from a specified input range into an uninitialized destination range.
uninitialized_copy_nCreates a copy of a specified number of elements from an input iterator. The copies are put in a forward iterator.
uninitialized_fillCopies objects of a specified value into an uninitialized destination range.
uninitialized_fill_nCopies objects of a specified value into specified number of elements an uninitialized destination range.

Operators

operator!=Tests for inequality between allocator objects of a specified class.
operator==Tests for equality between allocator objects of a specified class.
operator>=Tests for one allocator object being greater than or equal to a second allocator object, of a specified class.
operator<Tests for one object being less than a second object of a specified class.
operator<=Tests for one object being less than or equal to a second object of a specified class.
operator>Tests for one object being greater than a second object of a specified class.
operator<<shared_ptr inserter.

Classes

allocatorThe template class describes an object that manages storage allocation and freeing for arrays of objects of type Type.
allocator_traitsDescribes an object that determines all the information that is needed by an allocator-enabled container.
auto_ptrThe template class describes an object that stores a pointer to an allocated object of type Type * that ensures the object to which it points gets deleted when its enclosing auto_ptr gets destroyed.
bad_weak_ptrReports bad weak_ptr exception.
enabled_shared_from_thisHelps generate a shared_ptr.
pointer_traitsSupplies information that is needed by an object of template class allocator_traits to describe an allocator with pointer type Ptr.
raw_storage_iteratorAn adaptor class that is provided to enable algorithms to store their results into uninitialized memory.
shared_ptrWraps a reference-counted smart pointer around a dynamically allocated object.
unique_ptrStores a pointer to an owned object. The pointer is owned by no other unique_ptr. The unique_ptr is destroyed when the owner is destroyed.
weak_ptrWraps a weakly linked pointer.

Specializations

allocator<void>A specialization of the template class allocator to type void, defining the only the member types that make sense in this specialized context.

Header Files Reference
Thread Safety in the C++ Standard Library

Show:
© 2017 Microsoft