C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Callsite passed as template parameter

From: Jonathan Wakely <cxx_at_[hidden]>
Date: Thu, 16 Nov 2023 10:19:05 +0000
On Thu, 16 Nov 2023 at 09:38, Frederick Virchanza Gotham via Std-Proposals <
std-proposals_at_[hidden]> wrote:

> On Wed, Nov 15, 2023 at 11:40 PM Thiago Macieira via Std-Proposals
> <std-proposals_at_[hidden]> wrote:
> >
> > On Wednesday, 15 November 2023 15:30:31 PST Jason McKesson via
> Std-Proposals
> > wrote:
> > > I see nothing about this that would be "cool". You're increasing the
> > > static size requirements of your entire binary every time you do it.
> > > Memory that will likely go unused for 99% of your application's
> > > runtime.
> >
> > It's also read-write memory, at least in the way the code was written.
>
>
> Not sure what you mean by 'read-write memory' here. The
> null-terminated string isn't going to be stored in ROM or Flash if the
> string_view isn't known until runtime.
>
> And as regards memory going unused for 99% of the application's
> runtime, I favour this in two scenarios:
> (1) When programming a microcontroller, I keep heap allocation to an
> absolute bare minimum -- I don't want future allocations to fail
> because of a fragmented heap.
> (2) Extreme micro-optimisation -- although I very very rarely favour a
> micro-optimisation over good coding practise.
>

OK, but not suitable for the C++ standard. This isn't a mailing list for
sharing your cool ideas.

Received on 2023-11-16 10:19:20