Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filesystem: Bad mixing of effects in Returns element #815

Closed
Dani-Hub opened this issue Jul 10, 2016 · 4 comments
Closed

filesystem: Bad mixing of effects in Returns element #815

Dani-Hub opened this issue Jul 10, 2016 · 4 comments
Milestone

Comments

@Dani-Hub
Copy link
Member

Dani-Hub commented Jul 10, 2016

During the Oulo meeting's LWG discussion of some filesystem issues it has been observed that some current Returns elements of fs operations unfortunately mix effects and the actual return specification in a single paragraph.

For example, in [fs.op.file_size] p1 we have

Returns: If !exists(p) || !is_regular_file(p) an error is reported (27.10.7). Otherwise, the
size in bytes of the file p resolves to, determined as if by the value of the POSIX stat structure
member st_size obtained as if by POSIX stat(). The signature with argument ec returns static_- cast<uintmax_t>(-1) if an error occurs.

Here, the part

If !exists(p) || !is_regular_file(p) an error is reported (27.10.7).

would better belong to a separate Effects element (such as in copy or copy_file). Then, the current Returns element could be rephrased as follows:

Returns: The size in bytes of the file p resolves to, determined as if by the value of the POSIX stat structure member st_size obtained as if by POSIX stat(). The signature with argument ec returns static_cast<uintmax_t>(-1) if an error occurs.

A similar problem exists for [fs.op.temp_dir_path] p1, where we have

Returns: An unspecifed directory path suitable for temporary files. An error shall be reported if
!exists(p) || !is_directory(p), where p is the path to be returned. The signature with argument
ec returns path() if an error occurs.

which could be split as follows:

Let p be the path to be returned.

Effects: If !exists(p) || !is_directory(p) an error is reported (27.10.7).

Returns: An unspecifed directory path suitable for temporary files. The signature with argument
ec returns path() if an error occurs.

Is it possible to improve this situation editorially?

@tkoeppe
Copy link
Contributor

tkoeppe commented Jul 10, 2016

@Dani-Hub: I've editorially fixed your editorial issue with some formatting :-)

@burblebee
Copy link
Contributor

@jwakely @zygoloid: can this change be made editorially?

@jensmaurer jensmaurer added the decision-required A decision of the editorial group (or the Project Editor) is required. label Dec 13, 2016
@jensmaurer
Copy link
Member

I'd like to point out that resolutions for ~100 NB comments on [filesystems] are in the works. This increases the chance of merge conflicts should we decide to address this editorial issue right now.

@jensmaurer jensmaurer added this to the C++20 milestone Dec 16, 2016
@jensmaurer jensmaurer removed the decision-required A decision of the editorial group (or the Project Editor) is required. label Mar 2, 2017
@jensmaurer
Copy link
Member

Editorial meeting consensus: Fix this editorially after C++17.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants