C++ Logo


Advanced search

Re: [std-proposals] Floating the idea for std::make_contiguous_objects

From: Thiago Macieira <thiago_at_[hidden]>
Date: Mon, 25 Apr 2022 16:38:40 -0700
On Monday, 25 April 2022 16:23:37 PDT Breno Guimar„es via Std-Proposals wrote:
> template<class... Ts>
> std::tuple<std::pair<Ts*, Ts*>...>
> make_contiguous_objects(initializer_for<Ts>...);

std::tuple is already your answer.

If you're going to leave the layout to the implementation, then it means you
don't care about exact offsets inside the allocated memory. That means
std::tuple with its empty base optimisations and support for final does what
you want it to do.

You don't need make_contiguous_objects<T...>(). All you need is

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

Received on 2022-04-25 23:38:42