ArraySet< T, SORTED, COMPARE, ARRAY > Class Template Reference Data Structures

#include <arraymap.h>

Inheritance diagram for ArraySet< T, SORTED, COMPARE, ARRAY >:

详细描述

template<typename T, Bool SORTED = true, typename COMPARE = DefaultCompare, typename ARRAY = BaseArraySelector<>>
class maxon::ArraySet< T, SORTED, COMPARE, ARRAY >

An ArraySet is an implementation of a set using an underlying array. An element is in the set if it is in the array. ArraySet is based on ArrayMap and takes care of not inserting an element twice in the array. Like ArrayMap , ArraySet may be either sorted or unsorted. For very small sets, unsorted array sets are generally faster. For large sets (exceeding about 100 entries), you should consider using another implementation such as HashSet or BurstTrieSet because especially insertion and erasure become slow with array sets: For a sorted ArraySet , those operations have a time cost of O(N), while searching has a time cost of O(log N).

Of all sets, the ArraySet is the most efficient with respect to memory usage as it really only stores the contained values.

HashSet for more examples on how to use sets in general.

Template Parameters
T Type of elements of the set.
SORTED Use true for a sorted array.
COMPARE Class to be used to compare the values.
ARRAY An array selector template to choose the array implementation to use.
另请参阅
ArrayMap
$ref sets

Public Types

using  MapType = ArrayMap < T, UnitType , SORTED, COMPARE, ARRAY >
using  IsArrayMap = std::true_type
using  IsArraySet = std::true_type
using  Iterator = typename Super::KeyIterator
using  ConstIterator = typename Super::ConstKeyIterator
-  Public Types inherited from SetBase0< ArraySet< T, true, DefaultCompare, BaseArraySelector<> >, T, Protected< ArrayMap< T, UnitType, true, DefaultCompare, BaseArraySelector<> > >, DefaultCompare >
using  SetType = ArraySet < T, true, DefaultCompare , BaseArraySelector <> >
-  Public Types inherited from Collection< ArraySet< T, true, DefaultCompare, BaseArraySelector<> >, T, Protected< ArrayMap< T, UnitType, true, DefaultCompare, BaseArraySelector<> > > >
using  Super = BaseCollection < ArraySet < T, true, DefaultCompare , BaseArraySelector <> >, Protected < ArrayMap < T, UnitType , true, DefaultCompare , BaseArraySelector <> > > >
using  ValueType = T
-  Public Types inherited from BaseCollection< ArraySet< T, true, DefaultCompare, BaseArraySelector<> >, Protected< ArrayMap< T, UnitType, true, DefaultCompare, BaseArraySelector<> > > >
using  IsCollection = std::true_type

公共成员函数

  ArraySet ()
  ArraySet ( ArraySet && src )
  MAXON_OPERATOR_MOVE_ASSIGNMENT ( ArraySet )
