Evo C++ Library v0.5.1
Public Types | Public Member Functions | Public Attributes | List of all members
SubList< T, TSize > Struct Template Reference

#include <evo/sublist.h>

Inheritance diagram for SubList< T, TSize >:
Inheritance graph
[legend]

Detailed Description

template<class T, class TSize = SizeT>
struct evo::SubList< T, TSize >

Reference and access existing list data.

Template Parameters
TItem type to use
TSizeSize type to use for size/index values (must be unsigned integer) – default: SizeT
Features

C++11:

Iterators
Constructors
Read Access
Modifiers
Example
#include <evo/sublist.h>
#include <evo/io.h>
using namespace evo;
static Console& c = con();
int main() {
// Create number sublist from NULL-terminated constant
const int LIST_ITEMS[] = { 1, 2, 3, (int)NULL };
SubList<int> list(LIST_ITEMS, vNULL);
// operator[]() provides read-only (const) access
int value = list[0];
//list[0] = 0; // Error: operator[]() is read-only
// Iterate and print items (read-only)
for (SubList<int>::Iter iter(list); iter; ++iter)
c.out << "Item: " << *iter << NL;
return 0;
}

Output:

Item: 1
Item: 2
Item: 3

Public Types

typedef void EvoContainerType
 Identify Evo container type. More...
 
typedef T Item
 Item type (same as Value) More...
 
typedef DataCopy< T >::PassType ItemVal
 Item type as parameter (POD types passed by value, otherwise by const-ref) More...
 
typedef IteratorRa< ThisType >::Const Iter
 Iterator (const) - IteratorRa. More...
 
typedef Size Key
 Key type (item index) More...
 
typedef ListBase< T, SizeListBaseType
 List base type for any Evo list More...
 
typedef TSize Size
 List size integer type. More...
 
typedef SubList< T, SizeSubListType
 SubList base type More...
 
typedef SubList< T, SizeThisType
 This list type. More...
 
typedef T Value
 Value type (same as Item) More...
 

Public Member Functions

 SubList ()
 Default constructor sets as null. More...
 
 SubList (const ThisType &data)
 Copy constructor to reference source data. More...
 
 SubList (const ListBaseType &data)
 Copy constructor to reference source data. More...
 
 SubList (const ListBaseType &data, Key index, Size size=ALL)
 Copy constructor to reference source data. More...
 
 SubList (const ListBaseType *data)
 Copy constructor to reference source data from pointer. More...
 
 SubList (const Item *data, Size size)
 Constructor to reference data pointer. More...
 
 SubList (const Item *data, ValNull v, ItemVal term=0)
 Constructor to reference terminated data pointer. More...
 
 SubList (ThisType &&src)
 Move constructor (C++11). More...
 
const ThisTypeasconst () const
 Explicitly use a const reference to this. More...
 
Iter begin () const
 Get iterator at first item (const). More...
 
Iter cbegin () const
 Get iterator at first item (const). More...
 
Iter cend () const
 Get iterator at end (const). More...
 
ThisTypeclear ()
 Clear by removing all items. More...
 
int compare (const ListBaseType &data) const
 Comparison. More...
 
bool contains (ItemVal item) const
 Check whether contains given item. More...
 
bool contains (const Item *data, Size size) const
 Check if contains given data. More...
 
bool contains (const ListBaseType &data) const
 Check if contains given data. More...
 
const Itemdata () const
 Get data pointer. More...
 
bool empty () const
 Get whether empty. More...
 
Iter end () const
 Get iterator at end (const). More...
 
bool ends (ItemVal item) const
 Check if this ends with given item. More...
 
bool ends (const Item *items, Size size) const
 Check if this ends with given items. More...
 
bool ends (const ListBaseType &items) const
 Check if this ends with given items. More...
 
Key find (ItemVal item, Key start=0, Key end=END) const
 Find first occurrence of item with forward search. More...
 
Key findany (const Item *items, Size count, Key start=0, Key end=END) const
 Find first occurrence of any given items with forward search. More...
 
Key findanyr (const Item *items, Size count, Key start=0, Key end=END) const
 Find last occurrence of any given items with reverse search. More...
 
Key findr (ItemVal item, Key start=0, Key end=END) const
 Find last occurrence of item with reverse search. More...
 
const Itemfirst () const
 Get first item (const). More...
 
ulong hash (ulong seed=0) const
 Get data hash value. More...
 
Key iend (Size offset=0) const
 Get index from last item using offset. More...
 
