28 #ifndef NDN_CXX_UTIL_OSTREAM_JOINER_HPP
29 #define NDN_CXX_UTIL_OSTREAM_JOINER_HPP
33 #if __has_include(<experimental/iterator>)
34 # include <experimental/iterator>
35 # if __cpp_lib_experimental_ostream_joiner >= 201411
36 # define NDN_CXX_HAVE_EXPERIMENTAL_OSTREAM_JOINER
40 #ifdef NDN_CXX_HAVE_EXPERIMENTAL_OSTREAM_JOINER
43 using std::experimental::ostream_joiner;
53 template<
typename DelimT,
54 typename CharT = char,
55 typename Traits = std::char_traits<CharT>>
69 noexcept(std::is_nothrow_copy_constructible_v<DelimT>)
70 : m_os(std::addressof(os)), m_delim(delimiter)
75 noexcept(std::is_nothrow_move_constructible_v<DelimT>)
76 : m_os(std::addressof(os)), m_delim(std::move(delimiter))
113 bool m_isFirst =
true;
116 template<
typename CharT,
typename Traits,
typename DelimT>
117 inline ostream_joiner<std::decay_t<DelimT>, CharT, Traits>
120 return {os, std::forward<DelimT>(delimiter)};
std::basic_ostream< CharT, Traits > ostream_type
ostream_joiner(ostream_type &os, DelimT &&delimiter) noexcept(std::is_nothrow_move_constructible_v< DelimT >)
ostream_joiner & operator*() noexcept
ostream_joiner & operator++(int) noexcept
ostream_joiner(ostream_type &os, const DelimT &delimiter) noexcept(std::is_nothrow_copy_constructible_v< DelimT >)
std::output_iterator_tag iterator_category
ostream_joiner & operator++() noexcept
ostream_joiner & operator=(const T &value)
Common includes and macros used throughout the library.
ostream_joiner< std::decay_t< DelimT >, CharT, Traits > make_ostream_joiner(std::basic_ostream< CharT, Traits > &os, DelimT &&delimiter)