MapType GetMap ()
const MapType GetMap () const
Bool   Contains (typename ByValueParam < T >:: type value) const
ResultMemT < Iterator Insert (const T &value, Bool &added= BoolLValue ())
ResultMemT < Iterator Insert (T &&value, Bool &added= BoolLValue ())
ResultRef < const T >  InsertKey (const T &value, Bool &added= BoolLValue ())
ResultRef < const T >  InsertKey (T &&value, Bool &added= BoolLValue ())
ResultOk < Bool Erase (const T &value)
ConstIterator   Begin () const
ConstIterator   End () const
Iterator   Begin ()
Iterator   End ()
Iterator   Erase (const Iterator &it)
const ARRAY::template Type< T > &  GetUnderlyingArray () const
ARRAY::template Type< T > &  GetUnderlyingArray ()
Iterator   Find (const K &key)
ConstIterator   Find (const K &key) const
Iterator   FindFloor (const K &key)
ConstIterator   FindFloor (const K &key) const
Iterator   FindCeiling (const K &key)
ConstIterator   FindCeiling (const K &key) const
Int   GetOperationCountForSearch () const
-  Public Member Functions inherited from SetBase< ArraySet< T, true, DefaultCompare, BaseArraySelector<> >, T, Protected< ArrayMap< T, UnitType, true, DefaultCompare, BaseArraySelector<> > >, DefaultCompare >
MAXON_ATTRIBUTE_FORCE_INLINE   SetBase (ARGS &&... args)
SetImpl < ArraySet < T, true, DefaultCompare , BaseArraySelector <> > & >  ToSet ()
SetImpl < const ArraySet < T, true, DefaultCompare , BaseArraySelector <> > & >  ToSet () const
MAXON_ATTRIBUTE_FORCE_INLINE   operator SetImpl< ArraySet< T, true, DefaultCompare, BaseArraySelector<> > & > ()
MAXON_ATTRIBUTE_FORCE_INLINE   operator SetImpl< const ArraySet< T, true, DefaultCompare, BaseArraySelector<> > & > () const
-  Public Member Functions inherited from SetBase0< ArraySet< T, true, DefaultCompare, BaseArraySelector<> >, T, Protected< ArrayMap< T, UnitType, true, DefaultCompare, BaseArraySelector<> > >, DefaultCompare >
MAXON_ATTRIBUTE_FORCE_INLINE   SetBase0 (ARGS &&... args)
MAXON_ATTRIBUTE_FORCE_INLINE ResultRef < const T >  Append (typename ByValueParam < T >:: type v)
Bool   ContainsAllImpl (COLLECTION2 &&other, OverloadRank0 ) const
MAXON_ATTRIBUTE_FORCE_INLINE Result < void >  添加 (COLLECTION2 &&other, COLLECTION_RESIZE_FLAGS resizeFlags= COLLECTION_RESIZE_FLAGS::ON_GROW_RESERVE_CAPACITY )
MAXON_ATTRIBUTE_FORCE_INLINE Result < void >  AppendAll (COLLECTION2 &&other, COLLECTION_RESIZE_FLAGS resizeFlags= COLLECTION_RESIZE_FLAGS::ON_GROW_RESERVE_CAPACITY )
MAXON_ATTRIBUTE_FORCE_INLINE Result < void >  CopyFrom (COLLECTION2 &&other, COLLECTION_RESIZE_FLAGS resizeFlags= COLLECTION_RESIZE_FLAGS::FIT_TO_SIZE )
Result < void >  SubtractImpl (COLLECTION2 &&other, OverloadRank0 )
Bool   IsEqualImpl (const COLLECTION2 &other, COMPARE &&cmp, OverloadRank0 ) const
HashInt   GetHashCode () const
-  Public Member Functions inherited from Collection< ArraySet< T, true, DefaultCompare, BaseArraySelector<> >, T, Protected< ArrayMap< T, UnitType, true, DefaultCompare, BaseArraySelector<> > > >
MAXON_ATTRIBUTE_FORCE_INLINE   Collection (ARGS &&... args)
ResultOk < void >  VariadicAppend ()
Result < void >  VariadicAppend (V &&value, VALUES &&... rest)
  operator ValueReceiver< const T & > ()
  operator ValueReceiver< T && > ()
  operator ValueReceiver< typename std::conditional< STD_IS_REPLACEMENT (scalar, T)
