Celeritas
0.5.0-86+4a8eea4
|
#include "detail/Joined.hh"
Functions | |
template<class InputIterator , class Conjunction > | |
detail::Joined< InputIterator, Conjunction, detail::StreamValue > | celeritas::join (InputIterator first, InputIterator last, Conjunction &&conjunction) |
Join items, similar to python's "str.join" method. More... | |
template<class InputIterator , class Conjunction , class UnaryOperation > | |
detail::Joined< InputIterator, Conjunction, detail::UnaryToStream< UnaryOperation > > | celeritas::join (InputIterator first, InputIterator last, Conjunction &&conjunction, UnaryOperation &&op) |
Join items transformed by a helper functor. More... | |
template<class InputIterator , class Conjunction , class StreamOp > | |
detail::Joined< InputIterator, Conjunction, StreamOp > | celeritas::join_stream (InputIterator first, InputIterator last, Conjunction &&conjunction, StreamOp &&op) |
Join using a functor that takes (ostream&, value). | |
detail::Joined<InputIterator, Conjunction, detail::StreamValue> celeritas::join | ( | InputIterator | first, |
InputIterator | last, | ||
Conjunction && | conjunction | ||
) |
Join items, similar to python's "str.join" method.
This utility function will concatenate the values passed to it. The given conjunction ONLY appears between values.
The result is a thin class that is streamable. (It can explicitly be converted to a string with the to_string
method). By doing this instead of returning a std::string, large and dynamic containers can be e.g. saved to disk.
detail::Joined<InputIterator, Conjunction, detail::UnaryToStream<UnaryOperation> > celeritas::join | ( | InputIterator | first, |
InputIterator | last, | ||
Conjunction && | conjunction, | ||
UnaryOperation && | op | ||
) |
Join items transformed by a helper functor.
This joins all given elements, inserting conjunction betwen them. The 'op' operator must transform each element into a printable object. For example,
could be used to get the 'key' item of a map.