Skip to main content

std::string get_allocator() method

// Const version only
constexpr allocator_type get_allocator() const noexcept;

Returns the allocator associated with the string.

note

The allocator_type is explained in std::string class reference

Parameters

(none)

Return value

The associated allocator.

Complexity

Constant - O(1).

Example

important

This section requires improvement. You can help by editing this doc page.

See also

puballocator

The default allocator.

puballocator_traits

Provides information about allocator types.

pubuses_allocator

Checks if the specified type supports uses-allocator construction.

This article originates from this CppReference page. It was likely altered for improvements or editors' preference. Click "Edit this page" to see all changes made to this document.
Hover to see the original license.

std::string get_allocator() method

// Const version only
constexpr allocator_type get_allocator() const noexcept;

Returns the allocator associated with the string.

note

The allocator_type is explained in std::string class reference

Parameters

(none)

Return value

The associated allocator.

Complexity

Constant - O(1).

Example

important

This section requires improvement. You can help by editing this doc page.

See also

puballocator

The default allocator.

puballocator_traits

Provides information about allocator types.

pubuses_allocator

Checks if the specified type supports uses-allocator construction.

This article originates from this CppReference page. It was likely altered for improvements or editors' preference. Click "Edit this page" to see all changes made to this document.
Hover to see the original license.