名前空間
変種
操作

std::vector

提供:cppreference.com
 
 
 
std::vector
メンバ関数
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.
vector::vector
vector::~vector
vector::operator=
vector::assign
vector::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.
vector::at
vector::operator[]
vector::front
vector::back
vector::data(C++11)
イテレータ
Original:
Iterators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
vector::begin
vector::cbegin

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

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

(C++11)
vector::rend
vector::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.
vector::empty
vector::size
vector::max_size
vector::reserve
vector::capacity
vector::shrink_to_fit(C++11)
修飾子
Original:
Modifiers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
vector::clear
vector::insert
vector::emplace(C++11)
vector::erase
vector::push_back
vector::emplace_back(C++11)
vector::pop_back
vector::resize
vector::swap
 
Defined in header <vector>
template<

    class T,
    class Allocator = std::allocator<T>

> class vector;
std::vector動的なサイズの配列をカプセル化シーケンスコンテナです.
Original:
std::vector is a sequence container that encapsulates dynamic size arrays.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
要素は、要素はだけでなくイテレータを介してアクセスするだけでなく、要素への定期的なポインタでオフセットを使用してできることを意味し、連続して格納されます。これは、ベクトルの要素へのポインタは配列の要素へのポインタを受け取る任意の関数に渡すことができることを意味します.
Original:
The elements are stored contiguously, which means that elements can be accessed not only through iterators, but also using offsets on regular pointers to elements. This means that a pointer to an element of a vector may be passed to any function that expects a pointer to an element of an array.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ベクトルのストレージが必要に応じて伸縮されて、自動的に処理されます。より多くのメモリは、将来の成長を処理するために割り当てられているため、ベクターは、通常、静的な配列よりも大きな領域を占めている。このようにベクトルは、要素が挿入されるたびに再割り当てする必要はありませんが、追加のメモリが枯渇している場合のみです。割り当てられたメモリの総量はcapacity()機能を使用して照会できます。余分なメモリがshrink_to_fit()への呼び出しを介してシステムに戻すことができます.
Original:
The storage of the vector is handled automatically, being expanded and contracted as needed. Vectors usually occupy more space than static arrays, because more memory is allocated to handle future growth. This way a vector does not need to reallocate each time an element is inserted, but only when the additional memory is exhausted. The total amount of allocated memory can be queried using capacity() function. Extra memory can be returned to the system via a call to shrink_to_fit().
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
再配分は通常、パフォーマンスの面で高価な操作です。要素数があらかじめわかっている場合reserve()関数は再割り当てを排除するために使用することができます.
Original:
Reallocations are usually costly operations in terms of performance. reserve() function can be used to eliminate reallocations if the number of elements is known beforehand.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ベクトル上の一般的な操作の複雑さ(効率)は以下の通りです:
Original:
The complexity (efficiency) of common operations on vectors is as follows:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
  • ランダムアクセス - 定数O(1)
    Original:
    Random access - constant O(1)
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • 最後に挿入または要素の除去 - 償却定数O(1)
    Original:
    Insertion or removal of elements at the end - amortized constant O(1)
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • 要素の挿入または取り外し - ベクトルO(n)の端までの距離の線形
    Original:
    Insertion or removal of elements - linear in distance to the end of the vector O(n)
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
std::vectorContainerの要件を満たし、AllocatorAwareContainerSequenceContainerReversibleContainer.
Original:
std::vector meets the requirements of Container, AllocatorAwareContainer, SequenceContainer and ReversibleContainer.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

目次

[編集] スペシャ

標準ライブラリには、スペース効率のために最適化されている型std::vectorboolの専門性を提供しています.
Original:
The standard library provides a specialization of std::vector for the type bool, which is optimized for space efficiency.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
スペース効率に優れたダイナミックbitsetの
Original:
space-efficient dynamic bitset
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(クラステンプレート) [edit]

[編集] メンバータイプ

メンバー·タイプ
Original:
Member type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Definition
value_type T [edit]
allocator_type Allocator [edit]
size_type
符号なし整数型(通常size_t
Original:
Unsigned integral type (usually size_t)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
[edit]
difference_type Signed integer type (usually ptrdiff_t) [edit]
reference Allocator::reference (C + + 11時まで)
value_type& (C + + 11以来) [edit]
const_reference Allocator::const_reference (C + + 11時まで)
const value_type& (C + + 11以来) [edit]
pointer Allocator::pointer (C + + 11時まで)
std::allocator_traits<Allocator>::pointer (C + + 11以来) [edit]
const_pointer Allocator::const_pointer (C + + 11時まで)
std::allocator_traits<Allocator>::const_pointer (C + + 11以来) [edit]
iterator RandomAccessIterator [edit]
const_iterator
一定のランダムアクセス反復子を返します
Original:
Constant random access iterator
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
[edit]
reverse_iterator std::reverse_iterator<iterator> [edit]
const_reverse_iterator std::reverse_iterator<const_iterator> [edit]

[編集] メンバ関数

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

(パブリックメンバ関数) [edit]
destructs the vector
(パブリックメンバ関数) [edit]
コンテナに値を割り当てます
Original:
assigns values to the container
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数) [edit]
コンテナに値を割り当てます
Original:
assigns values to the container
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 associated allocator
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数) [edit]
要素アクセスの循環参照を解除するために使用されている
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.
境界チェックと指定された要素にアクセスします
Original:
access specified element with bounds checking
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数) [edit]
指定された要素にアクセスします
Original:
access specified element
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数) [edit]
最初の要素にアクセスします
Original:
access the first element
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数) [edit]
access the last element
(パブリックメンバ関数) [edit]
(C++11)
基になる配列へのアクセスを指示する
Original:
direct access to the underlying array
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数) [edit]
イテレータ
Original:
Iterators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
先頭を指すイテレータを返す
Original:
returns an iterator to the beginning
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 an iterator to the end
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 a reverse iterator to the beginning
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 a reverse iterator to the end
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数) [edit]
容量
Original:
Capacity
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
容器が空であるかどうかをチェックします
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 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]
要素の最大数を返します
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]
埋蔵ストレージ
Original:
reserves storage
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 number of elements that can be held in currently allocated storage
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数) [edit]
未使用のメモリを解放してメモリ使用量を減らすことができます
Original:
reduces memory usage by freeing unused memory
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数) [edit]
修飾子
Original:
Modifiers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
内容をクリアします
Original:
clears the contents
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数) [edit]
インサート要素
Original:
inserts elements
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数) [edit]
(C++11)
constructs element in-place
(パブリックメンバ関数) [edit]
消去さ要素
Original:
erases elements
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数) [edit]
最後に要素を追加します
Original:
adds elements to the end
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数) [edit]
終了時にその場で要素を構成します
Original:
constructs elements in-place at the end
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数) [edit]
最後の要素を削除します
Original:
removes the last element
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数) [edit]
changes the number of elements stored
(パブリックメンバ関数) [edit]
スワップ内容
Original:
swaps the contents
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

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

[編集] 非メンバ関数

辞書的にvector内の値を比較します
Original:
lexicographically compares the values in the vector
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(関数テンプレート) [edit]
std::swapアルゴリズムを専門としています
Original:
specializes the std::swap algorithm
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(関数テンプレート) [edit]