31 Input/output library [input.output]

31.12 File systems [filesystems]

31.12.13 Filesystem operation functions [fs.op.funcs] Is regular file [fs.op.is.regular.file]

bool filesystem::is_regular_file(file_status s) noexcept;
Returns: s.type() == file_­type​::​regular.
bool filesystem::is_regular_file(const path& p);
Returns: is_­regular_­file(status(p)).
Throws: filesystem_­error if status(p) would throw filesystem_­error.
bool filesystem::is_regular_file(const path& p, error_code& ec) noexcept;
Effects: Sets ec as if by status(p, ec).
[Note 1:
file_­type​::​none, file_­type​::​not_­found and file_­type​::​unknown cases set ec to error values.
To distinguish between cases, call the status function directly.
— end note]
Returns: is_­regular_­file(status(p, ec)).
Returns false if an error occurs.