115 static_assert(
sizeof(
DerivedT) >= 0,
"incomplete derived type");
116 static_assert(std::is_base_of_v<OStreamBase<DerivedT>,
DerivedT>);
117 return static_cast<DerivedT&
>(*this);
120template <
class DerivedT>
123 return get_derived().do_prepare_space(
num_bytes);
126template <
class DerivedT>
132template <
class DerivedT>
133void OStreamBase<DerivedT>::set_badbit()
135 get_derived().do_set_badbit();
138template <
class DerivedT>
148 return get_derived();
151template <
class DerivedT>
155 char*
buf = prepare_space(1);
162 return get_derived();
165template <
class DerivedT>
169 return get_derived();
172template <
class DerivedT>
178 + std::is_signed_v<T>;
188 if constexpr (std::is_signed_v<T>) {
199 relinquish_space(end -
buf);
204 return get_derived();
207template <
class DerivedT>
208template <
class T>
requires std::floating_point<T>
215 relinquish_space(end -
buf);
226 buf = prepare_space(consumed);
230 relinquish_space(consumed);
236 return get_derived();
239template <
class DerivedT>
245template <
class DerivedT>
251template <
class StreamT>
259template <
class StreamT>
260 requires detail::InheritsBasicOStream<StreamT>
267template <
class StreamT>
268 requires detail::InheritsBasicOStream<StreamT>
275template <
class StreamT>
276 requires detail::InheritsBasicOStream<StreamT>
283template <
class StreamT>
284 requires detail::InheritsBasicOStream<StreamT>
291template <
class StreamT>
292 requires detail::InheritsBasicOStream<StreamT>
299template <
class StreamT>
300 requires detail::InheritsBasicOStream<StreamT>
307template <
class StreamT>
308 requires detail::InheritsBasicOStream<StreamT>
315template <
class StreamT>
316 requires detail::InheritsBasicOStream<StreamT>
323template <
class StreamT>
324 requires detail::InheritsBasicOStream<StreamT>
331template <
class StreamT>
332 requires detail::InheritsBasicOStream<StreamT>
339template <
class StreamT>
340 requires detail::InheritsBasicOStream<StreamT>
347template <
class StreamT>
348 requires detail::InheritsBasicOStream<StreamT>
355template <
class StreamT>
356 requires detail::InheritsBasicOStream<StreamT>
363template <
class StreamT>
364 requires detail::InheritsBasicOStream<StreamT>
371template <
class StreamT>
372 requires detail::InheritsBasicOStream<StreamT>
375 std::size_t
len = std::char_traits<char>::length(
s);
380template <
class StreamT>
381 requires detail::InheritsBasicOStream<StreamT>
384 const char*
data = std::bit_cast<const char*>(
s);
385 std::size_t
len = std::char_traits<char>::length(
data);
390template <
class StreamT>
391 requires detail::InheritsBasicOStream<StreamT>
394 const char*
data = std::bit_cast<const char*>(
s);
395 std::size_t
len = std::char_traits<char>::length(
data);
400template <
class StreamT>
401 requires detail::InheritsBasicOStream<StreamT>
404 os.put_data(
s.data(),
s.size());
408template <
class StreamT>
409 requires detail::InheritsBasicOStream<StreamT>
412 os.put_data(
s.data(),
s.size());
416template <
class StreamT,
class T>
417 requires (detail::InheritsBasicOStream<StreamT> &&
418 std::is_rvalue_reference_v<StreamT&&>)
422 return static_cast<StreamT&&
>(os);