di 0.1.0
Loading...
Searching...
No Matches
as_writable_bytes.h
Go to the documentation of this file.
1#pragma once
2
5
6namespace di::vocab {
7namespace detail {
8 struct AsWritableBytesFunction {
9 template<typename T, size_t N, size_t S = N == dynamic_extent ? dynamic_extent : sizeof(T) * N>
10 requires(!concepts::Const<T>)
11 auto operator()(Span<T, N> span) const -> Span<Byte, S> {
12 return { reinterpret_cast<Byte*>(span.data()), span.size_bytes() };
13 }
14 };
15}
16
17constexpr inline auto as_writable_bytes = detail::AsWritableBytesFunction {};
18}
19
20namespace di {
22}
std::byte Byte
Definition byte.h:63
Definition lazy.h:165
Span(Iter, SentOrSize) -> Span< meta::RemoveReference< meta::IteratorReference< Iter > > >
constexpr auto as_writable_bytes
Definition as_writable_bytes.h:17
Definition any_storable.h:9