Subject: Re: [Boost-bugs] [Boost C++ Libraries] #7021: filesystem::path::has_filename() is wrong
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-10-30 15:09:13
#7021: filesystem::path::has_filename() is wrong
----------------------------------+-----------------------------------------
Reporter: cleanrock@⦠| Owner: bemandawes
Type: Bugs | Status: new
Milestone: To Be Determined | Component: filesystem
Version: Boost 1.49.0 | Severity: Problem
Resolution: | Keywords:
----------------------------------+-----------------------------------------
Comment (by Craig Dickson <cdickson@â¦>):
Theoretically, yes, it makes sense that has_filename() would return true
if filename() returns a non-empty string. However, in practice, I think
the way it's written will produce the same result. According to the path
decomposition table in the filesystem docs, the only time filename()
returns an empty string is when m_pathname is empty. That being the case,
has_filename() should return true if m_pathname is not empty, and testing
m_pathname.empty() is faster than testing filename().empty() in most
cases.
On the other hand, I have a fundamental disagreement with the way path
decomposes a path that ends with a slash, which is relevant here because a
path ending with a slash should have no filename (path currently infers an
invisible "." at the end). I'll file that concern as a separate bug,
though, because it's tangential to this one.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/7021#comment:1> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:11 UTC