25 template <
typename StoredType>
30 template <
typename StoredType>
40 template <
typename StoredType>
41 std::enable_if_t<std::is_integral<StoredType>{},
45 return static_cast<StoredType&
>(ostr.iword(index));
49 template <
typename StoredType>
50 std::enable_if_t<!std::is_integral<StoredType>{},
54 return reinterpret_cast<StoredType&
> 55 (
const_cast<const void*&
>(ostr.pword(index)));
59 template <
typename StoredType>
63 return detail::get_slot<StoredType>(ostr,
index());
71 template <
typename StoredType>
73 : slot_(slot), data_(data)
76 template <
typename StoredType>
83 template <
typename StoredType>
95 template <
typename StoredType>
101 template <
typename StoredType>
108 template <
typename StoredType>
120 template <
typename StoredType>
125 template <
typename StoredType>
132 template <
typename StoredType>
set_type(const xalloc &slot, StoredType &data)
Set data_ to data.
Allocate slots in std::ostreams.
void operator()(std::ostream &ostr) const
Get the data from the xalloced place.
set_type set(StoredType &data) const
A setter.
Handle the data to get from the xalloced place.
std::enable_if_t<!std::is_integral< StoredType >{}, StoredType & > get_slot(std::ostream &ostr, int index)
const xalloc & slot_
The xalloced data.
void operator()(std::ostream &ostr) const
Swap the data from the xalloced place for a given one.
std::ostream & operator<<(std::ostream &os, direction d)
Pretty-printing.
StoredType & data_
Variable in which we store the data to be swapped.
StoredType & data_
Variable in which we return the xalloc data.
swap_type(const xalloc &slot, StoredType &data)
Set data_ to data.
Handle the data to put in the xalloced place.
StoredType & operator()(std::ostream &ostr) const
The stored data as an lvalue.
swap_type swap(StoredType &data) const
A swapper.
Swap the data stored in the stream for a given one.
const xalloc & slot_
The xalloced data.
xalloc()
Allocates the slot.
StoredType & data_
Data to put in the stream.
void swap(config::value &first, config::value &second)
const xalloc & slot_
The xalloced data.
get_type(const xalloc &slot, StoredType &data)
Set data_ to data.
Defines the operator() for the classes get_type, set_type and swap_type.
long int index() const ATTRIBUTE_PURE
The xalloc index.
void operator()(std::ostream &ostr) const
Set the data in the xalloced place.
const long int index_
The index of the slot.
get_type get(StoredType &data) const
A getter.