C++ Logo

std-proposals

Advanced search

Re: [std-proposals] [[packed]] std::unaligned

From: Thiago Macieira <thiago_at_[hidden]>
Date: Tue, 12 Dec 2023 15:17:36 -0300
On Tuesday, 12 December 2023 15:11:00 -03 Frederick Virchanza Gotham via Std-
Proposals wrote:
> I don't know if it would ever make sense to have an
> 'unaligned<std::string>'

It doesn't. Unaligned only makes sense if you're trying to match the layout as
specified by some external ABI, which means it is not std::string or any
complex type.

BTW, this reminds me of what Qt uses unaligned for: endianness. So we should
have std::big_endian<int> and std::little_endian<int> too.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel DCAI Cloud Engineering

Received on 2023-12-12 18:17:41