const Itemitem (Key index) const
 Get item at position. More...
 
const Itemlast () const
 Get last item (const). More...
 
bool null () const
 Get whether null. More...
 
bool operator!= (const ListBaseType &data) const
 Inequality operator. More...
 
ThisTypeoperator= (ThisType &&src)
 Move assignment operator (C++11). More...
 
ThisTypeoperator= (const ThisType &src)
 Assignment operator. More...
 
ThisTypeoperator= (const ValNull &val)
 Assignment operator sets as null. More...
 
ThisTypeoperator= (const ValEmpty &val)
 Assignment operator sets as null. More...
 
ThisTypeoperator= (const ListBaseType &data)
 Assignment operator sets as reference to source data. More...
 
ThisTypeoperator= (const ListBaseType *data)
 Assignment operator sets as reference to source data from pointer. More...
 
bool operator== (const ListBaseType &data) const
 Equality operator. More...
 
const Itemoperator[] (Key index) const
 Get item at position. More...
 
ThisTypeset ()
 Set as null. More...
 
ThisTypeset (const ListBaseType &data)
 Set as reference to source data. More...
 
ThisTypeset (const ListBaseType &data, Key index, Key size=ALL)
 Set as reference to source data. More...
 
ThisTypeset (const ListBaseType *data)
 Set as reference to source data by pointer. More...
 
ThisTypeset (const Item *data, Size size)
 Set as reference to data pointer. More...
 
ThisTypeset2 (const ListBaseType &data, Key index1, Key index2)
 Set as reference to subset of source data using start/end positions. More...
 
ThisTypesetempty ()
 Set as empty but not null. More...
 
bool shared () const
 Get whether shared (false). More...
 
Size size () const
 Get size. More...
 
ThisTypeslice (Key index)
 Slice beginning items. More...
 
ThisTypeslice (Key index, Size size)
 Slice to given subset. More...
 
ThisTypeslice2 (Key index1, Key index2)
 Slice to given subset using start/end positions. More...
 
template<class T1 , class T2 >
bool splitat (Key index, T1 &left, T2 &right) const
 Split into left/right sublists at index. More...
 
template<class T1 >
bool splitat (Key index, T1 &left) const
 Split into left sublist at index. More...
 
template<class T2 >
bool splitat (Key index, ValNull left, T2 &right) const
 Split into right sublist at index. More...
 
bool splitat_setl (Key index)
 Split at index and set as left sublist. More...
 
template<class T2 >
bool splitat_setl (Key index, T2 &right)
 Split at index, set as left sublist, and save right sublist. More...
 
bool splitat_setr (Key index)
 Split at index and set as right sublist. More...
 
template<class T1 >
bool splitat_setr (Key index, T1 &left)
 Split at index, set as right sublist, and save left sublist. More...
 
bool starts (ItemVal item) const
 Check if this starts with given item. More...
 
bool starts (const Item *items, Size size) const
 Check if starts with given items. More...
 
bool starts (const ListBaseType &items) const
 Check if this starts with given items. More...
 
void swap (ThisType &list)
 Swap with another sublist. More...
 
ThisTypetriml (Size size)
 Trim left (beginning) items. More...
 
ThisTypetrimr (Size size)
 Trim right (ending) items. More...
 
ThisTypetruncate (Size size)
 Truncate to given size. More...
 
ThisTypeunshare ()
 Make data unique – no-op. More...
 

Public Attributes

T * data_
 Data pointer, NULL if null. More...
 
TSize size_
 Data size as item count, 0 if empty or null. More...
 

Member Typedef Documentation

◆ EvoContainerType

typedef void EvoContainerType

Identify Evo container type.

◆ Item

typedef T Item

Item type (same as Value)

◆ ItemVal

typedef DataCopy<T>::PassType ItemVal

Item type as parameter (POD types passed by value, otherwise by const-ref)

◆ Iter

typedef IteratorRa<ThisType>::Const Iter

Iterator (const) - IteratorRa.

◆ Key

typedef Size Key

Key type (item index)

◆ ListBaseType

List base type for any Evo list

◆ Size

typedef TSize Size

List size integer type.

◆ SubListType

typedef SubList<T,Size> SubListType

SubList base type

◆ ThisType

typedef SubList<T,Size> ThisType

This list type.

◆ Value

typedef T Value

Value type (same as Item)

Constructor & Destructor Documentation

◆ SubList() [1/8]

SubList ( )
inline

Default constructor sets as null.

◆ SubList() [2/8]

