Skip to content

Commit c25d1e8

Browse files
authored
Merge 2025-06 LWG Motion 30
P2319R5 Prevent path presentation problems
2 parents 270aa15 + b5247d7 commit c25d1e8

File tree

3 files changed

+80
-8
lines changed

3 files changed

+80
-8
lines changed

source/future.tex

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,9 @@
792792

793793
\xrefc{7.29}
794794

795-
\rSec1[depr.fs.path.factory]{Deprecated filesystem path factory functions}
795+
\rSec1[depr.filesystems]{Deprecated file systems}
796+
797+
\rSec2[depr.fs.path.factory]{Deprecated filesystem path factory functions}
796798

797799
\pnum
798800
The header \libheaderrefx{filesystem}{fs.filesystem.syn} has the following additions:
@@ -871,6 +873,45 @@
871873
\end{note}
872874
\end{itemdescr}
873875

876+
\rSec2[depr.fs.path.obs]{Deprecated filesystem path format observers}
877+
878+
\indexlibraryglobal{path}%
879+
\pnum
880+
The following members are declared in addition to those members
881+
specified in \ref{fs.path.member}:
882+
883+
\begin{codeblock}
884+
namespace std::filesystem {
885+
class path {
886+
public:
887+
std::string string() const;
888+
std::string generic_string() const;
889+
};
890+
}
891+
\end{codeblock}
892+
893+
\indexlibrarymember{string}{path}%
894+
\begin{itemdecl}
895+
std::string string() const;
896+
\end{itemdecl}
897+
898+
\begin{itemdescr}
899+
\pnum
900+
\returns
901+
\tcode{system_encoded_string()}.
902+
\end{itemdescr}
903+
904+
\indexlibrarymember{generic_string}{path}%
905+
\begin{itemdecl}
906+
std::string generic_string() const;
907+
\end{itemdecl}
908+
909+
\begin{itemdescr}
910+
\pnum
911+
\returns
912+
\tcode{generic_system_encoded_string()}.
913+
\end{itemdescr}
914+
874915
\rSec1[depr.atomics]{Deprecated atomic operations}
875916

876917
\rSec2[depr.atomics.general]{General}

source/iostreams.tex

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13708,7 +13708,8 @@
1370813708
class Allocator = allocator<EcharT>>
1370913709
basic_string<EcharT, traits, Allocator>
1371013710
string(const Allocator& a = Allocator()) const;
13711-
std::string string() const;
13711+
std::string display_string() const;
13712+
std::string system_encoded_string() const;
1371213713
std::wstring wstring() const;
1371313714
std::u8string u8string() const;
1371413715
std::u16string u16string() const;
@@ -13719,7 +13720,8 @@
1371913720
class Allocator = allocator<EcharT>>
1372013721
basic_string<EcharT, traits, Allocator>
1372113722
generic_string(const Allocator& a = Allocator()) const;
13722-
std::string generic_string() const;
13723+
std::string generic_display_string() const;
13724+
std::string generic_system_encoded_string() const;
1372313725
std::wstring generic_wstring() const;
1372413726
std::u8string generic_u8string() const;
1372513727
std::u16string generic_u16string() const;
@@ -14690,13 +14692,13 @@
1469014692
\ref{fs.path.cvt}.
1469114693
\end{itemdescr}
1469214694

14693-
\indexlibrarymember{string}{path}%
14695+
\indexlibrarymember{system_encoded_string}{path}%
1469414696
\indexlibrarymember{wstring}{path}%
1469514697
\indexlibrarymember{u8string}{path}%
1469614698
\indexlibrarymember{u16string}{path}%
1469714699
\indexlibrarymember{u32string}{path}%
1469814700
\begin{itemdecl}
14699-
std::string string() const;
14701+
std::string system_encoded_string() const;
1470014702
std::wstring wstring() const;
1470114703
std::u8string u8string() const;
1470214704
std::u16string u16string() const;
@@ -14714,6 +14716,20 @@
1471414716
by \ref{fs.path.cvt}.
1471514717
\end{itemdescr}
1471614718

14719+
\indexlibrarymember{display_string}{path}%
14720+
\begin{itemdecl}
14721+
std::string display_string() const;
14722+
\end{itemdecl}
14723+
14724+
\begin{itemdescr}
14725+
\pnum
14726+
\returns
14727+
\tcode{format("{}", *this)}.
14728+
\begin{note}
14729+
The returned string is suitable for use with formatting\iref{format.functions}
14730+
and print functions\iref{print.fun}.
14731+
\end{note}
14732+
\end{itemdescr}
1471714733

1471814734
\rSec4[fs.path.generic.obs]{Generic format observers}
1471914735

@@ -14753,13 +14769,13 @@
1475314769
\ref{fs.path.cvt}.
1475414770
\end{itemdescr}
1475514771

14756-
\indexlibrarymember{generic_string}{path}%
14772+
\indexlibrarymember{generic_system_encoded_string}{path}%
1475714773
\indexlibrarymember{generic_wstring}{path}%
1475814774
\indexlibrarymember{generic_u8string}{path}%
1475914775
\indexlibrarymember{generic_u16string}{path}%
1476014776
\indexlibrarymember{generic_u32string}{path}%
1476114777
\begin{itemdecl}
14762-
std::string generic_string() const;
14778+
std::string generic_system_encoded_string() const;
1476314779
std::wstring generic_wstring() const;
1476414780
std::u8string generic_u8string() const;
1476514781
std::u16string generic_u16string() const;
@@ -14776,6 +14792,21 @@
1477614792
Conversion, if any, is specified by~\ref{fs.path.cvt}.
1477714793
\end{itemdescr}
1477814794

14795+
\indexlibrarymember{generic_display_string}{path}%
14796+
\begin{itemdecl}
14797+
std::string generic_display_string() const;
14798+
\end{itemdecl}
14799+
14800+
\begin{itemdescr}
14801+
\pnum
14802+
\returns
14803+
\tcode{format("{:g}", *this)}.
14804+
\begin{note}
14805+
The returned string is suitable for use with formatting\iref{format.functions}
14806+
and print functions\iref{print.fun}.
14807+
\end{note}
14808+
\end{itemdescr}
14809+
1477914810
\rSec4[fs.path.compare]{Compare}
1478014811

1478114812
\indexlibrarymember{compare}{path}%

source/support.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@
676676
#define @\defnlibxname{cpp_lib_flat_set}@ 202207L // also in \libheader{flat_set}
677677
#define @\defnlibxname{cpp_lib_format}@ 202311L // also in \libheader{format}
678678
#define @\defnlibxname{cpp_lib_format_ranges}@ 202207L // also in \libheader{format}
679-
#define @\defnlibxname{cpp_lib_format_path}@ 202403L // also in \libheader{filesystem}
679+
#define @\defnlibxname{cpp_lib_format_path}@ 202506L // also in \libheader{filesystem}
680680
#define @\defnlibxname{cpp_lib_format_uchar}@ 202311L // also in \libheader{format}
681681
#define @\defnlibxname{cpp_lib_formatters}@ 202302L // also in \libheader{stacktrace}, \libheader{thread}
682682
#define @\defnlibxname{cpp_lib_forward_like}@ 202207L // freestanding, also in \libheader{utility}

0 commit comments

Comments
 (0)