C++ Logo


Advanced search

Re: [std-proposals] constexpr support in std::filesystem API

From: Thiago Macieira <thiago_at_[hidden]>
Date: Tue, 12 Mar 2024 07:24:41 -0700
On Tuesday, 12 March 2024 06:54:50 PDT Jonathan Wakely via Std-Proposals
> > And you're not talking about a standard feature that could probably be
> > disabled by non-standard flags in compilers, you're suggesting it
> > should be off by default and enabled by a flag. That's not the same
> > thing as exceptions and RTTI at all.
> If it needs to be off by default, it probably shouldn't be in the standard.
> Maybe try implementing it in one of the open source compilers to
> demonstrate it's doable and useful, and to get experience with the
> feature and the problems it can create.

I suggest this feature can be made narrower by allowing "file" or "resource"
access and listing via implementation-defined means. Whether a given compiler
accesses files on the filesystem or not is therefore not explicit in the

I'd advise compilers that they require a command-line option to set the
directory(ies) where such files can be found, like the -I flags for the
preprocessor. If no such option is passed, then the API exists and works, but
finds no content and therefore can open no files. An alternative is that the
option points to a manifest file, which contains all acceptable paths that can
be opened and thus also contains all the entries that can be listed. This
could also be a .tar or .zip file.

Is this useful to the OP? No idea, the use-case isn't very clear yet. This is
a solution to a problem, not a description to the problem that needs solving.

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

Received on 2024-03-12 14:24:45