std::unordered_multiset::operator=

来自cppreference.com

 
 
 
的std :: unordered_multiset
成员函数
原文:
Member functions
这段文字是通过 Google Translate 自动翻译生成的。
您可以帮助我们检查、纠正翻译中的错误。详情请点击这里
unordered_multiset::unordered_multiset
unordered_multiset::~unordered_multiset
unordered_multiset::operator=
unordered_multiset::get_allocator
迭代器
原文:
Iterators
这段文字是通过 Google Translate 自动翻译生成的。
您可以帮助我们检查、纠正翻译中的错误。详情请点击这里
unordered_multiset::begin
unordered_multiset::cbegin
unordered_multiset::end
unordered_multiset::cend
容量
原文:
Capacity
这段文字是通过 Google Translate 自动翻译生成的。
您可以帮助我们检查、纠正翻译中的错误。详情请点击这里
unordered_multiset::erase
unordered_multiset::size
unordered_multiset::max_size
修饰符
原文:
Modifiers
这段文字是通过 Google Translate 自动翻译生成的。
您可以帮助我们检查、纠正翻译中的错误。详情请点击这里
unordered_multiset::clear
unordered_multiset::insert
unordered_multiset::emplace
unordered_multiset::emplace_hint
unordered_multiset::erase
unordered_multiset::swap
查找
原文:
Lookup
这段文字是通过 Google Translate 自动翻译生成的。
您可以帮助我们检查、纠正翻译中的错误。详情请点击这里
unordered_multiset::count
unordered_multiset::find
unordered_multiset::equal_range
斗接口
原文:
Bucket interface
这段文字是通过 Google Translate 自动翻译生成的。
您可以帮助我们检查、纠正翻译中的错误。详情请点击这里
unordered_multiset::begin2
unordered_multiset::end2
unordered_multiset::bucket_count
unordered_multiset::max_bucket_count
unordered_multiset::bucket_size
unordered_multiset::bucket
哈希政策
原文:
Hash policy
这段文字是通过 Google Translate 自动翻译生成的。
您可以帮助我们检查、纠正翻译中的错误。详情请点击这里
unordered_multiset::load_factor
unordered_multiset::max_load_factor
unordered_multiset::rehash
unordered_multiset::reserve
观察员
原文:
Observers
这段文字是通过 Google Translate 自动翻译生成的。
您可以帮助我们检查、纠正翻译中的错误。详情请点击这里
unordered_multiset::hash_function
unordered_multiset::key_eq
 
unordered_multiset& operator=( const unordered_multiset& other );
(1) (C++11 起)
unordered_multiset& operator=( unordered_multiset&& other );
(2) (C++11 起)
替换该容器的内容.
原文:
Replaces the contents of the container.
这段文字是通过 Google Translate 自动翻译生成的。
您可以帮助我们检查、纠正翻译中的错误。详情请点击这里
1)
复制赋值操作者。与other的内容的副本的内容替换.
原文:
Copy assignment operator. Replaces the contents with a copy of the contents of other.
这段文字是通过 Google Translate 自动翻译生成的。
您可以帮助我们检查、纠正翻译中的错误。详情请点击这里
2)
将赋值运算符。的other使用移动语义(即移动中的数据otherother到这个容器中)的内容替换。 other是有效的,但是未指定状态之后.
原文:
Move assignment operator. Replaces the contents with those of other using move semantics (i.e. the data in other is moved from other into this container). other is in valid, but unspecified state afterwards.
这段文字是通过 Google Translate 自动翻译生成的。
您可以帮助我们检查、纠正翻译中的错误。详情请点击这里

目录

[编辑] 参数

other -
另一个容器被用作源
原文:
another container to be used as source
这段文字是通过 Google Translate 自动翻译生成的。
您可以帮助我们检查、纠正翻译中的错误。详情请点击这里

[编辑] 返回值

*this

[编辑] 复杂性

1)
在所述容器的大小线性.
原文:
Linear in the size of the container.
这段文字是通过 Google Translate 自动翻译生成的。
您可以帮助我们检查、纠正翻译中的错误。详情请点击这里
2)
恒定
原文:
Constant.
这段文字是通过 Google Translate 自动翻译生成的。
您可以帮助我们检查、纠正翻译中的错误。详情请点击这里

[编辑] 为例

下面的代码使用:分配一个std::unordered_multiset
原文:
The following code uses to assign one std::unordered_multiset to another:
这段文字是通过 Google Translate 自动翻译生成的。
您可以帮助我们检查、纠正翻译中的错误。详情请点击这里

#include <unordered_set>
#include <iostream>
 
void display_sizes(const std::unordered_multiset<int> &nums1,
                   const std::unordered_multiset<int> &nums2,
                   const std::unordered_multiset<int> &nums3)
{
    std::cout << "nums1: " << nums1.size()
              << " nums2: " << nums2.size()
              << " nums3: " << nums3.size() << '\n';
}
 
int main()
{
    std::unordered_multiset<int> nums1 {3, 1, 4, 6, 5, 9};
    std::unordered_multiset<int> nums2;
    std::unordered_multiset<int> nums3;
 
    std::cout << "Initially:\n";
    display_sizes(nums1, nums2, nums3);
 
    // copy assignment copies data from nums1 to nums2
    nums2 = nums1;
 
    std::cout << "After assigment:\n";
    display_sizes(nums1, nums2, nums3);
 
    // move assignment moves data from nums1 to nums3,
    // modifying both nums1 and nums3
    nums3 = std::move(nums1);
 
    std::cout << "After move assigment:\n";
    display_sizes(nums1, nums2, nums3);
}

输出:

Initially:
nums1: 4 nums2: 0 nums3: 0
After assigment:
nums1: 4 nums2: 4 nums3: 0
After move assigment:
nums1: 0 nums2: 4 nums3: 4

[编辑] 另请参阅

构建unordered_multiset
原文:
constructs the unordered_multiset
这段文字是通过 Google Translate 自动翻译生成的。
您可以帮助我们检查、纠正翻译中的错误。详情请点击这里

(公共成员函数) [edit]