C++ Logo

STD-PROPOSALS

Advanced search

Subject: Re: [std-proposals] source_location improvement
From: Thiago Macieira (thiago_at_[hidden])
Date: 2021-05-05 23:26:09


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

STD-PROPOSALS list run by std-proposals-owner@lists.isocpp.org

Standard Proposals Archives on Google Groups