DummyParamType &  type ()
Result < Bool ForEach (FN &&callback) const
Result < Bool ForEach (FN &&callback)
H::Iterator  Find (typename ByValueParam < T >:: type v)
H::ConstIterator  Find (typename ByValueParam < T >:: type v) const
Int   FindIndex (typename ByValueParam < T >:: type v) const
MAXON_ATTRIBUTE_FORCE_INLINE Bool   Contains (typename ByValueParam < T >:: type v) const
-  Public Member Functions inherited from BaseCollection< ArraySet< T, true, DefaultCompare, BaseArraySelector<> >, Protected< ArrayMap< T, UnitType, true, DefaultCompare, BaseArraySelector<> > > >
MAXON_ATTRIBUTE_FORCE_INLINE   BaseCollection (ARGS &&... args)
MAXON_ATTRIBUTE_FORCE_INLINE std::enable_if< maxon::IsCollection< COLLECTION2 >::value, Bool >::type  operator== (const COLLECTION2 &other) const
MAXON_ATTRIBUTE_FORCE_INLINE std::enable_if< maxon::IsCollection< COLLECTION2 >::value, Bool >::type  operator!= (const COLLECTION2 &other) const
MAXON_ATTRIBUTE_FORCE_INLINE std::enable_if< maxon::IsCollection< COLLECTION2 >::value &&! STD_IS_REPLACEMENT (same, typename std::decay< COMPARE >::type, EQUALITY ), Bool >::type  IsEqual (const COLLECTION2 &other, COMPARE &&cmp=COMPARE()) const
MAXON_ATTRIBUTE_FORCE_INLINE Result < void >  AppendAll (COLLECTION2 &&other, COLLECTION_RESIZE_FLAGS resizeFlags= COLLECTION_RESIZE_FLAGS::ON_GROW_RESERVE_CAPACITY )
MAXON_ATTRIBUTE_FORCE_INLINE Result < void >  CopyFrom (COLLECTION2 &&other, COLLECTION_RESIZE_FLAGS resizeFlags= COLLECTION_RESIZE_FLAGS::FIT_TO_SIZE )
MAXON_ATTRIBUTE_FORCE_INLINE Result < void >  Subtract (COLLECTION2 &&other)
MAXON_ATTRIBUTE_FORCE_INLINE Result < void >  Intersect (const COLLECTION2 &other)
Bool   Intersects (const COLLECTION2 &other) const
MAXON_ATTRIBUTE_FORCE_INLINE Result < void >  CopyFromImpl (COLLECTION2 &&other, COLLECTION_RESIZE_FLAGS resizeFlags, OverloadRank0 )
Result < void >  AppendAllImpl (COLLECTION2 &&other, COLLECTION_RESIZE_FLAGS resizeFlags, Bool overwrite, OverloadRank0 )
Result < void >  IntersectImpl (COLLECTION2 &&other, OverloadRank0 )
MAXON_ATTRIBUTE_FORCE_INLINE Bool   IsEmpty () const
MAXON_ATTRIBUTE_FORCE_INLINE Bool   IsPopulated () const
String   ToString (const FormatStatement *formatStatement=nullptr) const
MAXON_ATTRIBUTE_FORCE_INLINE Bool   ContainsAll (COLLECTION2 &&other) const
Bool   ContainsAllImpl (COLLECTION2 &&other, OverloadRank0 ) const
-  Public Member Functions inherited from Protected< ArrayMap< T, UnitType, true, DefaultCompare, BaseArraySelector<> > >
  __attribute__ ((always_inline)) explicit Protected (ARGS &&... args)

Private Types

using  Super = SetBase < ArraySet < T, SORTED, COMPARE, ARRAY >, T, Protected < MapType >, COMPARE >

私有成员函数

  MAXON_DISALLOW_COPY_AND_ASSIGN ( ArraySet )

Additional Inherited Members

-  Static Public Member Functions inherited from Collection< ArraySet< T, true, DefaultCompare, BaseArraySelector<> >, T, Protected< ArrayMap< T, UnitType, true, DefaultCompare, BaseArraySelector<> > > >
static const T &  GetMapKey (const T &key)
-  Public Attributes inherited from Collection< ArraySet< T, true, DefaultCompare, BaseArraySelector<> >, T, Protected< ArrayMap< T, UnitType, true, DefaultCompare, BaseArraySelector<> > > >
  VALUETYPE
