C++ Logo


Advanced search

Re: [SG10] Over-aligned dynamic allocation

From: Daniel Krügler <daniel.kruegler_at_[hidden]>
Date: Wed, 22 Jun 2016 07:07:06 +0200
2016-06-22 6:04 GMT+02:00 Nelson, Clark <clark.nelson_at_[hidden]>:
>> I can imagine that the macro would also be used by people who
>> replace the global operator new, and who would also replace the
>> aligned version if it were present.
> That's a good point. It would also serve to indicate whether
> "std::align_val_t" were available as a type name.
> Would anyone else like to weigh in in one direction or the other?

I gave this a second thought after your presentation in LWG and then
it occurred to me that indeed the feature macro could be indeed
useful. The usecases that came into my mind do not belong to the very
narrow scoped cases, but to a wider-scoped situation where the
programmer might want to decide to either user over-aligned allocation
of some struct or to follow a completely different approach of solving
your programming problem in a way. But I was not able to construct a
reasonably looking example for this, sorry :-(

- Daniel

Received on 2016-06-22 07:07:08