Created on 2014-08-01.00:00:00 last changed 89 months ago
Proposed resolution:
bool is_empty(const path& p); bool is_empty(const path& p, error_code& ec) noexcept;Effects:
- Determine
file_status s
, as if bystatus(p)
orstatus(p, ec)
, respectively.- For the signature with argument
ec
, returnfalse
if an error occurred.- Otherwise, if
is_directory(s)
:
- Create
directory_iterator itr
, as if bydirectory_iterator(p)
ordirectory_iterator(p, ec)
, respectively.- For the signature with argument
ec
, returnfalse
if an error occurred.- Otherwise, return
itr == directory_iterator()
.- Otherwise:
- Determine
uintmax_t sz
, as if byfile_size(p)
orfile_size(p, ec)
, respectively .- For the signature with argument
ec
, returnfalse
if an error occurred.- Otherwise, return
sz == 0
.
Returns:is_directory(s) ? directory_iterator(p) == directory_iterator() : file_size(p) == 0;
The signature with argumentec
returnsfalse
if an error occurs.Throws: As specified in Error reporting (7).
[ 2016-08 Chicago ]
Wed PM: Move to Tentatively Ready
[ Apr 2016 Issue updated to address the C++ Working Paper. Previously addressed File System TS ]
Previous resolution [SUPERSEDED]:
bool is_empty(const path& p); bool is_empty(const path& p, error_code& ec) noexcept;Effects:
- Determine
file_status s
, as if bystatus(p)
orstatus(p, ec)
, respectively.- For the signature with argument
ec
, returnfalse
if an error occurred.- Otherwise, if
is_directory(s)
:
- Create
directory_iterator itr
, as if bydirectory_iterator(p)
ordirectory_iterator(p, ec)
, respectively.- For the signature with argument
ec
, returnfalse
if an error occurred.- Otherwise, return
itr == directory_iterator()
.- Otherwise:
- Determine
uintmax_t sz
, as if byfile_size(p)
orfile_size(p, ec)
, respectively .- For the signature with argument
ec
, returnfalse
if an error occurred.- Otherwise, return
sz == 0
.Remarks: The temporary objects described in Effects are for exposition only. Implementations are not required to create them.
Returns:
See Effects.is_directory(s) ? directory_iterator(p) == directory_iterator() : file_size(p) == 0;
The signature with argumentec
returnsfalse
if an error occurs.Throws: As specified in Error reporting (7).
[ 9 Oct 2014 Beman supplies proposed wording. ]
The descriptions of most functions are explicit about the use of the ec
argument,
either saying something like "foo(p)
or foo(p, ec)
, respectively" or using the
ec
argument like foo(p[, ec])
, but is_empty
does not.
[fs.op.is_empty]/2 refers to ec
unconditionally, but more importantly
[fs.op.is_empty]/3 doesn't pass ec
to the directory_iterator
constructor or the file_size
function.
History | |||
---|---|---|---|
Date | User | Action | Args |
2017-07-30 20:15:43 | admin | set | status: wp -> c++17 |
2016-11-14 03:59:28 | admin | set | status: pending -> wp |
2016-11-14 03:55:22 | admin | set | status: ready -> pending |
2016-08-03 20:22:24 | admin | set | messages: + msg8373 |
2016-08-03 20:22:24 | admin | set | status: new -> ready |
2016-04-10 22:23:37 | admin | set | messages: + msg8045 |
2016-01-28 01:00:35 | admin | set | messages: + msg7936 |
2016-01-28 01:00:35 | admin | set | messages: + msg7935 |
2014-08-01 00:00:00 | admin | create |