-  Static Public Attributes inherited from SetBase0< ArraySet< T, true, DefaultCompare, BaseArraySelector<> >, T, Protected< ArrayMap< T, UnitType, true, DefaultCompare, BaseArraySelector<> > >, DefaultCompare >
static const COLLECTION_KIND   KIND
-  Protected Types inherited from ArrayMap< T, UnitType, true, DefaultCompare, BaseArraySelector<> >
using  IsArrayMap = std::true_type
using  ArrayType = typename ArrayMapHelper < T, UnitType , SORTED, DefaultCompare , BaseArraySelector <> >:: Array
using  Super = MapBase < ArrayMap < T, UnitType , SORTED, DefaultCompare , BaseArraySelector <> >, T, UnitType , ArrayType , DefaultCompare >
using  Entry = Pair < T, UnitType >
using  IteratorBase = AutoIterator < const ArrayType >
using  Iterator = IteratorTemplate< false, EntryIteratorBase >
using  ConstIterator = IteratorTemplate< true, EntryIteratorBase >
using  KeyIterator = IteratorTemplate< false, KeyIteratorBase >
using  ConstKeyIterator = IteratorTemplate< true, KeyIteratorBase >
using  ValueIterator = IteratorTemplate< false, ValueIteratorBase >
using  ConstValueIterator = IteratorTemplate< true, ValueIteratorBase >
-  Protected Types inherited from MapBase0< ArrayMap< T, UnitType, SORTED, DefaultCompare, BaseArraySelector<> >, T, UnitType, ArrayMapHelper< T, UnitType, SORTED, DefaultCompare, BaseArraySelector<> >::Array, DefaultCompare >
using  MapType = ArrayMap < T, UnitType , SORTED, DefaultCompare , BaseArraySelector <> >
using  Super = BaseCollection < ArrayMap < T, UnitType , SORTED, DefaultCompare , BaseArraySelector <> >, ArrayMapHelper < T, UnitType , SORTED, DefaultCompare , BaseArraySelector <> >:: Array >
using  KeyType = T
using  ValueType = UnitType
-  Protected Types inherited from BaseCollection< ArrayMap< T, UnitType, SORTED, DefaultCompare, BaseArraySelector<> >, ArrayMapHelper< T, UnitType, SORTED, DefaultCompare, BaseArraySelector<> >::Array >
using  IsCollection = std::true_type
-  Protected Member Functions inherited from ArrayMap< T, UnitType, true, DefaultCompare, BaseArraySelector<> >
Iterator   Begin ()
ConstIterator   Begin () const
Iterator   End ()
ConstIterator   End () const
KeyIterator   GetKeys ()
ConstKeyIterator   GetKeys () const
ValueIterator   GetValues ()
ConstValueIterator   GetValues () const
  ArrayMap ()
  ArrayMap ( ArrayMap &&src)
  MAXON_OPERATOR_MOVE_ASSIGNMENT ( ArrayMap )
