Namespaces
Variants
Views
Actions

Difference between revisions of "cpp/string/basic string/capacity"

From cppreference.com
< cpp‎ | string‎ | basic string
m (Update links.)
m (§ 21.4.4 of N3485)
Line 13: Line 13:
  
 
capacity of the currently allocated storage
 
capacity of the currently allocated storage
 +
 +
===Exceptions===
 +
{{noexcept}}
  
 
===Complexity===
 
===Complexity===

Revision as of 18:01, 24 June 2013

 
 
 
std::basic_string
Member functions
Element access
Iterators
Capacity
basic_string::capacity
Modifiers
Search
Operations
Constants
Non-member functions
I/O
Comparison
(until C++20)(until C++20)(until C++20)(until C++20)(until C++20)(C++20)
Numeric conversions
(C++11)(C++11)(C++11)
(C++11)(C++11)
(C++11)(C++11)(C++11)
(C++11)
(C++11)
Literals
Helper classes
Deduction guides (C++17)

 
size_type capacity() const;

Returns the number of characters that the string has currently allocated space for.

Contents

Parameters

(none)

Return value

capacity of the currently allocated storage

Exceptions

noexcept specification:  
noexcept
  

Complexity

Constant

See also

returns the number of characters
(public member function) [edit]
reserves storage
(public member function) [edit]