utx::delim_base is the base class of utxcpp delim string. It has five template class alias: utx::delim utx::u8delim utx::u16delim utx::u32delim utx::wdelim. Object of utx::delim_base is used for inserting a delim value between two values.
Utxcpp Delim:
Utxcpp No Delim:
class delim_base final;
utx::delim targets to std::string.
utx::no_delim
utx::delim targets to std::u8string.
utx::no_u8delim
utx::delim targets to std::u16string.
utx::no_u16delim
utx::delim targets to std::u32string.
utx::no_u32delim
utx::delim targets to std::wstring.
utx::no_wdelim
#include <utxcpp/core.hpp>
delim() = delete; delim(const std::string & a_delim_string) noexcept; template <utx::kspt::printable PrintableValue> delim(const PrintableValue & a_delim) noexcept; delim(const delim & a_delim) noexcept;
inline bool operator==(const delim & a_delim) const; template <utx::kspt::printable PrintableValue> inline bool operator==(const PrintableValue & value) const; template <utx::kspt::ostream OutStream> friend OutStream & operator<<(OutStream & os, const delim & a_delim); std::string data() const;
A constant value which indicates that there should not add a delim between values.
inline const std::string && no_delim = "utx::no_delim";
Empty string "", '' are not accepted by utx::delim, which will throw an exception.
Please use utx::no_delim, if you want to insert an empty delim.
![]() |
Note |
---|---|
|
#include <utxcpp/core.hpp> int main() { utx::print_to(std::cout, utx::delim{'-'}, "I", "have", 3, "apples"); utx::print(); utx::print_to(std::cout, '-', "I", "have", 3, "apples"); utx::print(); /* Result: I-have-3-apples I-have-3-apples */ utx::print_to(std::cout, 777, "It", "is", "too", "small."); utx::print(); /* Result: It777is777too777small. */ utx::print_to(std::cout, '-', 'I', "have", "no", "idea.", '\n'); /* Result: I-have-no-idea.- (Because there is a delim between "idea." and '\n') */ }