SFINAEHelper < Bool , typename MAP::IsArrayMap, typename MAP::IsSorted, typename std::enable_if< STD_IS_REPLACEMENT (same, typename std::decay< CMP >::type, DefaultCompare )>::type >::type  IsEqualImpl (const MAP &b, CMP &&cmp, OverloadRank1 ) const
Int   GetOperationCountForSearch () const
ResultRef < UnitType InsertKey (const T &key, Bool &created= BoolLValue ())
ResultRef < UnitType InsertKey (T &&key, Bool &created= BoolLValue ())
ResultMemT < Iterator InsertEntry (const T &key, Bool &created= BoolLValue ())
ResultMemT < Iterator InsertEntry (T &&key, Bool &created= BoolLValue ())
ResultMemT < Iterator Insert (const T &key, const UnitType &value, Bool &created= BoolLValue ())
ResultMemT < Iterator Insert (T &&key, const UnitType &value, Bool &created= BoolLValue ())
ResultMemT < Iterator Insert (const T &key, UnitType &&value, Bool &created= BoolLValue ())
ResultMemT < Iterator Insert (T &&key, UnitType &&value, Bool &created= BoolLValue ())
const UnitType FindValue (const KEY &key) const
UnitType FindValue (const KEY &key)
Iterator   Find (const T &key)
ConstIterator   Find (const T &key) const
Iterator   FindFloor (const T &key)
ConstIterator   FindFloor (const T &key) const
Iterator   FindCeiling (const T &key)
ConstIterator   FindCeiling (const T &key) const
ResultOk < Bool Erase (const T &key)
IteratorTemplate< false, SUPER >  Erase (const IteratorTemplate< false, SUPER > &position, Int eraseCnt=1)
const ArrayType GetUnderlyingArray () const
ArrayType GetUnderlyingArray ()
-  Protected Member Functions inherited from MapBase< ArrayMap< T, UnitType, SORTED, DefaultCompare, BaseArraySelector<> >, T, UnitType, ArrayMapHelper< T, UnitType, SORTED, DefaultCompare, BaseArraySelector<> >::Array, DefaultCompare >
MAXON_ATTRIBUTE_FORCE_INLINE   MapBase (ARGS &&... args)
MapImpl < ArrayMap < T, UnitType , SORTED, DefaultCompare , BaseArraySelector <> > & >  ToMap ()
MapImpl < const ArrayMap < T, UnitType , SORTED, DefaultCompare , BaseArraySelector <> > & >  ToMap () const
MAXON_ATTRIBUTE_FORCE_INLINE   operator MapImpl< ArrayMap< T, UnitType, SORTED, DefaultCompare, BaseArraySelector<> > & > ()
MAXON_ATTRIBUTE_FORCE_INLINE   operator MapImpl< const ArrayMap< T, UnitType, SORTED, DefaultCompare, BaseArraySelector<> > & > () const
-  Protected Member Functions inherited from MapBase0< ArrayMap< T, UnitType, SORTED, DefaultCompare, BaseArraySelector<> >, T, UnitType, ArrayMapHelper< T, UnitType, SORTED, DefaultCompare, BaseArraySelector<> >::Array, DefaultCompare >
MAXON_ATTRIBUTE_FORCE_INLINE   MapBase0 (ARGS &&... args)
MAXON_ATTRIBUTE_FORCE_INLINE Bool   Contains (typename ByValueParam < T >::type key) const
MAXON_ATTRIBUTE_FORCE_INLINE SFINAEHelper < Bool , typename PAIR::KeyType >::type  Contains (const PAIR &pair) const
ResultRef < UnitType Append (const T &key)
SFINAEHelper < ResultRef < UnitType >, typename PAIR::KeyType >::type  Append (const PAIR &pair)
Result < void >  添加 (COLLECTION2 &&other, COLLECTION_RESIZE_FLAGS resizeFlags= COLLECTION_RESIZE_FLAGS::ON_GROW_RESERVE_CAPACITY )
Result < void >  AppendAll (COLLECTION2 &&other, COLLECTION_RESIZE_FLAGS resizeFlags= COLLECTION_RESIZE_FLAGS::ON_GROW_RESERVE_CAPACITY )
Result < void >  AppendAllInverse (COLLECTION2 &&other)
Bool   ContainsAllImpl (COLLECTION2 &&other, OverloadRank0 ) const
Result < void >  SubtractImpl (COLLECTION2 &&other, OverloadRank0 )
Bool   IsEqualImpl (const COLLECTION2 &other, COMPARE &&cmp, OverloadRank0 ) const
HashInt   GetHashCode () const
-  Protected Member Functions inherited from BaseCollection< ArrayMap< T, UnitType, SORTED, DefaultCompare, BaseArraySelector<> >, ArrayMapHelper< T, UnitType, SORTED, DefaultCompare, BaseArraySelector<> >::Array >
MAXON_ATTRIBUTE_FORCE_INLINE   BaseCollection (ARGS &&... args)
MAXON_ATTRIBUTE_FORCE_INLINE std::enable_if< maxon::IsCollection< COLLECTION2 >::value, Bool >::type  operator== (const COLLECTION2 &other) const
MAXON_ATTRIBUTE_FORCE_INLINE std::enable_if< maxon::IsCollection< COLLECTION2 >::value, Bool >::type  operator!= (const COLLECTION2 &other) const
MAXON_ATTRIBUTE_FORCE_INLINE std::enable_if< maxon::IsCollection< COLLECTION2 >::value &&! STD_IS_REPLACEMENT (same, typename std::decay< COMPARE >::type, EQUALITY ), Bool >::type  IsEqual (const COLLECTION2 &other, COMPARE &&cmp=COMPARE()) const
MAXON_ATTRIBUTE_FORCE_INLINE Result < void >  AppendAll (COLLECTION2 &&other, COLLECTION_RESIZE_FLAGS resizeFlags= COLLECTION_RESIZE_FLAGS::ON_GROW_RESERVE_CAPACITY )
MAXON_ATTRIBUTE_FORCE_INLINE Result < void >  CopyFrom (COLLECTION2 &&other, COLLECTION_RESIZE_FLAGS resizeFlags= COLLECTION_RESIZE_FLAGS::FIT_TO_SIZE )
MAXON_ATTRIBUTE_FORCE_INLINE Result < void >  Subtract (COLLECTION2 &&other)
MAXON_ATTRIBUTE_FORCE_INLINE Result < void >  Intersect (const COLLECTION2 &other)
Bool   Intersects (const COLLECTION2 &other) const
MAXON_ATTRIBUTE_FORCE_INLINE Result < void >  CopyFromImpl (COLLECTION2 &&other, COLLECTION_RESIZE_FLAGS resizeFlags, OverloadRank0 )
Result < void >  AppendAllImpl (COLLECTION2 &&other, COLLECTION_RESIZE_FLAGS resizeFlags, Bool overwrite, OverloadRank0 )
Result < void >  IntersectImpl (COLLECTION2 &&other, OverloadRank0 )
MAXON_ATTRIBUTE_FORCE_INLINE Bool   IsEmpty () const
MAXON_ATTRIBUTE_FORCE_INLINE Bool   IsPopulated () const
String   ToString (const FormatStatement *formatStatement=nullptr) const
MAXON_ATTRIBUTE_FORCE_INLINE Bool   ContainsAll (COLLECTION2 &&other) const
Bool   ContainsAllImpl (COLLECTION2 &&other, OverloadRank0 ) const
-  Static Protected Member Functions inherited from ArrayMap< T, UnitType, true, DefaultCompare, BaseArraySelector<> >
static const Entry GetEntry (const UnitType *value)
static Entry GetEntry (typename std::remove_const< UnitType >::type *value)
-  Static Protected Member Functions inherited from MapBase0< ArrayMap< T, UnitType, SORTED, DefaultCompare, BaseArraySelector<> >, T, UnitType, ArrayMapHelper< T, UnitType, SORTED, DefaultCompare, BaseArraySelector<> >::Array, DefaultCompare >
static const T &  GetMapKey (const T &key)
static const T &  GetMapKey (const PAIR &pair)
-  Static Protected Attributes inherited from MapBase0< ArrayMap< T, UnitType, SORTED, DefaultCompare, BaseArraySelector<> >, T, UnitType, ArrayMapHelper< T, UnitType, SORTED, DefaultCompare, BaseArraySelector<> >::Array, DefaultCompare >
static const COLLECTION_KIND   KIND

