C++ Logo

std-proposals

Advanced search

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

From: Thiago Macieira <thiago_at_[hidden]>
Date: Wed, 13 Dec 2023 17:17:23 -0300
On Wednesday, 13 December 2023 14:55:22 -03 Frederick Virchanza Gotham via
Std-Proposals wrote:
> I think we could do with having a similar function based on __datasizeof:
>
> template<class To, class From>
> requires ( __datasizeof(To) <= sizeof(From) )

You mean the opposite, right?

struct From { double d; }; // sizeof(From) == 8
struct To { char c; }; // __datasizeof(To) == sizeof(To) == 1


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

Received on 2023-12-13 20:17:28