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