C++ Logo

STD-PROPOSALS

Advanced search

Subject: Re: [std-proposals] Modern std::byte stream IO for C++
From: Maciej Cencora (m.cencora_at_[hidden])
Date: 2020-03-06 02:22:18


>
> 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
>



STD-PROPOSALS list run by herb.sutter at gmail.com

Standard Proposals Archives on Google Groups