SubList ( const ThisType data)
inline

Copy constructor to reference source data.

  • This will reference the same pointer as given data
  • Caution: Source data pointer must remain valid
Parameters
dataData to reference

◆ SubList() [3/8]

SubList ( const ListBaseType data)
inline

Copy constructor to reference source data.

  • This will reference the same pointer as given data
  • Caution: Source data pointer must remain valid
Parameters
dataData to reference

◆ SubList() [4/8]

SubList ( const ListBaseType data,
Key  index,
Size  size = ALL 
)
inline

Copy constructor to reference source data.

  • This will reference the same pointer as given data
  • Caution: Source data pointer must remain valid
Parameters
dataData to reference
indexStart index of data to reference, END to set as empty
sizeSize as item count, ALL for all from index

◆ SubList() [5/8]

SubList ( const ListBaseType data)
inline

Copy constructor to reference source data from pointer.

  • This will reference the same pointer as given data pointer (data->data_), if not NULL
  • Caution: Source data pointer (data->data_) must remain valid
Parameters
dataData pointer to reference, calls set() if NULL

◆ SubList() [6/8]

SubList ( const Item data,
Size  size 
)
inline

Constructor to reference data pointer.

Parameters
dataData to reference
sizeData size as item count

◆ SubList() [7/8]

SubList ( const Item data,
ValNull  v,
ItemVal  term = 0 
)
inline

Constructor to reference terminated data pointer.

  • Useful for referencing immutable lists
    Example:
    // Size is automatically determined by finding the terminator (NULL)
    static const int LIST_ITEMS[] = {1, 2, 3, 4, (int)NULL};
    static const SubList<int> LIST(LIST_ITEMS, vNULL);
  • Caution: A terminator must be present
Parameters
dataData to reference
vvNULL to indicate data is terminated
termTerminator to use (defaults to NULL)

◆ SubList() [8/8]

SubList ( ThisType &&  src)
inline

Move constructor (C++11).

Parameters
srcSource to move

Member Function Documentation

◆ asconst()

const ThisType& asconst ( ) const
inline

Explicitly use a const reference to this.

  • This is useful to force using this as const without casting
Returns
This

◆ begin()

Iter begin ( ) const
inline

Get iterator at first item (const).

  • This allows compatibility with range-based for loops and other libraries, otherwise use container Iter directly
Returns
Iterator at first item, or at end position if empty
See also
end(), cbegin()

◆ cbegin()

Iter cbegin ( ) const
inline

Get iterator at first item (const).

  • This allows compatibility with range-based for loops and other libraries, otherwise use container Iter directly
Returns
Iterator at first item, or at end position if empty
See also
Iter, cend(), begin(), end()

◆ cend()

Iter cend ( ) const
inline

Get iterator at end (const).

  • This allows compatibility with range-based for loops and other libraries, otherwise use container Iter directly
  • This really just creates an empty iterator
Returns
Iterator at end position
See also
Iter, cbegin(), begin(), end()

◆ clear()

ThisType& clear ( )
inline

Clear by removing all items.

  • Does not set as null – null status is unchanged
Returns
This

◆ compare()

int compare ( const ListBaseType data) const
inline

Comparison.

Parameters
dataData to compare to
Returns
Result (<0 if this is less, 0 if equal, >0 if this is greater)

◆ contains() [1/3]

bool contains ( ItemVal  item) const
inline

Check whether contains given item.

  • This does a simple linear search for given item, using item operator==() for comparisons
Parameters
itemItem to check for
Returns
Whether item was found

◆ contains() [2/3]

bool contains ( const Item data,
Size  size 
) const
inline

Check if contains given data.

  • This does a simple linear search for given array of items, using item operator==() for comparisons
Parameters
dataData to check for
sizeSize as item count to check for
Returns
Whether data was found

◆ contains() [3/3]

bool contains ( const ListBaseType data) const
inline

Check if contains given data.

  • This does a simple linear search for given array of items, using item operator==() for comparisons
Parameters
dataData to check for
Returns
Whether data was found

◆ data()

const Item* data ( ) const
inline

Get data pointer.

  • Caution: May return an invalid non-NULL pointer if empty
Returns
Data pointer as read-only, NULL if null, may be invalid if empty (const)

◆ empty()

bool empty ( ) const
inline

Get whether empty.

Returns
Whether empty

◆ end()

Iter end ( ) const
inline

Get iterator at end (const).

  • This allows compatibility with range-based for loops and other libraries, otherwise use container Iter directly
  • This really just creates an empty iterator
