30 Input/output library [input.output]

30.10 File systems [filesystems]

30.10.14 Filesystem operation functions [fs.op.funcs]

30.10.14.12 Equivalent [fs.op.equivalent]

bool equivalent(const path& p1, const path& p2); bool equivalent(const path& p1, const path& p2, error_code& ec) noexcept;
Returns: true, if p1 and p2 resolve to the same file system entity, else false.
The signature with argument ec returns false if an error occurs.
Two paths are considered to resolve to the same file system entity if two candidate entities reside on the same device at the same location.
[Note
:
On POSIX platforms, this is determined as if by the values of the POSIX stat structure, obtained as if by stat() for the two paths, having equal st_­dev values and equal st_­ino values.
end note
]
Remarks: !exists(p1) || !exists(p2) is an error.
Throws: As specified in [fs.err.report].