std::map::map

来自cppreference.com
< cpp‎ | container‎ | map

 
 
 
std::map
成员函数
原文:
Member functions
这段文字是通过 Google Translate 自动翻译生成的。
您可以帮助我们检查、纠正翻译中的错误。详情请点击这里
map::map
map::~map
map::operator=
map::get_allocator
元素的访问
原文:
Element access
这段文字是通过 Google Translate 自动翻译生成的。
您可以帮助我们检查、纠正翻译中的错误。详情请点击这里
map::at
map::operator[]
迭代器
原文:
Iterators
这段文字是通过 Google Translate 自动翻译生成的。
您可以帮助我们检查、纠正翻译中的错误。详情请点击这里
map::begin
map::cbegin

(C++11)
map::end
map::cend

(C++11)
map::rbegin
map::crbegin

(C++11)
map::rend
map::crend

(C++11)
容量
原文:
Capacity
这段文字是通过 Google Translate 自动翻译生成的。
您可以帮助我们检查、纠正翻译中的错误。详情请点击这里
map::empty
map::size
map::max_size
修饰符
原文:
Modifiers
这段文字是通过 Google Translate 自动翻译生成的。
您可以帮助我们检查、纠正翻译中的错误。详情请点击这里
map::clear
map::insert
map::emplace(C++11)
map::emplace_hint(C++11)
map::erase
map::swap
查找
原文:
Lookup
这段文字是通过 Google Translate 自动翻译生成的。
您可以帮助我们检查、纠正翻译中的错误。详情请点击这里
map::count
map::find
map::equal_range
map::lower_bound
map::upper_bound
观察员
原文:
Observers
这段文字是通过 Google Translate 自动翻译生成的。
您可以帮助我们检查、纠正翻译中的错误。详情请点击这里
map::key_comp
map::value_comp
 
explicit map( const Compare& comp = Compare(),
              const Allocator& alloc = Allocator() );
(1)
explicit map( const Allocator& alloc );
(1) (C++11 起)
template< class InputIt >

map( InputIt first, InputIt last,
     const Compare& comp = Compare(),

     const Allocator& alloc = Allocator() );
(2)
map( const map& other );
(3)
map( const map& other, const Allocator& alloc );
(3) (C++11 起)
map( map&& other );
(4) (C++11 起)
map( map&& other, const Allocator& alloc );
(4) (C++11 起)
map( std::initializer_list<value_type> init,

     const Compare& comp = Compare(),

     const Allocator& alloc = Allocator() );
(5) (C++11 起)

Constructs new container from a variety of data sources and optionally using user supplied allocator alloc or comparison function comp.

1)
默认构造函数。构造空的容器.
原文:
default constructor. Constructs empty container.
这段文字是通过 Google Translate 自动翻译生成的。
您可以帮助我们检查、纠正翻译中的错误。详情请点击这里
2)
构造的容器的内容的范围内[first, last).
原文:
constructs the container with the contents of the range [first, last).
这段文字是通过 Google Translate 自动翻译生成的。
您可以帮助我们检查、纠正翻译中的错误。详情请点击这里
3)
拷贝构造函数。副本的内容other构造的容器。 alloc不提供,分配器是通过调用std::allocator_traits<allocator_type>::select_on_copy_construction(other).
原文:
copy constructor. Constructs the container with the copy of the contents of other. If alloc is not provided, allocator is obtained by calling std::allocator_traits<allocator_type>::select_on_copy_construction(other).
这段文字是通过 Google Translate 自动翻译生成的。
您可以帮助我们检查、纠正翻译中的错误。详情请点击这里
4)
移动的构造函数。构造的容器与内容other使用移动语义。 alloc不提供,分配器是通过移动建设属于other从分配器.
原文:
move constructor. Constructs the container with the contents of other using move semantics. If alloc is not provided, allocator is obtained by move-construction from the allocator belonging to other.
这段文字是通过 Google Translate 自动翻译生成的。
您可以帮助我们检查、纠正翻译中的错误。详情请点击这里
5)
构建容器初始化列表的内容init
原文:
constructs the container with the contents of the initializer list init.
这段文字是通过 Google Translate 自动翻译生成的。
您可以帮助我们检查、纠正翻译中的错误。详情请点击这里

目录

[编辑] 参数

alloc -
使用这个容器中的所有内存分配的分配器
原文:
allocator to use for all memory allocations of this container
这段文字是通过 Google Translate 自动翻译生成的。
您可以帮助我们检查、纠正翻译中的错误。详情请点击这里
comp - comparison function to use for all comparisons of keys
first, last -
取值范围为从复制元素
原文:
the range to copy the elements from
这段文字是通过 Google Translate 自动翻译生成的。
您可以帮助我们检查、纠正翻译中的错误。详情请点击这里
other -
要用作源初始化容器的元素与另一个容器
原文:
another container to be used as source to initialize the elements of the container with
这段文字是通过 Google Translate 自动翻译生成的。
您可以帮助我们检查、纠正翻译中的错误。详情请点击这里
init -
的初始化列表初始化容器元素
原文:
initializer list to initialize the elements of the container with
这段文字是通过 Google Translate 自动翻译生成的。
您可以帮助我们检查、纠正翻译中的错误。详情请点击这里
类型要求
-
InputIt 必须满足 InputIterator 的要求。

[编辑] 复杂性

1)
不变
原文:
constant
这段文字是通过 Google Translate 自动翻译生成的。
您可以帮助我们检查、纠正翻译中的错误。详情请点击这里
2)
firstlast之间的距离呈线性关系
原文:
linear in distance between first and last
这段文字是通过 Google Translate 自动翻译生成的。
您可以帮助我们检查、纠正翻译中的错误。详情请点击这里
3)
线性大小other
原文:
linear in size of other
这段文字是通过 Google Translate 自动翻译生成的。
您可以帮助我们检查、纠正翻译中的错误。详情请点击这里
4)
不变。如果alloc,并给出alloc != other.get_allocator(),则采用线性.
原文:
constant. If alloc is given and alloc != other.get_allocator(), then linear.
这段文字是通过 Google Translate 自动翻译生成的。
您可以帮助我们检查、纠正翻译中的错误。详情请点击这里
5)
线性大小init
原文:
linear in size of init
这段文字是通过 Google Translate 自动翻译生成的。
您可以帮助我们检查、纠正翻译中的错误。详情请点击这里

[编辑] 为例

[编辑] 另请参阅

将值分配到容器中
原文:
assigns values to the container
这段文字是通过 Google Translate 自动翻译生成的。
您可以帮助我们检查、纠正翻译中的错误。详情请点击这里

(公共成员函数) [edit]