30 Input/output library [input.output]

30.10 File systems [filesystems]

30.10.14 Filesystem operation functions [fs.op.funcs]

30.10.14.22 Is regular file [fs.op.is_regular_file]

bool is_regular_file(file_status s) noexcept;
Returns: s.type() == file_­type​::​regular.
bool is_regular_file(const path& p);
Returns: is_­regular_­file(status(p)).
Throws: filesystem_­error if status(p) would throw filesystem_­error.
bool is_regular_file(const path& p, error_code& ec) noexcept;
Effects: Sets ec as if by status(p, ec).
[Note
:
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.