名前空間
変種
操作

std::deque::assign

提供: cppreference.com
< cpp‎ | container‎ | deque

 
 
 
はstd :: dequeの
メンバ関数
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.
deque::deque
deque::~deque
deque::operator=
deque::assign
deque::get_allocator
要素アクセスの循環参照を解除するために使用されている
Original:
Element access
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
deque::front
deque::back
イテレータ
Original:
Iterators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
deque::begin
deque::cbegin

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

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

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

(C++11)
容量
Original:
Capacity
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
deque::empty
deque::size
deque::max_size
deque::shrink_to_fit
修飾子
Original:
Modifiers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
deque::clear
deque::insert
deque::emplace
deque::erase
deque::push_front
deque::emplace_front
deque::pop_front
deque::push_back
deque::emplace_back
deque::pop_back
deque::resize
deque::swap
 
void assign( size_type count, const T& value );
(1)
template< class InputIt >
void assign( InputIt first, InputIt last );
(2)
コンテナの内容を置き換え.
Original:
Replaces the contents of the container.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
1)
countvalueのコピーで内容を置き換えます
Original:
replaces the contents with count copies of value value
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
2)
レンジ[first, last)のもののコピーで内容を置き換えます
Original:
replaces the contents with copies of those in the range [first, last)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

目次

[編集] パラメータ

count -
コンテナの新しいサイズ
Original:
the new size of the container
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
value -
でコンテナの要素を初期化するための値
Original:
the value to initialize elements of the container with
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
first, last -
から要素をコピーする範囲
Original:
the range to copy the elements from
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Type requirements
-
InputIt must meet the requirements of InputIterator.

[編集] 複雑

1)
countの線形
Original:
linear in count
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
2)
firstlastとの間の距離の線形
Original:
linear in distance between first and last
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集]

次のコードは、assignにいくつかの文字を追加するstd::deque<char>を使用しています
Original:
The following code uses assign to add several characters to a std::deque<char>:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

#include <deque>
#include <iostream>
 
int main()
{
    std::deque<char> characters;
 
    characters.assign(5, 'a');
 
    for (char c : characters) {
        std::cout << c << '\n';
    } 
 
    return 0;
}

Output:

a
a
a
a
a

[編集] も参照してください

dequeを構築します
Original:
constructs the deque
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数) [edit]