Member Typedef Documentation

◆  MapType

using MapType = ArrayMap <T, UnitType , SORTED, COMPARE, ARRAY>

◆  Super

using Super = SetBase < ArraySet <T, SORTED, COMPARE, ARRAY>, T, Protected < MapType >, COMPARE>
private

◆  IsArrayMap

using IsArrayMap = std::true_type

◆  IsArraySet

using IsArraySet = std::true_type

◆  Iterator

using Iterator = typename Super::KeyIterator

◆  ConstIterator

using ConstIterator = typename Super::ConstKeyIterator

构造函数 & 析构函数文档编制

◆  ArraySet() [1/2]

ArraySet ( )

◆  ArraySet() [2/2]

ArraySet ( ArraySet < T, SORTED, COMPARE, ARRAY > &&  src )

成员函数文档编制

◆  MAXON_DISALLOW_COPY_AND_ASSIGN()

MAXON_DISALLOW_COPY_AND_ASSIGN ( ArraySet < T, SORTED, COMPARE, ARRAY >  )
private

◆  MAXON_OPERATOR_MOVE_ASSIGNMENT()

MAXON_OPERATOR_MOVE_ASSIGNMENT ( ArraySet < T, SORTED, COMPARE, ARRAY >  )

◆  GetMap() [1/2]

MapType & GetMap ( )

◆  GetMap() [2/2]

const MapType & GetMap ( ) const

◆  Contains()

Bool Contains ( typename ByValueParam < T >:: type   value ) const

Checks if this set contains value .

参数
[in] value The value to check.
返回
True if this set contains value .

◆  Insert() [1/2]

ResultMemT < Iterator > Insert ( const T &  value ,
Bool added = BoolLValue()  
)

Adds value to this set. If value is already contained in this set, nothing happens, and added 被设为 false .

参数
[in] value Value to add to this set.
[out] added This will be set to true if the element didn't exist before in the set and it could be added successfully, otherwise it will be set to false.
返回
Iterator to the entry for the given key or OutOfMemoryError if the allocation failed.

◆  Insert() [2/2]

ResultMemT < Iterator > Insert ( T &&  value ,
Bool added = BoolLValue()  
)

Adds value to this set. If value is already contained in this set, nothing happens, and added 被设为 false .

