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