![]() |
OpenSiv3D
v0.6.5
C++20 framework for creative coding
|
動的配列 More...
#include <String.hpp>
Public Types | |
using | container_type = std::vector< Type, Allocator > |
using | value_type = typename container_type::value_type |
配列の要素の型 More... | |
using | pointer = typename container_type::pointer |
要素のポインタ型 More... | |
using | const_pointer = typename container_type::const_pointer |
要素の const ポインタ型 More... | |
using | reference = typename container_type::reference |
要素の参照型 More... | |
using | const_reference = typename container_type::const_reference |
要素の const 参照型 More... | |
using | iterator = typename container_type::iterator |
イテレータ型 More... | |
using | const_iterator = typename container_type::const_iterator |
const イテレータ型 More... | |
using | reverse_iterator = typename container_type::reverse_iterator |
リバース・イテレータ型 More... | |
using | const_reverse_iterator = typename container_type::const_reverse_iterator |
const リバース・イテレータ型 More... | |
using | size_type = typename container_type::size_type |
要素の個数を表現する型 More... | |
using | difference_type = typename container_type::difference_type |
2 つの要素間の距離を表現する型 More... | |
using | allocator_type = typename container_type::allocator_type |
アロケータの型 More... | |
Public Member Functions | |
SIV3D_NODISCARD_CXX20 | Array ()=default |
デフォルトコンストラクタ More... | |
SIV3D_NODISCARD_CXX20 | Array (const Array &)=default |
コピーコンストラクタ More... | |
SIV3D_NODISCARD_CXX20 | Array (Array &&)=default |
ムーブコンストラクタ More... | |
SIV3D_NODISCARD_CXX20 | Array (const container_type &other) |
std::vector からのコピーで配列を作成します。 More... | |
SIV3D_NODISCARD_CXX20 | Array (container_type &&other) |
std::vector からのムーブで配列を作成します。 More... | |
SIV3D_NODISCARD_CXX20 | Array (const Allocator &alloc) noexcept |
SIV3D_NODISCARD_CXX20 | Array (size_type count, const value_type &value, const Allocator &alloc=Allocator{}) |
count 個の value で配列を作成します。 More... | |
SIV3D_NODISCARD_CXX20 | Array (size_type count, const Allocator &alloc=Allocator{}) |
count 個の Type() で配列を作成します。 More... | |
template<class Iterator > | |
SIV3D_NODISCARD_CXX20 | Array (Iterator first, Iterator last, const Allocator &alloc=Allocator{}) |
イテレータが指す範囲の要素から配列を作成します。 More... | |
SIV3D_NODISCARD_CXX20 | Array (const Array &other, const Allocator &alloc) |
SIV3D_NODISCARD_CXX20 | Array (Array &&other, const Allocator &alloc) |
SIV3D_NODISCARD_CXX20 | Array (const container_type &other, const Allocator &alloc) |
SIV3D_NODISCARD_CXX20 | Array (container_type &&other, const Allocator &alloc) |
SIV3D_NODISCARD_CXX20 | Array (std::initializer_list< value_type > ilist, const Allocator &alloc=Allocator{}) |
初期化リストから配列を作成します。 More... | |
template<class ArrayIsh , std::enable_if_t< Meta::HasAsArray< ArrayIsh >::value > * = nullptr> | |
SIV3D_NODISCARD_CXX20 | Array (ArrayIsh &&a) |
asArray() を持つ型から配列を作成します。 More... | |
template<class Fty , std::enable_if_t< std::is_invocable_r_v< Type, Fty >> * = nullptr> | |
SIV3D_NODISCARD_CXX20 | Array (size_type size, Arg::generator_< Fty > generator) |
ジェネレータ関数を使って配列を作成します。 More... | |
template<class Fty , std::enable_if_t< std::is_invocable_r_v< Type, Fty, size_t >> * = nullptr> | |
SIV3D_NODISCARD_CXX20 | Array (size_type size, Arg::indexedGenerator_< Fty > indexedGenerator) |
インデックス指定ジェネレータ関数を使って配列を作成します。 More... | |
SIV3D_NODISCARD_CXX20 | Array (Arg::reserve_< size_type > size) |
配列を作成し、reserve() します。 More... | |
Array & | operator= (const Array &)=default |
コピー代入演算子 More... | |
Array & | operator= (Array &&)=default |
ムーブ代入演算子 More... | |
Array & | operator= (const container_type &other) |
Array & | operator= (container_type &&other) |
Array & | operator= (std::initializer_list< value_type > ilist) |
template<class ArrayIsh , std::enable_if_t< Meta::HasAsArray< ArrayIsh >::value > * = nullptr> | |
Array & | operator= (const ArrayIsh &a) |
Array & | assign (size_type count, const value_type &value) |
template<class Iterator > | |
Array & | assign (Iterator first, Iterator last) |
Array & | assign (std::initializer_list< value_type > ilist) |
allocator_type | get_allocator () const noexcept |
const container_type & | getContainer () const noexcept |
operator container_type () const noexcept | |
const value_type & | at (size_t index) const |
要素にアクセスします。 More... | |
value_type & | at (size_t index) |
要素にアクセスします。 More... | |
const value_type & | operator[] (size_t index) const |
要素にアクセスします。 More... | |
value_type & | operator[] (size_t index) |
要素にアクセスします。 More... | |
reference | front () |
先頭の要素への参照を返します。 More... | |
const_reference | front () const |
先頭の要素への参照を返します。 More... | |
reference | back () |
末尾の要素への参照を返します。 More... | |
const_reference | back () const |
末尾の要素への参照を返します。 More... | |
value_type * | data () noexcept |
先頭の要素を指すポインタを返します。 More... | |
const value_type * | data () const noexcept |
先頭の要素を指すポインタを返します。 More... | |
iterator | begin () noexcept |
配列の先頭位置を指すイテレータを返します。 More... | |
iterator | end () noexcept |
配列の終端位置を指すイテレータを返します。 More... | |
const_iterator | begin () const noexcept |
配列の先頭位置を指すイテレータを返します。 More... | |
const_iterator | end () const noexcept |
配列の終端位置を指すイテレータを返します。 More... | |
const_iterator | cbegin () const noexcept |
配列の先頭位置を指すイテレータを返します。 More... | |
const_iterator | cend () const noexcept |
配列の終端位置を指すイテレータを返します。 More... | |
reverse_iterator | rbegin () noexcept |
配列の末尾位置を指すリバース・イテレータを返します。 More... | |
reverse_iterator | rend () noexcept |
配列の先端位置を指すリバース・イテレータを返します。 More... | |
const_reverse_iterator | rbegin () const noexcept |
配列の末尾位置を指すリバース・イテレータを返します。 More... | |
const_reverse_iterator | rend () const noexcept |
配列の先端位置を指すリバース・イテレータを返します。 More... | |
const_reverse_iterator | crbegin () const noexcept |
配列の末尾位置を指すリバース・イテレータを返します。 More... | |
const_reverse_iterator | crend () const noexcept |
配列の先端位置を指すリバース・イテレータを返します。 More... | |
bool | empty () const noexcept |
配列が空であるかを返します。 More... | |
bool | isEmpty () const noexcept |
配列が空であるかを返します。 More... | |
operator bool () const noexcept | |
配列が要素を持っているかを返します。 More... | |
size_type | size () const noexcept |
配列の要素数を返します。 More... | |
size_type | max_size () const noexcept |
配列の要素数の最大値を返します。 More... | |
void | reserve (size_type n) |
要素数 n までメモリの再確保無しで格納できるよう、必要に応じてメモリを再確保します More... | |
size_type | capacity () const noexcept |
メモリの再確保無しで格納できる要素数を返します。 More... | |
void | shrink_to_fit () |
capacity() を size() まで減らすようにします。 More... | |
void | clear () noexcept |
iterator | insert (const_iterator pos, const value_type &value) |
iterator | insert (const_iterator pos, value_type &&value) |
iterator | insert (const_iterator pos, size_type count, const value_type &value) |
template<class Iterator > | |
iterator | insert (const_iterator pos, Iterator first, Iterator last) |
iterator | insert (const_iterator pos, std::initializer_list< value_type > ilist) |
template<class... Args> | |
iterator | emplace (const_iterator pos, Args &&... args) |
iterator | erase (const_iterator pos) |
iterator | erase (const_iterator first, const_iterator last) |
void | push_back (const value_type &value) |
配列の末尾に要素を追加します。 More... | |
void | push_back (value_type &&value) |
配列の末尾に要素を追加します。 More... | |
template<class... Args> | |
reference | emplace_back (Args &&... args) |
void | pop_back () |
配列の末尾の要素を削除します。 More... | |
void | resize (size_type count) |
void | resize (size_type count, const value_type &value) |
void | swap (Array &other) noexcept |
他の配列と要素を入れ替えます。 More... | |
void | release () |
配列の要素を全て消去し、メモリも解放します。 More... | |
size_t | size_bytes () const noexcept |
配列の要素の合計サイズ(バイト)を返します。 More... | |
void | push_front (const value_type &value) |
配列の先頭に要素を追加します。 More... | |
void | push_front (value_type &&value) |
配列の先頭に要素を追加します。 More... | |
void | pop_front () |
配列の先頭から要素を削除します。 More... | |
void | pop_front_N (size_t n) |
配列の先頭から指定した個数の要素を削除します。 More... | |
void | pop_back_N (size_t n) |
配列の末尾から指定した個数の要素を削除します。 More... | |
Array & | operator<< (const value_type &value) |
配列の末尾に要素を追加します。 More... | |
Array & | operator<< (value_type &&value) |
配列の末尾に要素を追加します。 More... | |
template<class Fty , std::enable_if_t< std::is_invocable_v< Fty, Type >> * = nullptr> | |
auto | operator>> (Fty f) const |
各要素に関数を適用します。 More... | |
template<class Fty = decltype(Identity), std::enable_if_t< std::is_invocable_r_v< bool, Fty, Type >> * = nullptr> | |
bool | all (Fty f=Identity) const |
全ての要素が条件を満たすかを返します。 More... | |
template<class Fty = decltype(Identity), std::enable_if_t< std::is_invocable_r_v< bool, Fty, Type >> * = nullptr> | |
bool | any (Fty f=Identity) const |
条件を満たす要素があるかを返します。 More... | |
Array & | append (const Array &other_array) |
配列の末尾に別の配列を追加します。 More... | |
value_type & | choice () |
配列の要素を 1 つランダムに返します。 More... | |
const value_type & | choice () const |
配列の要素を 1 つランダムに返します。 More... | |
SIV3D_CONCEPT_URBG value_type & | choice (URBG &&rbg) |
指定した乱数エンジンを用いて、配列の要素を 1 つランダムに返します。 More... | |
const SIV3D_CONCEPT_URBG value_type & | choice (URBG &&rbg) const |
指定した乱数エンジンを用いて、配列の要素を 1 つランダムに返します。 More... | |
SIV3D_CONCEPT_INTEGRAL Array | choice (Int n) const |
配列の要素から指定した個数だけ重複なくランダムに選んで返します。 More... | |
template<class Size_t , class URBG , std::enable_if_t< std::is_integral_v< Size_t >> * = nullptr, std::enable_if_t< std::conjunction_v< std::is_invocable< URBG & >, std::is_unsigned< std::invoke_result_t< URBG & >>>> * = nullptr> | |
Array | choice (Size_t n, URBG &&rbg) const |
指定した乱数エンジンを用いて、 配列の要素から指定した個数だけ重複なくランダムに選んで返します。 More... | |
Array< Array< value_type > > | chunk (size_t n) const |
指定した個数の要素を持つ配列のグループに分割します。最後のグループの要素数は n 個未満になることがあります。 More... | |
size_t | count (const value_type &value) const |
指定した値と等しい要素の個数を返します。 More... | |
template<class Fty , std::enable_if_t< std::is_invocable_r_v< bool, Fty, Type >> * = nullptr> | |
size_t | count_if (Fty f) const |
条件を満たす要素の個数を返します。 More... | |
template<class Fty , std::enable_if_t< std::is_invocable_v< Fty, Type & >> * = nullptr> | |
Array & | each (Fty f) |
全ての要素を順番に引数にして関数を呼び出します。 More... | |
template<class Fty , std::enable_if_t< std::is_invocable_v< Fty, Type >> * = nullptr> | |
const Array & | each (Fty f) const |
全ての要素を順番に引数にして関数を呼び出します。 More... | |
template<class Fty , std::enable_if_t< std::is_invocable_v< Fty, size_t, Type & >> * = nullptr> | |
Array & | each_index (Fty f) |
全ての要素とそのインデックスを順番に引数にして関数を呼び出します。 More... | |
template<class Fty , std::enable_if_t< std::is_invocable_v< Fty, size_t, Type >> * = nullptr> | |
const Array & | each_index (Fty f) const |
全ての要素とそのインデックスを順番に引数にして関数を呼び出します。 More... | |
const value_type & | fetch (size_t index, const value_type &defaultValue) const |
指定したインデックスにある要素を返します。インデックスが範囲外の場合デフォルト値を返します。 More... | |
Array & | fill (const value_type &value) |
指定した値を全ての要素に代入します。 More... | |
template<class Fty , std::enable_if_t< std::is_invocable_r_v< bool, Fty, Type >> * = nullptr> | |
Array | filter (Fty f) const |
指定した条件を満たす要素だけを集めた新しい配列を返します。 More... | |
Array< Array< value_type > > | in_groups (size_t group) const |
要素を指定したグループ数に分割します。 More... | |
bool | includes (const value_type &value) const |
指定した値と等しい要素があるかを返します。 More... | |
template<class Fty , std::enable_if_t< std::is_invocable_r_v< bool, Fty, Type >> * = nullptr> | |
bool | includes_if (Fty f) const |
指定した条件を満たす要素があるかを返します。 More... | |
template<class T = Type, std::enable_if_t< Meta::HasLessThan_v< T >> * = nullptr> | |
bool | isSorted () const |
配列の要素が昇順にソートされているかを返します。 More... | |
String | join (StringView sep=U", "_sv, StringView begin=U"{"_sv, StringView end=U"}"_sv) const |
template<class Fty , std::enable_if_t< std::is_invocable_v< Fty, Type >> * = nullptr> | |
auto | map (Fty f) const |
template<class Fty = decltype(Identity), std::enable_if_t< std::is_invocable_r_v< bool, Fty, Type >> * = nullptr> | |
bool | none (Fty f=Identity) const |
条件を満たす要素が存在しないかを返します。 More... | |
template<class Fty , std::enable_if_t< std::is_invocable_r_v< bool, Fty, Type >> * = nullptr> | |
auto | partition (Fty f) |
条件を満たすすべての要素を、条件を満たさないすべての要素より前に移動させます。 More... | |
template<class Fty , class R = std::decay_t<std::invoke_result_t<Fty, Type, Type>>> | |
auto | reduce (Fty f, R init) const |
template<class Fty , std::enable_if_t< std::is_invocable_v< Fty, Type, Type >> * = nullptr> | |
auto | reduce1 (Fty f) const |
Array & | remove (const value_type &value) |
Array | removed (const value_type &value) const & |
Array | removed (const value_type &value) && |
Array & | remove_at (size_t index) |
Array | removed_at (size_t index) const |
template<class Fty , std::enable_if_t< std::is_invocable_r_v< bool, Fty, Type >> * = nullptr> | |
Array & | remove_if (Fty f) |
条件を満たす要素を配列から削除します。 More... | |
template<class Fty , std::enable_if_t< std::is_invocable_r_v< bool, Fty, Type >> * = nullptr> | |
Array | removed_if (Fty f) const & |
条件を満たす要素を配列から削除した新しい配列を返します。 More... | |
template<class Fty , std::enable_if_t< std::is_invocable_r_v< bool, Fty, Type >> * = nullptr> | |
Array | removed_if (Fty f) && |
条件を満たす要素を配列から削除した新しい配列を返します。 More... | |
Array & | replace (const value_type &oldValue, const value_type &newValue) |
Array | replaced (const value_type &oldValue, const value_type &newValue) const & |
Array | replaced (const value_type &oldValue, const value_type &newValue) && |
template<class Fty , std::enable_if_t< std::is_invocable_r_v< bool, Fty, Type >> * = nullptr> | |
Array & | replace_if (Fty f, const value_type &newValue) |
template<class Fty , std::enable_if_t< std::is_invocable_r_v< bool, Fty, Type >> * = nullptr> | |
Array | replaced_if (Fty f, const value_type &newValue) const & |
template<class Fty , std::enable_if_t< std::is_invocable_r_v< bool, Fty, Type >> * = nullptr> | |
Array | replaced_if (Fty f, const value_type &newValue) && |
Array & | reverse () |
配列の要素を逆順に並び替えます。 More... | |
Array | reversed () const & |
配列の要素を逆順に並び替えた新しい配列を返します。 More... | |
Array | reversed () && |
配列の要素を逆順に並び替えた新しい配列を返します。 More... | |
template<class Fty , std::enable_if_t< std::is_invocable_v< Fty, Type & >> * = nullptr> | |
Array & | reverse_each (Fty f) |
template<class Fty , std::enable_if_t< std::is_invocable_v< Fty, Type >> * = nullptr> | |
const Array & | reverse_each (Fty f) const |
Array & | rotate (std::ptrdiff_t count=1) |
Array | rotated (std::ptrdiff_t count=1) const & |
Array | rotated (std::ptrdiff_t count=1) && |
template<class T = Type, std::enable_if_t< Meta::HasGreaterThan_v< T >> * = nullptr> | |
Array & | rsort () |
template<class T = Type, std::enable_if_t< Meta::HasGreaterThan_v< T >> * = nullptr> | |
Array | rsorted () const & |
template<class T = Type, std::enable_if_t< Meta::HasGreaterThan_v< T >> * = nullptr> | |
Array | rsorted () && |
Array & | shuffle () |
配列の要素の並び順をランダムにシャッフルします。 More... | |
SIV3D_CONCEPT_URBG Array & | shuffle (URBG &&rbg) |
Array | shuffled () const & |
Array | shuffled () && |
SIV3D_CONCEPT_URBG Array | shuffled (URBG &&rbg) const & |
SIV3D_CONCEPT_URBG Array | shuffled (URBG &&rbg) && |
Array | slice (size_t index) const |
Array | slice (size_t index, size_t length) const |
template<class T = Type, std::enable_if_t< Meta::HasLessThan_v< T >> * = nullptr> | |
Array & | sort () |
template<class T = Type, std::enable_if_t< Meta::HasLessThan_v< T >> * = nullptr> | |
Array & | stable_sort () |
template<class Fty , std::enable_if_t< std::is_invocable_r_v< bool, Fty, Type, Type >> * = nullptr> | |
Array & | sort_by (Fty f) |
template<class Fty , std::enable_if_t< std::is_invocable_r_v< bool, Fty, Type, Type >> * = nullptr> | |
Array & | stable_sort_by (Fty f) |
template<class T = Type, std::enable_if_t< Meta::HasLessThan_v< T >> * = nullptr> | |
Array | sorted () const & |
template<class Fty , std::enable_if_t< std::is_invocable_r_v< bool, Fty, Type >> * = nullptr> | |
auto | stable_partition (Fty f) |
相対順序を保ちながら、条件を満たすすべての要素を、条件を満たさないすべての要素より前に移動させます。 More... | |
template<class T = Type, std::enable_if_t< Meta::HasLessThan_v< T >> * = nullptr> | |
Array | stable_sorted () const & |
template<class T = Type, std::enable_if_t< Meta::HasLessThan_v< T >> * = nullptr> | |
Array | sorted () && |
template<class T = Type, std::enable_if_t< Meta::HasLessThan_v< T >> * = nullptr> | |
Array | stable_sorted () && |
template<class Fty , std::enable_if_t< std::is_invocable_r_v< bool, Fty, Type, Type >> * = nullptr> | |
Array | sorted_by (Fty f) const & |
template<class Fty , std::enable_if_t< std::is_invocable_r_v< bool, Fty, Type, Type >> * = nullptr> | |
Array | stable_sorted_by (Fty f) const & |
template<class Fty , std::enable_if_t< std::is_invocable_r_v< bool, Fty, Type, Type >> * = nullptr> | |
Array | sorted_by (Fty f) && |
template<class Fty , std::enable_if_t< std::is_invocable_r_v< bool, Fty, Type, Type >> * = nullptr> | |
Array | stable_sorted_by (Fty f) && |
template<class T = Type, std::enable_if_t< Meta::HasPlus_v< T >> * = nullptr> | |
auto | sum () const |
template<class T = Type, std::enable_if_t< not Meta::HasPlus_v< T >> * = nullptr> | |
void | sum () const =delete |
template<class T = Type, std::enable_if_t< std::is_floating_point_v< T >> * = nullptr> | |
auto | sumF () const |
template<class T = Type, std::enable_if_t< not std::is_floating_point_v< T >> * = nullptr> | |
auto | sumF () const =delete |
Array | take (size_t n) const |
template<class Fty , std::enable_if_t< std::is_invocable_r_v< bool, Fty, Type >> * = nullptr> | |
Array | take_while (Fty f) const |
Array & | stable_unique () |
Array | stable_uniqued () const |
Array & | sort_and_unique () |
Array | sorted_and_uniqued () const & |
Array | sorted_and_uniqued () && |
Array & | unique_consecutive () |
Array | uniqued_consecutive () const & |
Array | uniqued_consecutive () && |
Array | values_at (std::initializer_list< size_t > indices) const |
template<class Fty , std::enable_if_t< std::is_invocable_r_v< bool, Fty, Type >> * = nullptr> | |
size_t | parallel_count_if (Fty f) const |
template<class Fty , std::enable_if_t< std::is_invocable_v< Fty, Type & >> * = nullptr> | |
void | parallel_each (Fty f) |
template<class Fty , std::enable_if_t< std::is_invocable_v< Fty, Type >> * = nullptr> | |
void | parallel_each (Fty f) const |
template<class Fty , std::enable_if_t< std::is_invocable_v< Fty, Type >> * = nullptr> | |
auto | parallel_map (Fty f) const |
Static Public Member Functions | |
template<class Fty , std::enable_if_t< std::is_invocable_r_v< Type, Fty >> * = nullptr> | |
static Array | Generate (size_type size, Fty generator) |
template<class Fty , std::enable_if_t< std::is_invocable_r_v< Type, Fty, size_t >> * = nullptr> | |
static Array | IndexedGenerate (size_type size, Fty indexedGenerator) |
Friends | |
std::ostream & | operator<< (std::ostream &output, const Array &value) |
std::wostream & | operator<< (std::wostream &output, const Array &value) |
std::basic_ostream< char32 > & | operator<< (std::basic_ostream< char32 > &output, const Array &value) |
void | Formatter (FormatData &formatData, const Array &value) |
動的配列
Type | 要素の型 |
Allocator | アロケータ |
using s3d::Array< Type, Allocator >::allocator_type = typename container_type::allocator_type |
アロケータの型
using s3d::Array< Type, Allocator >::const_iterator = typename container_type::const_iterator |
const イテレータ型
using s3d::Array< Type, Allocator >::const_pointer = typename container_type::const_pointer |
要素の const ポインタ型
using s3d::Array< Type, Allocator >::const_reference = typename container_type::const_reference |
要素の const 参照型
using s3d::Array< Type, Allocator >::const_reverse_iterator = typename container_type::const_reverse_iterator |
const リバース・イテレータ型
using s3d::Array< Type, Allocator >::container_type = std::vector<Type, Allocator> |
using s3d::Array< Type, Allocator >::difference_type = typename container_type::difference_type |
2 つの要素間の距離を表現する型
using s3d::Array< Type, Allocator >::iterator = typename container_type::iterator |
イテレータ型
using s3d::Array< Type, Allocator >::pointer = typename container_type::pointer |
要素のポインタ型
using s3d::Array< Type, Allocator >::reference = typename container_type::reference |
要素の参照型
using s3d::Array< Type, Allocator >::reverse_iterator = typename container_type::reverse_iterator |
リバース・イテレータ型
using s3d::Array< Type, Allocator >::size_type = typename container_type::size_type |
要素の個数を表現する型
using s3d::Array< Type, Allocator >::value_type = typename container_type::value_type |
配列の要素の型
|
default |
デフォルトコンストラクタ
|
default |
コピーコンストラクタ
other | コピーする配列 |
|
default |
ムーブコンストラクタ
other | ムーブする配列 |
SIV3D_NODISCARD_CXX20 s3d::Array< Type, Allocator >::Array | ( | const container_type & | other | ) |
std::vector からのコピーで配列を作成します。
other | コピーする配列 |
SIV3D_NODISCARD_CXX20 s3d::Array< Type, Allocator >::Array | ( | container_type && | other | ) |
std::vector からのムーブで配列を作成します。
other | ムーブする配列 |
|
explicitnoexcept |
alloc |
SIV3D_NODISCARD_CXX20 s3d::Array< Type, Allocator >::Array | ( | size_type | count, |
const value_type & | value, | ||
const Allocator & | alloc = Allocator{} |
||
) |
count 個の value で配列を作成します。
count | 個数 |
value | 要素 |
alloc | アロケータ |
|
explicit |
count 個の Type() で配列を作成します。
count | 個数 |
alloc | アロケータ |
SIV3D_NODISCARD_CXX20 s3d::Array< Type, Allocator >::Array | ( | Iterator | first, |
Iterator | last, | ||
const Allocator & | alloc = Allocator{} |
||
) |
イテレータが指す範囲の要素から配列を作成します。
Iterator | イテレータ |
first | 範囲の開始位置を指すイテレータ |
last | 範囲の終端位置を指すイテレータ |
alloc | アロケータ |
SIV3D_NODISCARD_CXX20 s3d::Array< Type, Allocator >::Array | ( | const Array< Type, Allocator > & | other, |
const Allocator & | alloc | ||
) |
other | |
alloc |
SIV3D_NODISCARD_CXX20 s3d::Array< Type, Allocator >::Array | ( | Array< Type, Allocator > && | other, |
const Allocator & | alloc | ||
) |
other | |
alloc |
SIV3D_NODISCARD_CXX20 s3d::Array< Type, Allocator >::Array | ( | const container_type & | other, |
const Allocator & | alloc | ||
) |
other | |
alloc |
SIV3D_NODISCARD_CXX20 s3d::Array< Type, Allocator >::Array | ( | container_type && | other, |
const Allocator & | alloc | ||
) |
other | |
alloc |
SIV3D_NODISCARD_CXX20 s3d::Array< Type, Allocator >::Array | ( | std::initializer_list< value_type > | ilist, |
const Allocator & | alloc = Allocator{} |
||
) |
初期化リストから配列を作成します。
ilist | 初期化リスト |
alloc | アロケータ |
|
explicit |
asArray()
を持つ型から配列を作成します。
ArrayIsh | asArray() を持つ型 |
a | asArray() を持つ型のオブジェクト |
SIV3D_NODISCARD_CXX20 s3d::Array< Type, Allocator >::Array | ( | size_type | size, |
Arg::generator_< Fty > | generator | ||
) |
ジェネレータ関数を使って配列を作成します。
Fty | ジェネレータ関数の型 |
size | 作成する配列の要素数 |
generator | ジェネレータ関数 |
SIV3D_NODISCARD_CXX20 s3d::Array< Type, Allocator >::Array | ( | size_type | size, |
Arg::indexedGenerator_< Fty > | indexedGenerator | ||
) |
インデックス指定ジェネレータ関数を使って配列を作成します。
Fty | ジェネレータ関数の型 |
size | 作成する配列の要素数 |
indexedGenerator | インデックス指定ジェネレータ関数 |
|
explicit |
bool s3d::Array< Type, Allocator >::all | ( | Fty | f = Identity | ) | const |
全ての要素が条件を満たすかを返します。
Fty | 条件を記述した関数の型 |
f | 条件を記述した関数 |
bool s3d::Array< Type, Allocator >::any | ( | Fty | f = Identity | ) | const |
条件を満たす要素があるかを返します。
Fty | 条件を記述した関数の型 |
f | 条件を記述した関数 |
Array& s3d::Array< Type, Allocator >::append | ( | const Array< Type, Allocator > & | other_array | ) |
配列の末尾に別の配列を追加します。
other_array | 追加する配列 |
Array& s3d::Array< Type, Allocator >::assign | ( | Iterator | first, |
Iterator | last | ||
) |
Array& s3d::Array< Type, Allocator >::assign | ( | size_type | count, |
const value_type & | value | ||
) |
Array& s3d::Array< Type, Allocator >::assign | ( | std::initializer_list< value_type > | ilist | ) |
value_type& s3d::Array< Type, Allocator >::at | ( | size_t | index | ) |
要素にアクセスします。
index | 要素へのインデックス |
const value_type& s3d::Array< Type, Allocator >::at | ( | size_t | index | ) | const |
要素にアクセスします。
index | 要素へのインデックス |
std::out_of_range | 範囲外アクセスの場合 throw |
reference s3d::Array< Type, Allocator >::back | ( | ) |
末尾の要素への参照を返します。
const_reference s3d::Array< Type, Allocator >::back | ( | ) | const |
末尾の要素への参照を返します。
|
noexcept |
配列の先頭位置を指すイテレータを返します。
|
noexcept |
配列の先頭位置を指すイテレータを返します。
|
noexcept |
メモリの再確保無しで格納できる要素数を返します。
|
noexcept |
配列の先頭位置を指すイテレータを返します。
|
noexcept |
配列の終端位置を指すイテレータを返します。
value_type& s3d::Array< Type, Allocator >::choice | ( | ) |
配列の要素を 1 つランダムに返します。
const value_type& s3d::Array< Type, Allocator >::choice | ( | ) | const |
配列の要素を 1 つランダムに返します。
SIV3D_CONCEPT_INTEGRAL Array s3d::Array< Type, Allocator >::choice | ( | Int | n | ) | const |
配列の要素から指定した個数だけ重複なくランダムに選んで返します。
Int | 個数に使う整数型 |
n | 選択する個数 |
Array s3d::Array< Type, Allocator >::choice | ( | Size_t | n, |
URBG && | rbg | ||
) | const |
指定した乱数エンジンを用いて、 配列の要素から指定した個数だけ重複なくランダムに選んで返します。
Size_t | 個数に使う整数型 |
n | 選択する個数 |
rbg | 使用する乱数エンジン |
SIV3D_CONCEPT_URBG value_type& s3d::Array< Type, Allocator >::choice | ( | URBG && | rbg | ) |
指定した乱数エンジンを用いて、配列の要素を 1 つランダムに返します。
URBG | 使用する乱数エンジンの型 |
rbg | 使用する乱数エンジン |
const SIV3D_CONCEPT_URBG value_type& s3d::Array< Type, Allocator >::choice | ( | URBG && | rbg | ) | const |
指定した乱数エンジンを用いて、配列の要素を 1 つランダムに返します。
URBG | 使用する乱数エンジンの型 |
rbg | 使用する乱数エンジン |
Array<Array<value_type> > s3d::Array< Type, Allocator >::chunk | ( | size_t | n | ) | const |
指定した個数の要素を持つ配列のグループに分割します。最後のグループの要素数は n 個未満になることがあります。
n | 1 つのグループが持つ要素数 |
|
noexcept |
size_t s3d::Array< Type, Allocator >::count | ( | const value_type & | value | ) | const |
指定した値と等しい要素の個数を返します。
value | 検索する値 |
size_t s3d::Array< Type, Allocator >::count_if | ( | Fty | f | ) | const |
条件を満たす要素の個数を返します。
Fty | 条件を記述した関数の型 |
f | 条件を記述した関数 |
|
noexcept |
配列の末尾位置を指すリバース・イテレータを返します。
|
noexcept |
配列の先端位置を指すリバース・イテレータを返します。
|
noexcept |
先頭の要素を指すポインタを返します。
|
noexcept |
先頭の要素を指すポインタを返します。
Array& s3d::Array< Type, Allocator >::each | ( | Fty | f | ) |
全ての要素を順番に引数にして関数を呼び出します。
Fty | 呼び出す関数の型 |
f | 呼び出す関数 |
for (auto& x : xs) f(x);
と同じです。 const Array& s3d::Array< Type, Allocator >::each | ( | Fty | f | ) | const |
全ての要素を順番に引数にして関数を呼び出します。
Fty | 呼び出す関数の型 |
f | 呼び出す関数 |
for (const auto& x : xs) f(x);
と同じです。 Array& s3d::Array< Type, Allocator >::each_index | ( | Fty | f | ) |
全ての要素とそのインデックスを順番に引数にして関数を呼び出します。
Fty | 呼び出す関数の型 |
f | 呼び出す関数 |
for (size_t i = 0; auto& x : xs) f(i++, x);
と同じです。 const Array& s3d::Array< Type, Allocator >::each_index | ( | Fty | f | ) | const |
全ての要素とそのインデックスを順番に引数にして関数を呼び出します。
Fty | 呼び出す関数の型 |
f | 呼び出す関数 |
for (size_t i = 0; const auto& x : xs) f(i++, x);
と同じです。 iterator s3d::Array< Type, Allocator >::emplace | ( | const_iterator | pos, |
Args &&... | args | ||
) |
reference s3d::Array< Type, Allocator >::emplace_back | ( | Args &&... | args | ) |
|
noexcept |
配列が空であるかを返します。
|
noexcept |
配列の終端位置を指すイテレータを返します。
|
noexcept |
配列の終端位置を指すイテレータを返します。
iterator s3d::Array< Type, Allocator >::erase | ( | const_iterator | first, |
const_iterator | last | ||
) |
iterator s3d::Array< Type, Allocator >::erase | ( | const_iterator | pos | ) |
const value_type& s3d::Array< Type, Allocator >::fetch | ( | size_t | index, |
const value_type & | defaultValue | ||
) | const |
指定したインデックスにある要素を返します。インデックスが範囲外の場合デフォルト値を返します。
index | インデックス |
defaultValue | インデックスが範囲外の場合に返すデフォルト値 |
Array& s3d::Array< Type, Allocator >::fill | ( | const value_type & | value | ) |
指定した値を全ての要素に代入します。
value | 代入する値 |
Array s3d::Array< Type, Allocator >::filter | ( | Fty | f | ) | const |
指定した条件を満たす要素だけを集めた新しい配列を返します。
Fty | 条件を記述した関数の型 |
f | 条件を記述した関数 |
reference s3d::Array< Type, Allocator >::front | ( | ) |
先頭の要素への参照を返します。
const_reference s3d::Array< Type, Allocator >::front | ( | ) | const |
先頭の要素への参照を返します。
|
static |
Fty |
size | |
generator |
|
noexcept |
|
noexcept |
Array<Array<value_type> > s3d::Array< Type, Allocator >::in_groups | ( | size_t | group | ) | const |
要素を指定したグループ数に分割します。
group | グループ数 |
bool s3d::Array< Type, Allocator >::includes | ( | const value_type & | value | ) | const |
指定した値と等しい要素があるかを返します。
value | 検索する値 |
bool s3d::Array< Type, Allocator >::includes_if | ( | Fty | f | ) | const |
指定した条件を満たす要素があるかを返します。
Fty | 条件を記述した関数の型 |
f | 条件を記述した関数 |
.any(f)
と同じです。
|
static |
Fty |
size | |
indexedGenerator |
iterator s3d::Array< Type, Allocator >::insert | ( | const_iterator | pos, |
const value_type & | value | ||
) |
iterator s3d::Array< Type, Allocator >::insert | ( | const_iterator | pos, |
Iterator | first, | ||
Iterator | last | ||
) |
iterator s3d::Array< Type, Allocator >::insert | ( | const_iterator | pos, |
size_type | count, | ||
const value_type & | value | ||
) |
iterator s3d::Array< Type, Allocator >::insert | ( | const_iterator | pos, |
std::initializer_list< value_type > | ilist | ||
) |
iterator s3d::Array< Type, Allocator >::insert | ( | const_iterator | pos, |
value_type && | value | ||
) |
|
noexcept |
bool s3d::Array< Type, Allocator >::isSorted | ( | ) | const |
配列の要素が昇順にソートされているかを返します。
String s3d::Array< Type, Allocator >::join | ( | StringView | sep = U", "_sv , |
StringView | begin = U"{"_sv , |
||
StringView | end = U"}"_sv |
||
) | const |
sep | |
begin | |
end |
auto s3d::Array< Type, Allocator >::map | ( | Fty | f | ) | const |
Fty |
f |
|
noexcept |
配列の要素数の最大値を返します。
bool s3d::Array< Type, Allocator >::none | ( | Fty | f = Identity | ) | const |
条件を満たす要素が存在しないかを返します。
Fty | 条件を記述した関数の型 |
f | 条件を記述した関数 |
|
explicitnoexcept |
配列が要素を持っているかを返します。
|
noexcept |
Array& s3d::Array< Type, Allocator >::operator<< | ( | const value_type & | value | ) |
配列の末尾に要素を追加します。
value | 追加する値 |
Array& s3d::Array< Type, Allocator >::operator<< | ( | value_type && | value | ) |
配列の末尾に要素を追加します。
value | 追加する値 |
|
default |
ムーブ代入演算子
other | ムーブする配列 |
|
default |
コピー代入演算子
other | コピーする配列 |
Array& s3d::Array< Type, Allocator >::operator= | ( | const ArrayIsh & | a | ) |
Array& s3d::Array< Type, Allocator >::operator= | ( | const container_type & | other | ) |
Array& s3d::Array< Type, Allocator >::operator= | ( | container_type && | other | ) |
Array& s3d::Array< Type, Allocator >::operator= | ( | std::initializer_list< value_type > | ilist | ) |
auto s3d::Array< Type, Allocator >::operator>> | ( | Fty | f | ) | const |
各要素に関数を適用します。
Fty | 適用する関数の型 |
f | 適用する関数 |
.each(f), 戻り値を持つ場合は
.map(f)` と同じです。 value_type& s3d::Array< Type, Allocator >::operator[] | ( | size_t | index | ) |
要素にアクセスします。
index | 要素へのインデックス |
const value_type& s3d::Array< Type, Allocator >::operator[] | ( | size_t | index | ) | const |
要素にアクセスします。
index | 要素へのインデックス |
size_t s3d::Array< Type, Allocator >::parallel_count_if | ( | Fty | f | ) | const |
Fty |
f |
void s3d::Array< Type, Allocator >::parallel_each | ( | Fty | f | ) |
Fty |
f |
void s3d::Array< Type, Allocator >::parallel_each | ( | Fty | f | ) | const |
Fty |
f |
auto s3d::Array< Type, Allocator >::parallel_map | ( | Fty | f | ) | const |
Fty |
f |
auto s3d::Array< Type, Allocator >::partition | ( | Fty | f | ) |
条件を満たすすべての要素を、条件を満たさないすべての要素より前に移動させます。
Fty | 条件を記述した関数の型 |
f | 条件を記述した関数 |
void s3d::Array< Type, Allocator >::pop_back | ( | ) |
配列の末尾の要素を削除します。
void s3d::Array< Type, Allocator >::pop_back_N | ( | size_t | n | ) |
void s3d::Array< Type, Allocator >::pop_front | ( | ) |
配列の先頭から要素を削除します。
void s3d::Array< Type, Allocator >::pop_front_N | ( | size_t | n | ) |
void s3d::Array< Type, Allocator >::push_back | ( | const value_type & | value | ) |
配列の末尾に要素を追加します。
value | 追加する値 |
void s3d::Array< Type, Allocator >::push_back | ( | value_type && | value | ) |
配列の末尾に要素を追加します。
value | 追加する値 |
void s3d::Array< Type, Allocator >::push_front | ( | const value_type & | value | ) |
配列の先頭に要素を追加します。
value | 追加する値 |
void s3d::Array< Type, Allocator >::push_front | ( | value_type && | value | ) |
配列の先頭に要素を追加します。
value | 追加する値 |
|
noexcept |
配列の末尾位置を指すリバース・イテレータを返します。
|
noexcept |
配列の末尾位置を指すリバース・イテレータを返します。
auto s3d::Array< Type, Allocator >::reduce | ( | Fty | f, |
R | init | ||
) | const |
Fty | |
R |
f | |
init |
auto s3d::Array< Type, Allocator >::reduce1 | ( | Fty | f | ) | const |
Fty |
f |
void s3d::Array< Type, Allocator >::release | ( | ) |
配列の要素を全て消去し、メモリも解放します。
Array& s3d::Array< Type, Allocator >::remove | ( | const value_type & | value | ) |
value |
Array& s3d::Array< Type, Allocator >::remove_at | ( | size_t | index | ) |
index |
Array& s3d::Array< Type, Allocator >::remove_if | ( | Fty | f | ) |
条件を満たす要素を配列から削除します。
Fty | 条件を記述した関数の型 |
f | 条件 |
Array s3d::Array< Type, Allocator >::removed | ( | const value_type & | value | ) | && |
value |
Array s3d::Array< Type, Allocator >::removed | ( | const value_type & | value | ) | const & |
value |
Array s3d::Array< Type, Allocator >::removed_at | ( | size_t | index | ) | const |
index |
Array s3d::Array< Type, Allocator >::removed_if | ( | Fty | f | ) | && |
条件を満たす要素を配列から削除した新しい配列を返します。
Fty | 条件を記述した関数の型 |
f | 条件 |
Array s3d::Array< Type, Allocator >::removed_if | ( | Fty | f | ) | const & |
条件を満たす要素を配列から削除した新しい配列を返します。
Fty | 条件を記述した関数の型 |
f | 条件 |
|
noexcept |
配列の先端位置を指すリバース・イテレータを返します。
|
noexcept |
配列の先端位置を指すリバース・イテレータを返します。
Array& s3d::Array< Type, Allocator >::replace | ( | const value_type & | oldValue, |
const value_type & | newValue | ||
) |
oldValue | |
newValue |
Array& s3d::Array< Type, Allocator >::replace_if | ( | Fty | f, |
const value_type & | newValue | ||
) |
Fty |
f | |
newValue |
Array s3d::Array< Type, Allocator >::replaced | ( | const value_type & | oldValue, |
const value_type & | newValue | ||
) | && |
oldValue | |
newValue |
Array s3d::Array< Type, Allocator >::replaced | ( | const value_type & | oldValue, |
const value_type & | newValue | ||
) | const & |
oldValue | |
newValue |
Array s3d::Array< Type, Allocator >::replaced_if | ( | Fty | f, |
const value_type & | newValue | ||
) | && |
Fty |
f | |
newValue |
Array s3d::Array< Type, Allocator >::replaced_if | ( | Fty | f, |
const value_type & | newValue | ||
) | const & |
Fty |
f | |
newValue |
void s3d::Array< Type, Allocator >::reserve | ( | size_type | n | ) |
要素数 n までメモリの再確保無しで格納できるよう、必要に応じてメモリを再確保します
n | メモリを確保する要素数 |
void s3d::Array< Type, Allocator >::resize | ( | size_type | count | ) |
void s3d::Array< Type, Allocator >::resize | ( | size_type | count, |
const value_type & | value | ||
) |
Array& s3d::Array< Type, Allocator >::reverse | ( | ) |
配列の要素を逆順に並び替えます。
Array& s3d::Array< Type, Allocator >::reverse_each | ( | Fty | f | ) |
Fty |
f |
const Array& s3d::Array< Type, Allocator >::reverse_each | ( | Fty | f | ) | const |
Fty |
f |
Array s3d::Array< Type, Allocator >::reversed | ( | ) | && |
配列の要素を逆順に並び替えた新しい配列を返します。
Array s3d::Array< Type, Allocator >::reversed | ( | ) | const & |
配列の要素を逆順に並び替えた新しい配列を返します。
Array& s3d::Array< Type, Allocator >::rotate | ( | std::ptrdiff_t | count = 1 | ) |
count |
Array s3d::Array< Type, Allocator >::rotated | ( | std::ptrdiff_t | count = 1 | ) | && |
count |
Array s3d::Array< Type, Allocator >::rotated | ( | std::ptrdiff_t | count = 1 | ) | const & |
count |
Array& s3d::Array< Type, Allocator >::rsort | ( | ) |
Array s3d::Array< Type, Allocator >::rsorted | ( | ) | && |
Array s3d::Array< Type, Allocator >::rsorted | ( | ) | const & |
void s3d::Array< Type, Allocator >::shrink_to_fit | ( | ) |
capacity() を size() まで減らすようにします。
Array& s3d::Array< Type, Allocator >::shuffle | ( | ) |
配列の要素の並び順をランダムにシャッフルします。
SIV3D_CONCEPT_URBG Array& s3d::Array< Type, Allocator >::shuffle | ( | URBG && | rbg | ) |
rbg |
Array s3d::Array< Type, Allocator >::shuffled | ( | ) | && |
Array s3d::Array< Type, Allocator >::shuffled | ( | ) | const & |
SIV3D_CONCEPT_URBG Array s3d::Array< Type, Allocator >::shuffled | ( | URBG && | rbg | ) | && |
URBG |
rbg |
SIV3D_CONCEPT_URBG Array s3d::Array< Type, Allocator >::shuffled | ( | URBG && | rbg | ) | const & |
URBG |
rbg |
|
noexcept |
配列の要素数を返します。
|
noexcept |
配列の要素の合計サイズ(バイト)を返します。
Array s3d::Array< Type, Allocator >::slice | ( | size_t | index | ) | const |
index |
Array s3d::Array< Type, Allocator >::slice | ( | size_t | index, |
size_t | length | ||
) | const |
index | |
length |
Array& s3d::Array< Type, Allocator >::sort | ( | ) |
Array& s3d::Array< Type, Allocator >::sort_and_unique | ( | ) |
Array& s3d::Array< Type, Allocator >::sort_by | ( | Fty | f | ) |
Fty |
f |
Array s3d::Array< Type, Allocator >::sorted | ( | ) | && |
Array s3d::Array< Type, Allocator >::sorted | ( | ) | const & |
Array s3d::Array< Type, Allocator >::sorted_and_uniqued | ( | ) | && |
Array s3d::Array< Type, Allocator >::sorted_and_uniqued | ( | ) | const & |
Array s3d::Array< Type, Allocator >::sorted_by | ( | Fty | f | ) | && |
Fty |
f |
Array s3d::Array< Type, Allocator >::sorted_by | ( | Fty | f | ) | const & |
Fty |
f |
auto s3d::Array< Type, Allocator >::stable_partition | ( | Fty | f | ) |
相対順序を保ちながら、条件を満たすすべての要素を、条件を満たさないすべての要素より前に移動させます。
Fty | 条件を記述した関数の型 |
f | 条件を記述した関数 |
Array& s3d::Array< Type, Allocator >::stable_sort | ( | ) |
Array& s3d::Array< Type, Allocator >::stable_sort_by | ( | Fty | f | ) |
Fty |
f |
Array s3d::Array< Type, Allocator >::stable_sorted | ( | ) | && |
Array s3d::Array< Type, Allocator >::stable_sorted | ( | ) | const & |
Array s3d::Array< Type, Allocator >::stable_sorted_by | ( | Fty | f | ) | && |
Fty |
f |
Array s3d::Array< Type, Allocator >::stable_sorted_by | ( | Fty | f | ) | const & |
Fty |
f |
Array& s3d::Array< Type, Allocator >::stable_unique | ( | ) |
Array s3d::Array< Type, Allocator >::stable_uniqued | ( | ) | const |
auto s3d::Array< Type, Allocator >::sum | ( | ) | const |
T |
|
delete |
T |
auto s3d::Array< Type, Allocator >::sumF | ( | ) | const |
T |
|
delete |
T |
|
noexcept |
他の配列と要素を入れ替えます。
other | 入れ替える配列 |
Array s3d::Array< Type, Allocator >::take | ( | size_t | n | ) | const |
n |
Array s3d::Array< Type, Allocator >::take_while | ( | Fty | f | ) | const |
Fty |
f |
Array& s3d::Array< Type, Allocator >::unique_consecutive | ( | ) |
Array s3d::Array< Type, Allocator >::uniqued_consecutive | ( | ) | && |
Array s3d::Array< Type, Allocator >::uniqued_consecutive | ( | ) | const & |
Array s3d::Array< Type, Allocator >::values_at | ( | std::initializer_list< size_t > | indices | ) | const |
indices |
|
friend |
formatData | |
value |
|
friend |
output | |
value |
|
friend |
output | |
value |
|
friend |
output | |
value |