C++ Logo


Advanced search

Re: [std-proposals] Detection of whether a determined user-defined literal is declared

From: Jens Maurer <jens.maurer_at_[hidden]>
Date: Wed, 16 Aug 2023 08:07:07 +0200
On 16/08/2023 00.50, veronica alphonso wrote:
> I'm aware about the potential pitfalls of userexpr, the main one being how to determine whether t`s value comes from a literal, but i think this could be sorted in a similar way as how std::reference_constructs/converts_from_temporary work from the compiler's perspective; if t's type isn't one of the list declared at https://eel.is/c++draft/over.literal#3 <https://eel.is/c++draft/over.literal#3>, is constructed from a non-literal/temporary, and it's accessed after its lifetime begins(dynamic branches included) and before its usage in the userexpr(the concept of access being defined by https://eel.is/c++draft/intro.defs#defns.access <https://eel.is/c++draft/intro.defs#defns.access>), then the t's usage on a userexpr is ill.formed.
> And sure, userexpr could be used for this endeavour, but i don't want to promote it as the main solution until i fully study all of its potential details, that's why my intention was to submit an intermediate detection-feature

Then, you need to demonstrate why the intermediate detection feature
solves a problem worth solving without "userexpr" being available.

So, please provide plausible usage examples for the intermediate detection
feature that don't mention "userexpr".


Received on 2023-08-16 06:07:12