Returns
Iterator at end position
See also
begin(), cend()

◆ ends() [1/3]

bool ends ( ItemVal  item) const
inline

Check if this ends with given item.

  • Uses item operator==() for comparisons
Parameters
itemItem to check
Returns
Whether ends with item

◆ ends() [2/3]

bool ends ( const Item items,
Size  size 
) const
inline

Check if this ends with given items.

  • Uses item operator==() for comparisons
Parameters
itemsItems to check
sizeItem count to check
Returns
Whether ends with items

◆ ends() [3/3]

bool ends ( const ListBaseType items) const
inline

Check if this ends with given items.

  • Uses item operator==() for comparisons
Parameters
itemsItems to check
Returns
Whether ends with items

◆ find()

Key find ( ItemVal  item,
Key  start = 0,
Key  end = END 
) const
inline

Find first occurrence of item with forward search.

  • This searches for given item, using item operator==() for comparisons
  • Search stops before reaching end index or end of list
  • Item at end index is not checked
Parameters
itemItem to find
startStarting index for search
endEnd index for search, END for end of list
Returns
Found item index or NONE if not found

◆ findany()

Key findany ( const Item items,
Size  count,
Key  start = 0,
Key  end = END 
) const
inline

Find first occurrence of any given items with forward search.

  • This searches for any of given items, using item operator==() for comparisons
  • Search stops before reaching end index or end of list
Parameters
itemsItems to search for
countCount of items to search for
startStarting index for search
endEnd index for search, END for end of list
Returns
Found item index or NONE if not found

◆ findanyr()

Key findanyr ( const Item items,
Size  count,
Key  start = 0,
Key  end = END 
) const
inline

Find last occurrence of any given items with reverse search.

  • This searches for any of given items, using item operator==() for comparisons
  • Same as findany() but does reverse search starting right before end index or at last item if end of list
  • As with findany(), item at end index is not checked
Parameters
itemsItems to search for
countCount of items to search for
startStarting index for search range – last item checked in reverse search
endEnd index for search range (reverse search starting point), END for end of list
Returns
Found item index or NONE if not found

◆ findr()

Key findr ( ItemVal  item,
Key  start = 0,
Key  end = END 
) const
inline

Find last occurrence of item with reverse search.

  • This searches for given item, using item operator==() for comparisons
  • This does a reverse search starting right before end index
  • Item at end index is not checked
Parameters
itemItem to find
startStarting index for search range – last item checked in reverse search
endEnd index for search range (reverse search starting point), END for end of list
Returns
Found item index or NONE if not found

◆ first()

const Item* first ( ) const
inline

Get first item (const).

Returns
First item pointer, NULL if empty

◆ hash()

ulong hash ( ulong  seed = 0) const
inline

Get data hash value.

Parameters
seedSeed value for hashing multiple values, 0 if none
Returns
Hash value

◆ iend()

Key iend ( Size  offset = 0) const
inline

Get index from last item using offset.

  • This simplifies math when computing an index from last item
  • This uses the formula: iend = size - 1 - offset
Parameters
offsetOffset from end, 0 for last item, 1 for second-last, etc
Returns
Resulting index, END if offset out of bounds

◆ item()

const Item& item ( Key  index) const
inline

Get item at position.

  • Caution: Results are undefined if index is out of bounds – though index is checked with assert()
Parameters
indexItem index
Returns
Given item as read-only (const)

◆ last()

const Item* last ( ) const
inline

Get last item (const).

Returns
Last item pointer, NULL if empty

◆ null()

bool null ( ) const
inline

Get whether null.

  • Always empty when null
Returns
Whether null

◆ operator!=()

bool operator!= ( const ListBaseType data) const
inline

Inequality operator.

Parameters
dataData to compare to
Returns
Whether inequal

◆ operator=() [1/6]

ThisType& operator= ( ThisType &&  src)
inline

Move assignment operator (C++11).

Parameters
srcSource to move
Returns
This

◆ operator=() [2/6]

ThisType& operator= ( const ThisType src)
inline

Assignment operator.

Parameters
srcSource to copy
Returns
This

◆ operator=() [3/6]

ThisType& operator= ( const ValNull val)
inline

Assignment operator sets as null.

Parameters
valvNULL
Returns
This

◆ operator=() [4/6]

ThisType& operator= ( const ValEmpty val)
inline

Assignment operator sets as null.

Parameters
valvEMPTY
Returns
This

◆ operator=() [5/6]

