43template <
class ... Types >
49 std::tuple < Types * ... > m_data;
59 template < std::size_t ... Indices >
60 void copyCons ( std::index_sequence < Indices ... >,
const ptr_tuple & tpl ) {
61 ( ( std::get < Indices > ( m_data ) =
ext::clone ( std::get < Indices > ( * tpl.m_data ) ) ), ... );
72 template < std::size_t ... Indices >
73 void moveCons ( std::index_sequence < Indices ... >,
ptr_tuple && tpl ) {
74 (
std::swap ( std::get < Indices > ( m_data ), std::get < Indices > ( tpl.m_data ) ), ... );
86 template < std::size_t ... Indices,
class ... UTypes >
87 void cons ( std::index_sequence < Indices ... >, UTypes && ... elems ) {
88 ( ( std::get < Indices > ( m_data ) =
ext::clone ( std::forward < UTypes > ( elems ) ) ), ... );
97 template < std::size_t ... Indices >
98 void des ( std::index_sequence < Indices ... > ) {
99 (
delete std::get < Indices > ( m_data ), ... );
110 copyCons ( std::make_index_sequence <
sizeof ... ( Types ) > ( ), tpl );
120 moveCons ( std::make_index_sequence <
sizeof ... ( Types ) > ( ), std::move ( tpl ) );
140 template <
class ... UTypes >
142 cons ( std::make_index_sequence <
sizeof ... ( Types ) > ( ), std::forward < UTypes > ( elems ) ... );
150 des ( std::make_index_sequence <
sizeof ... ( Types ) > ( ) );
160 if (
this == & other )
163 des ( std::make_index_sequence <
sizeof ... ( Types ) > ( ) );
164 copyCons ( std::make_index_sequence <
sizeof ... ( Types ) > ( ), other );
188 swap ( this->m_data, other.m_data );
199 template < std::
size_t I >
201 return * std::get < I > ( m_data );
212 template < std::
size_t I >
213 const auto &
get ( ) const & {
214 return * std::get < I > ( m_data );
225 template < std::
size_t I >
227 return std::move ( * std::get < I > ( m_data ) );
237 template <
class R, std::
size_t I >
243 auto asTie ( )
const {
244 auto accessor = [ & ] < std::size_t ... Is > ( std::index_sequence < Is ... > ) {
245 return std::tie ( this->
template get < Is > ( ) ... );
247 return accessor ( std::make_index_sequence <
sizeof ... ( Types ) > ( ) );
256 return this->asTie ( ) ==
second.asTie ( );
264 return this->asTie ( ) <=>
second.asTie ( );
280template<
class... Ts>
285 auto outCallback = [ & ] (
const auto & arg0 ) {
314template < std::size_t I,
class ... Types >
316 return tpl.template get < I > ( );
330template < std::size_t I,
class ... Types >
332 return tpl.template get < I > ( );
346template < std::size_t I,
class ... Types >
348 return tpl.template get < I > ( );
365template <
typename... Elements >
380template <
class ... Types >
381struct tuple_size <
ext::ptr_tuple < Types ... > > :
public std::integral_constant < std::size_t, sizeof...( Types ) > { };
392template < std::size_t I,
class... Types >
393struct tuple_element < I,
ext::ptr_tuple < Types... > > {
394 typedef typename std::tuple_element < I, std::tuple < Types ... > >
::type type;
Implementation of tuple storing dynamicaly allocated instances of given type. The class mimicks the i...
Definition: ptr_tuple.hpp:44
bool operator==(const ext::ptr_tuple< Types ... > &second) const
Specialisation of the compare structure implementing the three-way comparison.
Definition: ptr_tuple.hpp:255
auto operator<=>(const ext::ptr_tuple< Types ... > &second) const
Specialisation of the compare structure implementing the three-way comparison.
Definition: ptr_tuple.hpp:263
void swap(ptr_tuple &other)
Swaps two instances of pointer tuple.
Definition: ptr_tuple.hpp:187
ptr_tuple< Types ... > & operator=(const ptr_tuple< Types ... > &other)
The pointer tuple copy operator of assignemnt.
Definition: ptr_tuple.hpp:159
void set(R &&value)
Setter method of a value inside the pointer tuple.
Definition: ptr_tuple.hpp:238
const auto & get() const &
Access method to inside the pointer tuple.
Definition: ptr_tuple.hpp:213
ptr_tuple(const ptr_tuple &tpl)
The copy constructor of the pointer tuple.
Definition: ptr_tuple.hpp:109
~ptr_tuple()
The pointer tuple destructor.
Definition: ptr_tuple.hpp:149
auto && get() &&
Access method to inside the pointer tuple.
Definition: ptr_tuple.hpp:226
ptr_tuple(ptr_tuple &&tpl)
The move constructor of the pointer tuple.
Definition: ptr_tuple.hpp:119
ptr_tuple(UTypes &&... elems)
Tuple constructor from pack of source values.
Definition: ptr_tuple.hpp:141
auto & get() &
Access method to inside the pointer tuple.
Definition: ptr_tuple.hpp:200
Class extending the tuple class from the standard library. Original reason is to allow printing of th...
Definition: tuple.hpp:42
p second
Definition: ToRegExpAlgebraic.h:126
Definition: sigHandler.cpp:20
constexpr tuple< Elements &... > tie(Elements &... args) noexcept
Helper of extended tuple of references construction. The tuple is constructed to reffer to values in ...
Definition: tuple.hpp:218
constexpr auto make_ptr_tuple(Elements &&... args)
Helper of pointer tuple construction. The tuple is constructed from values pack, types are deduced.
Definition: ptr_tuple.hpp:366
void foreach(Tuple &&t, Callable callback)
Definition: tuple_common.hpp:19
auto clone(T &&tmp)
Wrapper around clone by means of using copy constructor or clone method if available.
Definition: clone.hpp:41
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
std::tuple_element< I, std::tuple< Types... > >::type type
Definition: ptr_tuple.hpp:394