allocate_shared_for_overwrite overloads

Synopses

Declared in <bslstl_sharedptr.h>

Return a shared_ptr object referring to and managing a new ARRAY_TYPE object, where ARRAY_TYPE is a bounded array. The specified basicAllocator will be used to supply a single contiguous region of memory holding the returned shared pointer's internal representation and the new ARRAY_TYPE object, and the array is default‐constructed.

template<
    class ARRAY_TYPE,
    class ALLOC>
bsl::shared_ptr<ARRAY_TYPE>
allocate_shared_for_overwrite(ALLOC basicAllocator)
requires is_bounded_array<ARRAY_TYPE>::value &&
                                                     !is_pointer<ALLOC>::value;

Return a shared_ptr object referring to and managing a new ELEMENT_TYPE object. The specified basicAllocator will be used to supply a single contiguous region of memory holding the returned shared pointer's internal representation and the new ELEMENT_TYPE object, which is default‐constructed.

template<
    class ELEMENT_TYPE,
    class ALLOC>
bsl::shared_ptr<ELEMENT_TYPE>
allocate_shared_for_overwrite(ALLOC basicAllocator)
requires !is_array<ELEMENT_TYPE>::value && !is_pointer<ALLOC>::value;

Return a shared_ptr object referring to and managing a new ARRAY_TYPE object, where ARRAY_TYPE is a bounded array. The specified basicAllocator will be used to supply a single contiguous region of memory holding the returned shared pointer's internal representation and the new ARRAY_TYPE object, and the array is default‐constructed. If basicAllocator is 0, then the default allocator will be used instead.

template<
    class ARRAY_TYPE,
    class ALLOC>
bsl::shared_ptr<ARRAY_TYPE>
allocate_shared_for_overwrite(ALLOC* basicAllocator)
requires is_bounded_array<ARRAY_TYPE>::value;

Return a shared_ptr object referring to and managing a new ELEMENT_TYPE object. The specified basicAllocator will be used to supply a single contiguous region of memory holding the returned shared pointer's internal representation and the new ELEMENT_TYPE object, which is default‐constructed. If basicAllocator is 0, then the default allocator will be used instead.

template<
    class ELEMENT_TYPE,
    class ALLOC>
bsl::shared_ptr<ELEMENT_TYPE>
allocate_shared_for_overwrite(ALLOC* basicAllocator)
requires !is_array<ELEMENT_TYPE>::value;

Return a shared_ptr object referring to and managing a new ARRAY_TYPE object, where ARRAY_TYPE is a unbounded array. The specified basicAllocator will be used to supply a single contiguous region of memory holding the returned shared pointer's internal representation and the new ARRAY_TYPE containing the specified numElements number of elements, and the array is default‐constructed.

template<
    class ARRAY_TYPE,
    class ALLOC>
bsl::shared_ptr<ARRAY_TYPE>
allocate_shared_for_overwrite(
    ALLOC basicAllocator,
    std::size_t numElements)
requires is_unbounded_array<ARRAY_TYPE>::value &&
                                                     !is_pointer<ALLOC>::value;

Return a shared_ptr object referring to and managing a new ARRAY_TYPE object, where ARRAY_TYPE is a unbounded array. The specified basicAllocator will be used to supply a single contiguous region of memory holding the returned shared pointer's internal representation and the new ARRAY_TYPE containing the specified numElements number of elements, and the array is default‐constructed. If basicAllocator is 0, then the default allocator will be used instead.

template<
    class ARRAY_TYPE,
    class ALLOC>
bsl::shared_ptr<ARRAY_TYPE>
allocate_shared_for_overwrite(
    ALLOC* basicAllocator,
    std::size_t numElements)
requires is_unbounded_array<ARRAY_TYPE>::value;

Created with MrDocs