CONZEPT 16 C++ API
C16::Array< Element > Class Template Referenceabstract

Array of elements. More...

#include "C16/Array.hpp"

Inheritance diagram for C16::Array< Element >:
C16::ArrayGeneric C16::Series< Element >

Detailed Description

template<typename Element>
class C16::Array< Element >

Array of elements.

Template Parameters
ElementType of the elements of the array
Examples

Iteration

#include "C16/Library.hpp"
using namespace C16;
void array_iterate(const Array<Element>& array)
{
for (const Element& element : array)
{
...
}
}

Classes

class  Iterator
 Iterator for elements of an array. More...
 
class  IteratorConst
 const-Iterator for elements of an array. More...
 

Public Types

using value_type = Element
 Type of the elements of the array. More...
 
using const_reference = const Element &
 Type of a constant reference to an element of the array. More...
 
using reference = Element &
 Type of a reference to an element of the array. More...
 
- Public Types inherited from C16::ArrayGeneric
using size_type = std::size_t
 Type of the size of the array. More...
 

Public Member Functions

const_reference operator[] (size_type index) const
 Gets an element of the array by means of its index. More...
 
reference operator[] (size_type index)
 Gets an element of the array by means of its index. More...
 
const_reference at (size_type index) const
 Gets an element of the array by means of its index. More...
 
reference at (size_type index)
 Gets an element of the array by means of its index. More...
 
const_reference front () const
 Gets the first element of the array. More...
 
reference front ()
 Gets the first element of the array. More...
 
const_reference back () const
 Gets the last element of the array. More...
 
reference back ()
 Gets the last element of the array. More...
 
IteratorConst begin () const noexcept
 Gets a const-iterator of the first element of the array. More...
 
Iterator begin () noexcept
 Gets an iterator of the first element of the array. More...
 
IteratorConst cbegin () const noexcept
 Gets a const-iterator of the first element of the array. More...
 
IteratorConst end () const noexcept
 Gets a const-iterator of the element following the last element of the array. More...
 
Iterator end () noexcept
 Gets an iterator of the element following the last element of the array. More...
 
IteratorConst cend () const noexcept
 Gets a const-iterator of the element following the last element of the array. More...
 
IteratorConst rbegin () const noexcept
 Gets a const-iterator of the last element of the array. More...
 
Iterator rbegin () noexcept
 Gets an iterator of the last element of the array. More...
 
IteratorConst crbegin () const noexcept
 Gets a const-iterator of the last element of the array. More...
 
IteratorConst rend () const noexcept
 Gets a const-iterator of the element preceding the first element of the array. More...
 
Iterator rend () noexcept
 Gets an iterator of the element preceding the first element of the array. More...
 
IteratorConst crend () const noexcept
 Gets a const-iterator of the element preceding the first element of the array. More...
 
- Public Member Functions inherited from C16::ArrayGeneric
virtual size_type size () const =0
 Gets the size of the array. More...
 
virtual bool empty () const
 Gets if the array is empty. More...
 

Member Typedef Documentation

◆ value_type

template<typename Element >
using C16::Array< Element >::value_type = Element

Type of the elements of the array.

◆ const_reference

template<typename Element >
using C16::Array< Element >::const_reference = const Element&

Type of a constant reference to an element of the array.

◆ reference

template<typename Element >
using C16::Array< Element >::reference = Element&

Type of a reference to an element of the array.

Member Function Documentation

◆ operator[]() [1/2]

template<typename Element >
const_reference C16::Array< Element >::operator[] ( size_type  index) const

Gets an element of the array by means of its index.

Parameters
indexIndex of the element of the array (0 to size() - 1)
Returns
Element
Exceptions
Exception::InvalidityIndex invalid.

◆ operator[]() [2/2]

template<typename Element >
reference C16::Array< Element >::operator[] ( size_type  index)

Gets an element of the array by means of its index.

Parameters
indexIndex of the element of the array (0 to size() - 1)
Returns
Element
Exceptions
Exception::InvalidityIndex invalid.

◆ at() [1/2]

template<typename Element >
const_reference C16::Array< Element >::at ( size_type  index) const

Gets an element of the array by means of its index.

Parameters
indexIndex of the element of the array (0 to size() - 1)
Returns
Element
Exceptions
Exception::InvalidityIndex invalid.

◆ at() [2/2]

template<typename Element >
reference C16::Array< Element >::at ( size_type  index)

Gets an element of the array by means of its index.

Parameters
indexIndex of the element of the array (0 to size() - 1)
Returns
Element
Exceptions
Exception::InvalidityIndex invalid.

◆ front() [1/2]

template<typename Element >
const_reference C16::Array< Element >::front ( ) const

Gets the first element of the array.

Exceptions
Exception::InvalidityIndex invalid.

◆ front() [2/2]

template<typename Element >
reference C16::Array< Element >::front ( )

Gets the first element of the array.

Exceptions
Exception::InvalidityIndex invalid.

◆ back() [1/2]

template<typename Element >
const_reference C16::Array< Element >::back ( ) const

Gets the last element of the array.

Exceptions
Exception::InvalidityIndex invalid.

◆ back() [2/2]

template<typename Element >
reference C16::Array< Element >::back ( )

Gets the last element of the array.

Exceptions
Exception::InvalidityIndex invalid.

◆ begin() [1/2]

template<typename Element >
IteratorConst C16::Array< Element >::begin ( ) const
noexcept

Gets a const-iterator of the first element of the array.

◆ begin() [2/2]

template<typename Element >
Iterator C16::Array< Element >::begin ( )
noexcept

Gets an iterator of the first element of the array.

◆ cbegin()

template<typename Element >
IteratorConst C16::Array< Element >::cbegin ( ) const
noexcept

Gets a const-iterator of the first element of the array.

◆ end() [1/2]

template<typename Element >
IteratorConst C16::Array< Element >::end ( ) const
noexcept

Gets a const-iterator of the element following the last element of the array.

◆ end() [2/2]

template<typename Element >
Iterator C16::Array< Element >::end ( )
noexcept

Gets an iterator of the element following the last element of the array.

◆ cend()

template<typename Element >
IteratorConst C16::Array< Element >::cend ( ) const
noexcept

Gets a const-iterator of the element following the last element of the array.

◆ rbegin() [1/2]

template<typename Element >
IteratorConst C16::Array< Element >::rbegin ( ) const
noexcept

Gets a const-iterator of the last element of the array.

◆ rbegin() [2/2]

template<typename Element >
Iterator C16::Array< Element >::rbegin ( )
noexcept

Gets an iterator of the last element of the array.

◆ crbegin()

template<typename Element >
IteratorConst C16::Array< Element >::crbegin ( ) const
noexcept

Gets a const-iterator of the last element of the array.

◆ rend() [1/2]

template<typename Element >
IteratorConst C16::Array< Element >::rend ( ) const
noexcept

Gets a const-iterator of the element preceding the first element of the array.

◆ rend() [2/2]

template<typename Element >
Iterator C16::Array< Element >::rend ( )
noexcept

Gets an iterator of the element preceding the first element of the array.

◆ crend()

template<typename Element >
IteratorConst C16::Array< Element >::crend ( ) const
noexcept

Gets a const-iterator of the element preceding the first element of the array.

Library.hpp
CONZEPT 16 C++ API.
C16
Namespace.
Definition: Array.hpp:6
C16::Array
Array of elements.
Definition: Array.hpp:177