C++ Logo

std-proposals

Advanced search

Re: Modern std::byte stream IO for C++

From: Maciej Cencora <m.cencora_at_[hidden]>
Date: Fri, 6 Mar 2020 09:22:18 +0100
>
> std::io::default_context context{stream, std::endian::big};
>

Exactly as I said, endianess in your example is a runtime property, while
in most scenarios it is actually known at compile time.
It should be something like:
std::io::default_big_endian_context ctx{stream};
or
std::io_default_context<std::endian::big> ctx{stream};

pt., 6 mar 2020 o 03:33 Lyberta via Std-Proposals <
std-proposals_at_[hidden]> napisaƂ(a):

> Maciej Cencora via Std-Proposals:
> > You should provide API that allow to serialize based on compile-time
> > provided endianess
>
> See examples 5 and 6.
>
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>

Received on 2020-03-06 02:25:17