[PATCH 1/4]: C++ P1423R3 char8_t remediation: Decouple constraints for u8path from path constructors

Tom Honermann tom@honermann.net
Sun Sep 15 19:39:00 GMT 2019


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.

I recommend applying the patch and viewing the diff with white space 
ignored when reviewing; there will be many fewer differences this way.

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).

libstdc++-v3/ChangeLog:

2019-09-15  Tom Honermann  <tom@honermann.net>

      * 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.

Tom.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p1423r3-1.patch
Type: text/x-patch
Size: 28011 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20190915/e9d1da23/attachment.bin>


More information about the Libstdc++ mailing list