C++ Logo

std-proposals

Advanced search

Re: source_location improvement

From: Thiago Macieira <thiago_at_[hidden]>
Date: Wed, 05 May 2021 21:26:09 -0700
On Wednesday, 5 May 2021 14:05:53 PDT Mike via Std-Proposals wrote:
> So, taking my specific problem, given `loc` returned by
> source_location::current(), how do we use loc.file_name() (returning
> constexpr const char*) and loc.line() (returning constexpr
> unint_least32_t) to create a single compile time string like
> "foo.cpp(555): beyond all recognition"? Could you give me an example of
> the kind of syntax you were thinking of?

std::array, strlen (std::char_trats::length), memcpy (std::char_traits::copy),
std::to_chars.

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

Received on 2021-05-05 23:26:15