参数
[in] value Value to add to this set. When a new element has to be added, value will be moved into the new element.
[out] added This will be set to true if the element didn't exist before in the set and it could be added successfully, otherwise it will be set to false.
返回
Iterator to the entry for the given key or OutOfMemoryError if the allocation failed.

◆  InsertKey() [1/2]

ResultRef <const T> InsertKey ( const T &  value ,
Bool added = BoolLValue()  
)

Adds value to this set. If value is already contained in this set, nothing happens, and added 被设为 false .

参数
[in] value Value to add to this set.
[out] added This will be set to true if the element didn't exist before in the set and it could be added successfully, otherwise it will be set to false.
返回
Pointer to the value in the set, or nullptr if the element had to be added, but the allocation failed.

◆  InsertKey() [2/2]

ResultRef <const T> InsertKey ( T &&  value ,
Bool added = BoolLValue()  
)

Adds value to this set. If value is already contained in this set, nothing happens, and added 被设为 false .

参数
[in] value Value to add to this set. When a new element has to be added, value will be moved into the new element.
[out] added This will be set to true if the element didn't exist before in the set and it could be added successfully, otherwise it will be set to false.
返回
Pointer to the value in the set, or nullptr if the element had to be added, but the allocation failed.

◆  Erase() [1/2]

ResultOk < Bool > Erase ( const T &  value )

移除 value from this set. If value isn't contained in this set, nothing happens.

参数
[in] value Value to remove from this set.
返回
True if an entry was found and removed for #value, otherwise false.

◆  Begin() [1/2]

ConstIterator Begin ( ) const

◆  End() [1/2]

ConstIterator End ( ) const

◆  Begin() [2/2]

Iterator Begin ( )

◆  End() [2/2]

Iterator End ( )

◆  Erase() [2/2]

Iterator Erase ( const Iterator it )

◆  GetUnderlyingArray() [1/2]

const ARRAY::template Type<T>& GetUnderlyingArray ( ) const

◆  GetUnderlyingArray() [2/2]

ARRAY::template Type<T>& GetUnderlyingArray ( )

◆  Find() [1/2]

Iterator Find

Finds the entry for the given key in this map.

参数
[in] key Key to search for.
返回
Iterator pointing to the entry with the given key , or an invalid iterator if this doesn't exist.

◆  Find() [2/2]

ConstIterator Find

Finds the entry for the given key in this map.

参数
[in] key Key to search for.
返回
Iterator pointing to the entry with the given key , or an invalid iterator if this doesn't exist.

◆  FindFloor() [1/2]

Iterator FindFloor

Finds the entry with the greatest key less than or equal to the given key . If no such entry exists, the returned iterator will be invalid (its operator Bool will return false). This function is only supported by sorted array maps.

参数
[in] key Key to search for.
返回
Iterator pointing to the entry with greatest key less than or equal to the given key , or an invalid iterator if this doesn't exist.

◆  FindFloor() [2/2]

ConstIterator FindFloor

Finds the entry with the greatest key less than or equal to the given key . If no such entry exists, the returned iterator will be invalid (its operator Bool will return false). This function is only supported by sorted array maps.

参数
[in] key Key to search for.
返回
Iterator pointing to the entry with greatest key less than or equal to the given key , or an invalid iterator if this doesn't exist.

◆  FindCeiling() [1/2]

Iterator FindCeiling

Finds the entry with the smallest key greater than or equal to the given key . If no such entry exists, the returned iterator will be invalid (its operator Bool will return false). This function is only supported by sorted array maps.

参数
[in] key Key to search for.
返回
Iterator pointing to the entry with smallest key greater than or equal to the given key , or an invalid iterator if this doesn't exist.

◆  FindCeiling() [2/2]

ConstIterator FindCeiling

Finds the entry with the smallest key greater than or equal to the given key . If no such entry exists, the returned iterator will be invalid (its operator Bool will return false). This function is only supported by sorted array maps.

参数
[in] key Key to search for.
返回
Iterator pointing to the entry with smallest key greater than or equal to the given key , or an invalid iterator if this doesn't exist.

◆  GetOperationCountForSearch()

Int GetOperationCountForSearch

Returns an estimate of the number of operations needed to locate a given key in this map. This is used when two collections are compared: The iteration goes over the collection which would require more operations for search, and each entry is searched in the other collection.

返回
Estimate for the number of operations.