ThisType& operator= ( const ListBaseType data)
inline

Assignment operator sets as reference to source data.

  • This will reference the same pointer as given data
  • Caution: Source data pointer must remain valid
Parameters
dataData to reference
Returns
This

◆ operator=() [6/6]

ThisType& operator= ( const ListBaseType data)
inline

Assignment operator sets as reference to source data from pointer.

  • This will reference the same pointer as given data pointer, if not NULL
  • Caution: Source data pointer (data->data_) must remain valid
Parameters
dataData pointer to reference, calls set() if NULL
Returns
This

◆ operator==()

bool operator== ( const ListBaseType data) const
inline

Equality operator.

Parameters
dataData to compare to
Returns
Whether equal

◆ operator[]()

const Item& operator[] ( Key  index) const
inline

Get item at position.

  • Caution: Results are undefined if index is out of bounds – though index is checked with assert()
Parameters
indexItem index
Returns
Given item as read-only (const)

◆ set() [1/5]

ThisType& set ( )
inline

Set as null.

Returns
This

◆ set() [2/5]

ThisType& set ( const ListBaseType data)
inline

Set as reference to source data.

  • This will reference the same pointer as given data
  • Caution: Source data pointer must remain valid
Parameters
dataData to reference
Returns
This

◆ set() [3/5]

ThisType& set ( const ListBaseType data,
Key  index,
Key  size = ALL 
)
inline

Set as reference to source data.

  • This will reference the same pointer as given data
  • Caution: Source data pointer must remain valid
Parameters
dataData to reference
indexStart index of data to reference, END to set as empty
sizeSize as item count, ALL for all from index
Returns
This

◆ set() [4/5]

ThisType& set ( const ListBaseType data)
inline

Set as reference to source data by pointer.

  • This will reference the same pointer as given data
  • Caution: Source data pointer must remain valid
Parameters
dataPointer to data to reference, null if NULL
Returns
This

◆ set() [5/5]

ThisType& set ( const Item data,
Size  size 
)
inline

Set as reference to data pointer.

Parameters
dataData to reference
sizeData size as item count

◆ set2()

ThisType& set2 ( const ListBaseType data,
Key  index1,
Key  index2 
)
inline

Set as reference to subset of source data using start/end positions.

  • This will reference the same pointer as given data
  • If data is null then this will be set to null
  • If index2 <= index1 then this will be set to an empty sublist
  • Caution: Source data pointer must remain valid
Parameters
dataData to reference
index1Start index of data to reference, END to set as empty
index2End index of data (this item not included), END for all after index1
Returns
This

◆ setempty()

ThisType& setempty ( )
inline

Set as empty but not null.

Returns
This

◆ shared()

bool shared ( ) const
inline

Get whether shared (false).

  • This doesn't support sharing or unique states, so this always returns false
  • Referenced data is considered constant and immutable while it's referenced
Returns
Whether shared (always false)

◆ size()

Size size ( ) const
inline

Get size.

Returns
Size as item count

◆ slice() [1/2]

ThisType& slice ( Key  index)
inline

Slice beginning items.

  • This adjusts pointer, trimming beginning items
  • If null then will be left null
Parameters
indexStart index of new slice, END to set as empty (or leave null if null)
Returns
This

◆ slice() [2/2]

ThisType& slice ( Key  index,
Size  size 
)
inline

Slice to given subset.

  • This adjusts pointer to given subset
  • If null then will be left null
Parameters
indexStart index of new slice, END to set as empty (or leave null if null)
sizeSlice size as item count, ALL for all from index
Returns
This

◆ slice2()

ThisType& slice2 ( Key  index1,
Key  index2 
)
inline

Slice to given subset using start/end positions.

  • This adjusts pointer to given subset
  • If index2 < index1 then result will be empty
  • If null then will be left null
Parameters
index1Start index of new slice, END to set as empty (or leave null if null)
index2End index of new slice (this item not included), END for all after index1
Returns
This

◆ splitat() [1/3]

bool splitat ( Key  index,
T1 &  left,
T2 &  right 
) const
inline

Split into left/right sublists at index.

  • Can use methods like find() or findany() for index
  • Template types are automatically deduced from arguments
  • For more advanced parsing see StrTok
Template Parameters
T1List type to store left sublist
T2List type to store right sublist
Parameters
indexIndex to split at, bad index (NONE or out-of-bounds) splits at end
leftSet to sublist before index, set to this if bad index [out]
rightSet to sublist after index, null if bad index [out]
Returns
Whether successful, false if bad index

