Title
[filesys.ts] Surprising equivalent() behavior if neither file exists
Status
nad
Section
[fs.filesystem.synopsis]
Submitter
Beman Dawes

Created on 2014-04-12.00:00:00 last changed 100 months ago

Messages

Date: 2016-01-28.01:00:35

[ 17 Jun 2014 Rapperswil LWG considers this NAD. Mixing lexical and existence based behavior is not desirable. ]

Date: 2016-01-31.20:31:05

Addresses: filesys.ts

bool equivalent(const path& p1, const path& p2); has always thrown a exception if neither file exists, with rationale that if they don't exist, it isn't possible to tell if two paths are equivalent. Dave Abrahams has reported that this is counter-intuitive and hard to teach.

An alternative if neither path exists would be to return true if they are lexically equal (operator==), otherwise return false.

This was not a national body comment, and Dave is the only one I can recall ever complaining about the current behavior. On the other hand, any complaint from Dave deserves serious consideration.

History
Date User Action Args
2016-01-28 01:00:35adminsetmessages: + msg7909
2014-04-12 00:00:00admincreate