std::unordered_multimap::size

来自cppreference.com

 
 
 
的std :: unordered_multimap
成員函數
Original:
Member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
unordered_multimap::unordered_multimap
unordered_multimap::~unordered_multimap
unordered_multimap::operator=
unordered_multimap::get_allocator
迭代器
Original:
Iterators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
unordered_multimap::begin
unordered_multimap::cbegin
unordered_multimap::end
unordered_multimap::cend
容量
Original:
Capacity
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
unordered_multimap::erase
unordered_multimap::size
unordered_multimap::max_size
修飾符
Original:
Modifiers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
unordered_multimap::clear
unordered_multimap::insert
unordered_multimap::emplace
unordered_multimap::emplace_hint
unordered_multimap::erase
unordered_multimap::swap
查找
Original:
Lookup
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
unordered_multimap::count
unordered_multimap::find
unordered_multimap::equal_range
斗介面
Original:
Bucket interface
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
unordered_multimap::begin2
unordered_multimap::end2
unordered_multimap::bucket_count
unordered_multimap::max_bucket_count
unordered_multimap::bucket_size
unordered_multimap::bucket
哈希政策
Original:
Hash policy
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
unordered_multimap::load_factor
unordered_multimap::max_load_factor
unordered_multimap::rehash
unordered_multimap::reserve
觀察員
Original:
Observers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
unordered_multimap::hash_function
unordered_multimap::key_eq
 
size_type size() const;
(C++11 起)

Returns the number of elements in the container, i.e. std::distance(begin(), end()).

目錄

[编辑] 參數

(無)
Original:
(none)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[编辑] 返回值

在容器中的元素的數量
Original:
the number of elements in the container
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[编辑] 例外

noexcept specification:  
noexcept
  (C++11 起)

[编辑] 複雜性

Constant

[编辑] 為例

The following code uses size to display the number of elements in a std::unordered_multimap<int>:

#include <unordered_multimap>
#include <iostream>
 
int main()
{
    std::unordered_multimap<int, char> nums {{1, 'a'}, {3, 'b'}, {5, 'c'}, {7, 'd'}};
 
    std::cout << "nums contains " << nums.size() << " elements.\n";
}

Output:

nums contains 4 elements.

[编辑] 另請參閱

檢查是否容器是空的
Original:
checks whether the container is empty
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(公共成員函數) [edit]
返回可能的最大數量的元素
Original:
returns the maximum possible number of elements
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(公共成員函數) [edit]