]> git.ipfire.org Git - thirdparty/gcc.git/commit - libstdc++-v3/include/bits/fs_path.h
libstdc++: P1423R3 char8_t remediation (1/4)
authorTom Honermann <tom@honermann.net>
Fri, 29 Nov 2019 17:43:37 +0000 (17:43 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Fri, 29 Nov 2019 17:43:37 +0000 (17:43 +0000)
commita1e7d33bb9458f76a2d49209a3825940ca7fbe0b
treef18bfddfb04e9c3ae02ec29b877d245a5d2b614f
parent6851de8b9003582f4c3dbcbfd598cba367f0fbc3
libstdc++: P1423R3 char8_t remediation (1/4)

Decouple constraints for u8path from path constructors

This patch moves helper classes and functions for std::filesystem::path out of
the class definition to a detail namespace so that they are available to the
implementations of std::filesystem::u8path.  Prior to this patch, the SFINAE
constraints for those implementations were specified via delegation to the
overloads of path constructors with a std::locale parameter; it just so
happened that those overloads had the same constraints.  As of P1423R3, u8path
and those overloads no longer have the same constraints, so this dependency
must be broken.

This patch also updates the experimental implementation of the filesystem TS
to add SFINAE constraints to its implementations of u8path.  These functions
were previously unconstrained and marked with a TODO comment.

This patch does not provide any intentional behavioral changes other than the
added constraints to the experimental filesystem TS implementation of u8path.

Alternatives to this refactoring would have been to make the u8path overloads
friends of class path, or to make the helpers public members. Both of those
approaches struck me as less desirable than this approach, though this
approach does require more code changes and will affect implementation detail
portions of mangled names for path constructors and inline member functions
(mostly function template specializations).

2019-11-29  Tom Honermann  <tom@honermann.net>

Decouple constraints for u8path from path constructors
* include/bits/fs_path.h: Moved helper utilities out of
std::filesystem::path into a detail namespace to make them
available for use by u8path.
* include/experimental/bits/fs_path.h: Moved helper utilities out
of std::experimental::filesystem::v1::path into a detail
namespace to make them available for use by u8path.

From-SVN: r278855
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/fs_path.h
libstdc++-v3/include/experimental/bits/fs_path.h