nlib
|
PODを要素に持つベクタをreallocベースで実装しています。 [詳解]
#include "nn/nlib/ReallocVec.h"
公開型 | |
typedef void *(* | ReallocFunc) (void *, size_t) |
reallocに相当する関数の型です。 | |
typedef | |
typedef T | value_type |
要素型 T | |
typedef size_t | size_type |
符号なし整数型(size_t ) | |
typedef ptrdiff_t | difference_type |
符号つき整数型(ptrdiff_t ) | |
typedef T & | reference |
T& | |
typedef const T & | const_reference |
const T& | |
typedef T * | pointer |
T* | |
typedef const T * | const_pointer |
const T* | |
typedef T * | iterator |
ランダムアクセスイテレータ | |
typedef const T * | const_iterator |
読み取り専用ランダムアクセスイテレータ | |
typedef std::reverse_iterator< iterator > | reverse_iterator |
std::reverse_iterator<iterator> | |
typedef std::reverse_iterator< const_iterator > | const_reverse_iterator |
std::reverse_iterator<const_iterator> | |
公開メンバ関数 | |
constexpr | ReallocVec () noexcept |
デフォルトコンストラクタで、std::realloc を利用します。 | |
constexpr | ReallocVec (ReallocFunc func) noexcept |
コンストラクタで、realloc関数をユーザーが指定できます。 [詳解] | |
ReallocFunc | GetRealloc () const noexcept |
指定したrealloc関数を取得します。 [詳解] | |
bool | push_back (const T &v) noexcept |
ベクタに要素を追加します。 [詳解] | |
bool | pop_back () noexcept |
ベクタの末尾から要素を削除します。 [詳解] | |
T & | operator[] (size_t idx) |
idx 番目の要素を取得します。 [詳解] | |
const T & | operator[] (size_t idx) const |
operator[](size_t idx) を御覧ください。 | |
T & | front () |
最初の要素を取得します。 [詳解] | |
const T & | front () const |
front() をご覧ください。 | |
T & | back () |
最後の要素を取得します。 [詳解] | |
const T & | back () const |
back() を御覧ください。 | |
iterator | begin () noexcept |
先頭要素を指すイテレータを取得する。 [詳解] | |
const_iterator | begin () const noexcept |
begin() を御覧ください。 | |
const_iterator | cbegin () const noexcept |
先頭要素を指す読み取り専用イテレータを取得する。 [詳解] | |
iterator | end () noexcept |
末尾の次を指すイテレータを取得する。 [詳解] | |
const_iterator | end () const noexcept |
end() を御覧ください。 | |
const_iterator | cend () const noexcept |
末尾の次を指す読み取り専用イテレータを取得する。 [詳解] | |
reverse_iterator | rbegin () noexcept |
末尾要素を指す逆イテレータを取得する。 [詳解] | |
const_reverse_iterator | rbegin () const noexcept |
rbegin() を御覧ください。 | |
reverse_iterator | rend () noexcept |
先頭の前を指す逆イテレータを取得する。 [詳解] | |
const_reverse_iterator | rend () const noexcept |
rend() を御覧ください。 | |
const_reverse_iterator | crbegin () const noexcept |
末尾要素を指す読み取り専用逆イテレータを取得する。 [詳解] | |
const_reverse_iterator | crend () const noexcept |
先頭の前を指す読み取り専用逆イテレータを取得する。 [詳解] | |
void | swap (ReallocVec &rhs) noexcept |
ベクタを交換する [詳解] | |
size_t | size () const noexcept |
ベクタのサイズを取得する [詳解] | |
size_t | capacity () const noexcept |
メモリを再確保せずに格納できる最大の要素数を取得する [詳解] | |
bool | empty () const noexcept |
ベクタが空かどうかを判定する [詳解] | |
bool | reserve (size_t n) noexcept |
n 個の要素までをメモリを最確保せずに格納できるようにする。 [詳解] | |
bool | resize (size_t n) noexcept |
要素数を変更する [詳解] | |
void | clear () noexcept |
ベクタを空にします。メモリは確保されたままであることに注意してください。 [詳解] | |
void | shrink_to_fit () noexcept |
確保されたメモリを現在の要素数を丁度格納できるサイズにフィッティングします。 | |
iterator | insert (iterator pos, const T &val) |
要素をpos の場所に挿入します。 [詳解] | |
PODを要素に持つベクタをreallocベースで実装しています。
T | 要素の型。PODである必要があります。 |
ReallocVec.h の 18 行目に定義があります。
|
inlineexplicitnoexcept |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
ベクタを空にします。メモリは確保されたままであることに注意してください。
ベクタを空にします。
ReallocVec.h の 105 行目に定義があります。
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
|
inline |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
要素数を変更する
[in] | n | 要素数 |
true
ReallocVec.h の 100 行目に定義があります。
|
inlinenoexcept |
|
inlinenoexcept |
© 2012-2016 Nintendo Co., Ltd. All rights reserved.