C++ Logo

std-proposals

Advanced search

Re: [std-proposals] std::source_location::function_name returns more than bargained for

From: Thiago Macieira <thiago_at_[hidden]>
Date: Sun, 28 Jul 2024 18:13:35 -0700
On Sunday 28 July 2024 04:22:36 GMT-7 Sebastian Wittmeier via Std-Proposals
wrote:
> - source_location::current() and source_location::function_name() are
> consteval/constexpr functions. You could modify the returned string at
> compile time to your liking, e.g. searching for '(' and removing everything
> afterwards

It needs to be a little smarter than that, for for example a function
signature like
  void __cdecl foo<(int)1>(int);
but the idea is valid.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Principal Engineer - Intel DCAI Platform & System Engineering

Received on 2024-07-29 01:13:37