44template <
class T, std::
size_t N >
50 std::array < T *, N > m_data;
127 template <
class ... Types >
137 template <
class R = T >
139 if constexpr ( N != 0 )
141 m_data.at (
i ) =
new R ( );
151 if constexpr ( N != 0 )
163 if constexpr ( N != 0 )
165 m_data.at (
i ) = std::exchange ( other.m_data.at (
i ),
nullptr );
173 if constexpr ( N != 0 )
175 delete m_data.at (
i );
185 if (
this == & other )
188 if constexpr ( N != 0 )
190 delete m_data.at (
i );
216 void fill (
const R & value ) {
217 if constexpr ( N != 0 )
231 return * m_data.at ( index );
243 return * m_data.at ( index );
255 return * m_data [ index ];
267 return * m_data [ index ];
277 return * m_data.front ( );
287 return * m_data.front ( );
297 return * m_data.back ( );
307 return * m_data.back ( );
319 return m_data.at ( index ) ==
nullptr;
349 return make_move_iterator ( this->
end ( ) );
388 auto end ( ) &&
noexcept {
389 return make_move_iterator ( this->
end ( ) );
469 auto endIter =
end ( );
470 auto beginIter =
begin ( );
481 auto endIter =
end ( );
482 auto beginIter =
begin ( );
493 auto endIter = std::move ( * this ).end ( );
494 auto beginIter = std::move ( * this ).begin ( );
505 return m_data.empty ( );
515 return m_data.size ( );
525 return m_data.max_size ( );
544 delete std::exchange ( m_data.at ( dist ),
ext::clone ( std::forward < R > ( value ) ) );
565 delete std::exchange ( m_data.at ( m_data.size ( ) - dist - 1 ),
ext::clone ( std::forward < R > ( value ) ) );
582 template <
class R,
class ... Args >
584 return set ( pos, R ( std::forward < Args > ( args ) ... ) );
599 template <
class R,
class ... Args >
601 return set ( pos, R ( std::forward < Args > ( args ) ... ) );
610 swap ( this->m_data, other.m_data );
621 template < std::
size_t I >
623 return * std::get < I > ( m_data );
634 template < std::
size_t I >
635 const auto &
get ( ) const & {
636 return * std::get < I > ( m_data );
647 template < std::
size_t I >
649 return std::move ( * std::get < I > ( m_data ) );
654 return std::lexicographical_compare_three_way ( first.
begin ( ), first.
end ( ),
second.begin ( ),
second.end ( ) );
692template < std::
size_t I,
class Type, std::
size_t N >
694 return tpl.template get < I > ( );
709template < std::
size_t I,
class Type, std::
size_t N >
711 return tpl.template get < I > ( );
726template < std::
size_t I,
class Type, std::
size_t N >
728 return std::move ( tpl ).template get < I > ( );
747template <
class T, std::
size_t N >
753 if(!first) out <<
", ";
774template <
typename Base,
typename ... Types >
787template <
typename Base >
Adaptor iterator to additionally call second dereference on the iterator dereference result.
Definition: iterator.hpp:556
Implementation of iterator_range, i.e. pair of iterators. The class provides most notably begin and e...
Definition: range.hpp:24
Implementation of array storing dynamicaly allocated instances of given type. The class mimicks the i...
Definition: ptr_array.hpp:45
const_iterator cend() const noexcept
Iterator one past the last element of the values range in the array.
Definition: ptr_array.hpp:398
bool empty() const noexcept
Array emptines test.
Definition: ptr_array.hpp:504
reference at(size_type index)
Getter of value on index.
Definition: ptr_array.hpp:230
reference operator[](size_type index)
Array subscript operator.
Definition: ptr_array.hpp:254
iterator set(const_iterator pos, R &&value)
Setter of value in the array on position specified by iterator specified by pos. The value is cloned ...
Definition: ptr_array.hpp:540
auto & get() &
Getter of value on index given by template paramter.
Definition: ptr_array.hpp:622
ptr_array()
The default constructor initializing the values of the array to the defaultly constructed value of T.
Definition: ptr_array.hpp:138
iterator begin() &noexcept
Iterator to the begining of the values range in the array.
Definition: ptr_array.hpp:328
~ptr_array() noexcept
Destructor of the pointer array.
Definition: ptr_array.hpp:172
ptr_array< T, N > & operator=(const ptr_array< T, N > &other)
Copy operator of assignment. The values of the source array are cloned to the new array.
Definition: ptr_array.hpp:184
void swap(ptr_array &other)
Definition: ptr_array.hpp:609
iterator emplace_set(const_iterator pos, Args &&... args)
Setter of internaly constructed value into the array on position specified by iterator specified by p...
Definition: ptr_array.hpp:583
const_reverse_iterator crend() const noexcept
Reverse iterator one past the last element of the reversed range of values in the array.
Definition: ptr_array.hpp:458
const_reverse_iterator crbegin() const noexcept
Reverse iterator to the begining of the reversed range of values in the array.
Definition: ptr_array.hpp:428
auto range() &&
Make range of move begin to end iterators.
Definition: ptr_array.hpp:492
ptr_array(const ptr_array &other)
Copy constructor cloning all values in the source array.
Definition: ptr_array.hpp:150
T value_type
The type of values.
Definition: ptr_array.hpp:57
reverse_iterator rbegin() noexcept
Reverse iterator to the begining of the reversed range of values in the array.
Definition: ptr_array.hpp:408
iterator end() &noexcept
Iterator one past the last element of the values range in the array.
Definition: ptr_array.hpp:368
const auto & get() const &
Getter of value on index given by template paramter.
Definition: ptr_array.hpp:635
iterator emplace_set(const_reverse_iterator pos, Args &&... args)
Setter of internaly constructed value into the array on position specified by iterator specified by p...
Definition: ptr_array.hpp:600
const_reference at(size_type index) const
Getter of value on index.
Definition: ptr_array.hpp:242
const_reference back() const
Getter of the last value in the array.
Definition: ptr_array.hpp:306
const_reference front() const
Getter of the first value in the array.
Definition: ptr_array.hpp:286
T * pointer
The type of pointer to values.
Definition: ptr_array.hpp:87
const_iterator cbegin() const noexcept
Iterator to the begining of the values range in the array.
Definition: ptr_array.hpp:358
const_reverse_iterator rbegin() const noexcept
Reverse iterator to the begining of the reversed range of values in the array.
Definition: ptr_array.hpp:418
ptr_array(Types &&... args)
Constructor of the array of pointers from parameter values. The resulting array is of size of the par...
Definition: ptr_array.hpp:128
auto range() &
Make range of non-const begin to end iterators.
Definition: ptr_array.hpp:468
const T * const_pointer
The type of pointer to constant value.
Definition: ptr_array.hpp:93
reference front()
Getter of the first value in the array.
Definition: ptr_array.hpp:276
value_type & reference
The type of reference to values.
Definition: ptr_array.hpp:75
const_reverse_iterator rend() const noexcept
Reverse iterator one past the last element of the reversed range of values in the array.
Definition: ptr_array.hpp:448
const_iterator begin() const &noexcept
Iterator to the begining of the values range in the array.
Definition: ptr_array.hpp:338
std::size_t size_type
The type of sizes.
Definition: ptr_array.hpp:63
bool operator==(const ext::ptr_array< T, N > &second) const
Specialisation of equality operator for pointer array.
Definition: ptr_array.hpp:669
const_iterator end() const &noexcept
Iterator one past the last element of the values range in the array.
Definition: ptr_array.hpp:378
size_type max_size() const noexcept
Returns the maximal number of values possible to store inside the container.
Definition: ptr_array.hpp:524
auto range() const &
Make range of non-const begin to end iterators.
Definition: ptr_array.hpp:480
ptr_array(ptr_array &&other) noexcept
Move constructor intended to transfer ownership of pointers from source to new instance.
Definition: ptr_array.hpp:162
auto begin() &&noexcept
Move iterator to the begining of the values range in the array.
Definition: ptr_array.hpp:348
auto && get() &&
Getter of value on index given by template paramter.
Definition: ptr_array.hpp:648
const value_type & const_reference
The type of reference to constant values.
Definition: ptr_array.hpp:81
size_type size() const noexcept
Getter of the array size.
Definition: ptr_array.hpp:514
void fill(const R &value)
Fills the array with copies of value.
Definition: ptr_array.hpp:216
reference back()
Getter of the last value in the array.
Definition: ptr_array.hpp:296
iterator set(const_reverse_iterator pos, R &&value)
Setter of value in the array on position specified by iterator specified by pos. The value is cloned ...
Definition: ptr_array.hpp:561
reverse_iterator rend() noexcept
Reverse iterator one past the last element of the reversed range of values in the array.
Definition: ptr_array.hpp:438
std::ptrdiff_t diference_type
The type of size differences.
Definition: ptr_array.hpp:69
auto operator<=>(const ext::ptr_array< T, N > &second) const
Definition: ptr_array.hpp:652
auto end() &&noexcept
Move iterator to the begining of the values range in the array.
Definition: ptr_array.hpp:388
p second
Definition: ToRegExpAlgebraic.h:126
int i
Definition: AllEpsilonClosure.h:118
Definition: sigHandler.cpp:20
constexpr array< typename std::remove_reference< Base >::type, sizeof ...(Types)+1 > make_array(Base &&first, Types &&... other)
Equivalent to the make_array from standard library but produces the ext::array.
Definition: array.hpp:254
constexpr ptr_array< typename std::remove_reference< Base >::type, sizeof ...(Types)+1 > make_ptr_array(Base &&first, Types &&... other)
Array construction helper. Array is constructed from provided values, type of stored elements is dedu...
Definition: ptr_array.hpp:775
auto clone(T &&tmp)
Wrapper around clone by means of using copy constructor or clone method if available.
Definition: clone.hpp:41
dereferencing_iterator< Iterator > dereferencer(Iterator iter)
Dereferencing adaptor construction function.
Definition: iterator.hpp:815
std::ostream & operator<<(ext::reference_wrapper< std::ostream > &os, std::ostream &(*const func)(std::ostream &))
Overloaded function allowing same operations on wrapped output stream as on the actual output stream,...
Definition: GlobalData.cpp:33
Definition: FordFulkerson.hpp:16
auto & get(ext::ptr_array< Type, N > &tpl)
Specialisation of get function for pointer arrays.
Definition: ptr_array.hpp:693
void swap(ext::managed_linear_set< T, Compare, Alloc > &x, ext::managed_linear_set< T, Compare, Alloc > &y)
Specialisation of swap for linear set.
Definition: managed_linear_set.hpp:864