public member function
<unordered_set>
std::unordered_multiset::unordered_multiset empty (1)explicit unordered_multiset ( size_type n = /* see below */, const hasher& hf = hasher(), const key_equal& eql = key_equal(), const allocator_type& alloc = allocator_type() );explicit unordered_multiset ( const allocator_type& alloc );range (2)
template <class InputIterator> unordered_multiset ( InputIterator first, InputIterator last, size_type n = /* see below */, const hasher& hf = hasher(), const key_equal& eql = key_equal(), const allocator_type& alloc = allocator_type() );copy (3)
unordered_multiset ( const unordered_multiset& ums );unordered_multiset ( const unordered_multiset& ums, const allocator_type& alloc );move (4)
unordered_multiset ( unordered_multiset&& ums );unordered_multiset ( unordered_multiset&& ums, const allocator_type& alloc );initializer list (5)
unordered_multiset ( initializer_list<value_type> il, size_type n = /* see below */, const hasher& hf = hasher(), const key_equal& eql = key_equal(), const allocator_type& alloc = allocator_type() );empty (1)
unordered_multiset();explicit unordered_multiset ( size_type n, const hasher& hf = hasher(), const key_equal& eql = key_equal(), const allocator_type& alloc = allocator_type() );explicit unordered_multiset ( const allocator_type& alloc ); unordered_multiset ( size_type n, const allocator_type& alloc ); unordered_multiset ( size_type n, const hasher& hf, const allocator_type& alloc );range (2)
template <class InputIterator> unordered_multiset ( InputIterator first, InputIterator last, size_type n = /* see below */, const hasher& hf = hasher(), const key_equal& eql = key_equal(), const allocator_type& alloc = allocator_type() );template <class InputIterator> unordered_multiset ( InputIterator first, InputIterator last, size_type n, const allocator_type& alloc );template <class InputIterator> unordered_multiset ( InputIterator first, InputIterator last, size_type n, const hasher& hf, const allocator_type& alloc );copy (3)
unordered_multiset ( const unordered_multiset& ums );unordered_multiset ( const unordered_multiset& ums, const allocator_type& alloc );move (4)
unordered_multiset ( unordered_multiset&& ums );unordered_multiset ( unordered_multiset&& ums, const allocator_type& alloc );initializer list (5)
unordered_multiset ( initializer_list<value_type> il, size_type n = /* see below */, const hasher& hf = hasher(), const key_equal& eql = key_equal(), const allocator_type& alloc = allocator_type() );unordered_multiset ( initializer_list<value_type> il, size_type n, const allocator_type& alloc );unordered_multiset ( initializer_list<value_type> il, size_type n, const hasher& hf, const allocator_type& alloc );
Construct unordered_multiset
Constructs an unordered_multiset container object, initializing its contents depending on the constructor version used:1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// constructing unordered_multisets
#include <iostream>
#include <string>
#include <unordered_set>
template<class T>
T cmerge (T a, T b) { T t(a); t.insert(b.begin(),b.end()); return t; }
int main ()
{
std::unordered_multiset<std::string> first; // empty
std::unordered_multiset<std::string> second ( {"red","green","blue"} ); // init list
std::unordered_multiset<std::string> third ( {"red","yellow","blue"} ); // init list
std::unordered_multiset<std::string> fourth ( second ); // copy
std::unordered_multiset<std::string> fifth ( cmerge(third,fourth) ); // move
std::unordered_multiset<std::string> sixth ( fifth.begin(), fifth.end() ); // range
std::cout << "sixth contains:";
for (const std::string& x: sixth) std::cout << " " << x;
std::cout << std::endl;
return 0;
}
sixth contains: yellow red red green blue blue
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4