◆ splitat() [2/3]

bool splitat ( Key  index,
T1 &  left 
) const
inline

Split into left sublist at index.

  • Can use methods like find() or findany() for index
  • Template types are automatically deduced from arguments
  • For more advanced parsing see StrTok
Template Parameters
T1List type to store left sublist
Parameters
indexIndex to split at, bad index (NONE or out-of-bounds) splits at end
leftSet to sublist before index, set to this if bad index [out]
Returns
Whether successful, false if bad index

◆ splitat() [3/3]

bool splitat ( Key  index,
ValNull  left,
T2 &  right 
) const
inline

Split into right sublist at index.

  • Can use methods like find() or findany() for index
  • Template types are automatically deduced from arguments
  • For more advanced parsing see StrTok
Template Parameters
T2List type to store right sublist
Parameters
indexIndex to split at, bad index (NONE or out-of-bounds) splits at end
leftvNULL (ignored)
rightSet to sublist after index, null if bad index [out]
Returns
Whether successful, false if bad index

◆ splitat_setl() [1/2]

bool splitat_setl ( Key  index)
inline

Split at index and set as left sublist.

  • Can use methods like find() or findany() for index
  • Sets this to sublist before index, unchanged if bad index [out]
Parameters
indexIndex to split at, bad index (NONE or out-of-bounds) splits at end (i.e. unchanged)
Returns
Whether successful, false if bad index

◆ splitat_setl() [2/2]

bool splitat_setl ( Key  index,
T2 &  right 
)
inline

Split at index, set as left sublist, and save right sublist.

  • Can use methods like find() or findany() for index
  • Sets this to sublist before index, unchanged if bad index [out]
Parameters
indexIndex to split at, bad index (NONE or out-of-bounds) splits at end (i.e. unchanged)
rightSet to sublist after index, null if bad index [out]
Returns
Whether successful, false if bad index

◆ splitat_setr() [1/2]

bool splitat_setr ( Key  index)
inline

Split at index and set as right sublist.

  • Can use methods like find() or findany() for index
  • Sets this to sublist after index, null if bad index [out]
Parameters
indexIndex to split at, bad index (NONE or out-of-bounds) splits at end
Returns
Whether successful, false if bad index

◆ splitat_setr() [2/2]

bool splitat_setr ( Key  index,
T1 &  left 
)
inline

Split at index, set as right sublist, and save left sublist.

  • Can use methods like find() or findany() for index
  • Sets this to sublist after index, null if bad index [out]
Parameters
indexIndex to split at, bad index (NONE or out-of-bounds) splits at end
leftSet to sublist before index, set to this if bad index [out]
Returns
Whether successful, false if bad index

◆ starts() [1/3]

bool starts ( ItemVal  item) const
inline

Check if this starts with given item.

  • Uses item operator==() for comparisons
Parameters
itemItem to check
Returns
Whether starts with item

◆ starts() [2/3]

bool starts ( const Item items,
Size  size 
) const
inline

Check if starts with given items.

  • Uses item operator==() for comparisons
Parameters
itemsItems to check
sizeSize as item count to check
Returns
Whether starts with items

◆ starts() [3/3]

bool starts ( const ListBaseType items) const
inline

Check if this starts with given items.

  • Uses item operator==() for comparisons
Parameters
itemsItems to check
Returns
Whether starts with items

◆ swap()

void swap ( ThisType list)
inline

Swap with another sublist.

Parameters
listList to swap with

◆ triml()

ThisType& triml ( Size  size)
inline

Trim left (beginning) items.

  • This non-destructively trims beginning items
Parameters
sizeTrim size as item count to remove
Returns
This

◆ trimr()

ThisType& trimr ( Size  size)
inline

Trim right (ending) items.

  • This non-destructively trims ending items
Parameters
sizeTrim size as item count to remove
Returns
This

◆ truncate()

ThisType& truncate ( Size  size)
inline

Truncate to given size.

  • This non-destructively trims ending items
Parameters
sizeSize to truncate to as item count
Returns
This

◆ unshare()

ThisType& unshare ( )
inline

Make data unique – no-op.

  • This doesn't support sharing or unique states, so this is always a no-op
  • Referenced data is considered constant and immutable while it's referenced
Returns
This

Member Data Documentation

◆ data_

T* data_
inherited

Data pointer, NULL if null.

◆ size_

TSize size_
inherited

Data size as item count, 0 if empty or null.


The documentation for this struct was generated from the following file: