<!DOCTYPE html><html lang='en'><head><title>[fs.class.path]</title><meta charset='UTF-8'/><link rel='stylesheet' type='text/css' href='14882.css'/><link rel='stylesheet' type='text/css' href='expanded.css' title='Notes and examples expanded'/><link rel='alternate stylesheet' type='text/css' href='colored.css' title='Notes and examples colored'/><link rel='alternate stylesheet' type='text/css' href='collapsed.css' title='Notes and examples collapsed'/><link rel='icon' href='icon.png'/></head><body><div class='wrapper'><h1 ><a class='secnum' style='min-width:73pt'>28</a> Input/output library <a class='abbr_ref' href='./#input.output'>[input.output]</a></h1><h2 ><a class='secnum' style='min-width:88pt'>28.11</a> File systems <a class='abbr_ref' href='filesystems#fs.class.path'>[filesystems]</a></h2><h3 ><a class='secnum' style='min-width:103pt'>28.11.7</a> Class <span class='texttt'>path</span> <a class='abbr_ref'>[fs.class.path]</a></h3><span class='indexparent'><a class='index' id='lib:path'></a></span><div class='para' id='1'><div class='marginalizedparent'><a class='marginalized' href='#1'>1</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L11111'>#</a></div><div id='1.sentence-1' class='sentence'>An object of class <span class='texttt'>path</span> represents a path
and contains a pathname<a class='hidden_link' href='#1.sentence-1'>.</a></div> <div id='1.sentence-2' class='sentence'>Such an object is concerned only with the lexical and syntactic aspects
of a path<a class='hidden_link' href='#1.sentence-2'>.</a></div> <div id='1.sentence-3' class='sentence'>The path does not necessarily exist in external storage, and the
pathname is not necessarily valid for the current operating
system or for a particular file system<a class='hidden_link' href='#1.sentence-3'>.</a></div></div><div class='para' id='2'><div class='marginalizedparent'><a class='marginalized' href='#2'>2</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L11119'>#</a></div><div id='2.note-1' class='note'>[<span style='white-space:nowrap'> </span><a class='note_link' href='#2.note-1'><span class='textit'>Note</span></a><div class='noteBody'><span class='textit'>:</span> <div id='2.sentence-1' class='sentence'>Class <span class='texttt'>path</span> is used to support the differences between the string types used by different operating systems to represent pathnames, and to perform conversions between encodings when necessary<a class='hidden_link' href='#2.sentence-1'>.</a></div> —<span style='white-space:nowrap'> </span><i>end note</i></div><span style='white-space:nowrap'> </span>]</div> </div><div class='para' id='3'><div class='marginalizedparent'><a class='marginalized' href='#3'>3</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L11124'>#</a></div><div id='3.sentence-1' class='sentence'>A <a class='hidden_link' href='#def:path' id='def:path'><i >path</i></a> is
a sequence of elements that identify
the location of a file within a filesystem<a class='hidden_link' href='#3.sentence-1'>.</a></div> <div id='3.sentence-2' class='sentence'>The elements are the
<i ><a href='#nt:root-name'>root-name</a></i><span class="mjx-chtml"><span class="mjx-math" aria-label="_\mathit{opt}"><span class="mjx-mrow" aria-hidden="true"><span class="mjx-msubsup"><span class="mjx-base"><span class="mjx-mi"><span class="mjx-char"></span></span></span><span class="mjx-sub" style="font-size: 70.7%; vertical-align: -0.212em; padding-right: 0.071em;"><span class="mjx-texatom"><span class="mjx-mrow"><span class="mjx-mi"><span class="mjx-char MJXc-TeX-main-I" style="padding-top: 0.225em; padding-bottom: 0.298em;">o</span></span><span class="mjx-mi"><span class="mjx-char MJXc-TeX-main-I" style="padding-top: 0.225em; padding-bottom: 0.446em;">p</span></span><span class="mjx-mi"><span class="mjx-char MJXc-TeX-main-I" style="padding-top: 0.372em; padding-bottom: 0.298em;">t</span></span></span></span></span></span></span></span></span>,
<i ><a href='#nt:root-directory'>root-directory</a></i><span class="mjx-chtml"><span class="mjx-math" aria-label="_\mathit{opt}"><span class="mjx-mrow" aria-hidden="true"><span class="mjx-msubsup"><span class="mjx-base"><span class="mjx-mi"><span class="mjx-char"></span></span></span><span class="mjx-sub" style="font-size: 70.7%; vertical-align: -0.212em; padding-right: 0.071em;"><span class="mjx-texatom"><span class="mjx-mrow"><span class="mjx-mi"><span class="mjx-char MJXc-TeX-main-I" style="padding-top: 0.225em; padding-bottom: 0.298em;">o</span></span><span class="mjx-mi"><span class="mjx-char MJXc-TeX-main-I" style="padding-top: 0.225em; padding-bottom: 0.446em;">p</span></span><span class="mjx-mi"><span class="mjx-char MJXc-TeX-main-I" style="padding-top: 0.372em; padding-bottom: 0.298em;">t</span></span></span></span></span></span></span></span></span>,
and an optional sequence of <i ><a href='#nt:filename'>filename</a></i><span class='textit'>s</span> (<a href='#fs.path.generic'>[fs.path.generic]</a>)<a class='hidden_link' href='#3.sentence-2'>.</a></div> <div id='3.sentence-3' class='sentence'>The maximum number of elements in the sequence is
operating system dependent (<a href='fs.conform.os'>[fs.conform.os]</a>)<a class='hidden_link' href='#3.sentence-3'>.</a></div></div><div class='para' id='4'><div class='marginalizedparent'><a class='marginalized' href='#4'>4</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L11135'>#</a></div><div id='4.sentence-1' class='sentence'>An <a class='hidden_link' href='#def:absolute_path' id='def:absolute_path'><i >absolute path</i></a> is a path that unambiguously
identifies the location of a file without reference to an additional starting
location<a class='hidden_link' href='#4.sentence-1'>.</a></div> <div id='4.sentence-2' class='sentence'>The elements of a path that determine if it is absolute are
operating system dependent<a class='hidden_link' href='#4.sentence-2'>.</a></div> <div id='4.sentence-3' class='sentence'>A <a class='hidden_link' href='#def:relative_path' id='def:relative_path'><i >relative path</i></a> is
a path that is not absolute, and as such, only unambiguously
identifies the location of a file when resolved relative to
an implied starting location<a class='hidden_link' href='#4.sentence-3'>.</a></div> <div id='4.sentence-4' class='sentence'>The elements of a path that determine if it is
relative are operating system dependent<a class='hidden_link' href='#4.sentence-4'>.</a></div> <div id='4.note-1' class='note'>[<span style='white-space:nowrap'> </span><a class='note_link' href='#4.note-1'><span class='textit'>Note</span></a><div class='noteBody'><span class='textit'>:</span> <div id='4.sentence-5' class='sentence'>Pathnames “<a class='hidden_link' href='#4.sentence-5'>.</a></div> <div id='4.sentence-6' class='sentence'>” and “<a class='hidden_link' href='#4.sentence-6'>.</a></div> <div id='4.sentence-7' class='sentence'><a class='hidden_link' href='#4.sentence-7'>.</a></div> <div id='4.sentence-8' class='sentence'>” are relative paths<a class='hidden_link' href='#4.sentence-8'>.</a></div> —<span style='white-space:nowrap'> </span><i>end note</i></div><span style='white-space:nowrap'> </span>]</div> </div><div class='para' id='5'><div class='marginalizedparent'><a class='marginalized' href='#5'>5</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L11149'>#</a></div><div id='5.sentence-1' class='sentence'>A <a class='hidden_link' href='#def:pathname' id='def:pathname'><i >pathname</i></a> is
a character string that represents the name of a path<a class='hidden_link' href='#5.sentence-1'>.</a></div> <div id='5.sentence-2' class='sentence'>Pathnames are
formatted according to the generic pathname format grammar (<a href='#fs.path.generic'>[fs.path.generic]</a>)
or according to an
operating system dependent
<a class='hidden_link' href='#def:native_pathname_format' id='def:native_pathname_format'><i >native pathname format</i></a> accepted by the host operating system<a class='hidden_link' href='#5.sentence-2'>.</a></div></div><div class='para' id='6'><div class='marginalizedparent'><a class='marginalized' href='#6'>6</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L11157'>#</a></div><div id='6.sentence-1' class='sentence'><a class='hidden_link' href='#def:pathname_resolution' id='def:pathname_resolution'><i >Pathname resolution</i></a>
is the operating system dependent mechanism for resolving
a pathname to a particular file in a file hierarchy<a class='hidden_link' href='#6.sentence-1'>.</a></div> <div id='6.sentence-2' class='sentence'>There may be multiple
pathnames that resolve to the same file<a class='hidden_link' href='#6.sentence-2'>.</a></div> <div id='6.example-1' class='example'>[<span style='white-space:nowrap'> </span><a class='example_link' href='#6.example-1'><span class='textit'>Example</span></a><div class='exampleBody'><span class='textit'>:</span> <div id='6.sentence-3' class='sentence'>POSIX specifies the mechanism in section 4.11, Pathname resolution<a class='hidden_link' href='#6.sentence-3'>.</a></div> —<span style='white-space:nowrap'> </span><i>end example</i></div><span style='white-space:nowrap'> </span>]</div> <pre class='codeblock'>
<span class='keyword'>namespace</span> std<span class='operator'>:</span><span class='operator'>:</span>filesystem <span class='curlybracket'>{</span>
  <span class='keyword'>class</span> path <span class='curlybracket'>{</span>
  <span class='keyword'>public</span><span class='operator'>:</span>
    <span class='keyword'>using</span> value_type  <span class='operator'>=</span> <span class='textit'><span class='texttt'>see below</span></span>;
    <span class='keyword'>using</span> string_type <span class='operator'>=</span> basic_string<span class='anglebracket'>&lt;</span>value_type<span class='anglebracket'>&gt;</span>;
    <span class='keyword'>static</span> <span class='keyword'>constexpr</span> value_type preferred_separator <span class='operator'>=</span> <span class='textit'><span class='texttt'>see below</span></span>;

    <span class='comment'>// <a href='fs.enum.path.format'>[fs.enum.path.format]</a>, enumeration <span class='tcode_in_codeblock'>format</span></span>
    <span class='keyword'>enum</span> format;

    <span class='comment'>// <a href='#fs.path.construct'>[fs.path.construct]</a>, constructors and destructor</span>
    path<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>noexcept</span>;
    path<span class='parenthesis'>(</span><span class='keyword'>const</span> path<span class='operator'>&amp;</span> p<span class='parenthesis'>)</span>;
    path<span class='parenthesis'>(</span>path<span class='operator'>&amp;</span><span class='operator'>&amp;</span> p<span class='parenthesis'>)</span> <span class='keyword'>noexcept</span>;
    path<span class='parenthesis'>(</span>string_type<span class='operator'>&amp;</span><span class='operator'>&amp;</span> source, format fmt <span class='operator'>=</span> auto_format<span class='parenthesis'>)</span>;
    <span class='keyword'>template</span><span class='anglebracket'>&lt;</span><span class='keyword'>class</span> Source<span class='anglebracket'>&gt;</span>
      path<span class='parenthesis'>(</span><span class='keyword'>const</span> Source<span class='operator'>&amp;</span> source, format fmt <span class='operator'>=</span> auto_format<span class='parenthesis'>)</span>;
    <span class='keyword'>template</span><span class='anglebracket'>&lt;</span><span class='keyword'>class</span> InputIterator<span class='anglebracket'>&gt;</span>
      path<span class='parenthesis'>(</span>InputIterator first, InputIterator last, format fmt <span class='operator'>=</span> auto_format<span class='parenthesis'>)</span>;
    <span class='keyword'>template</span><span class='anglebracket'>&lt;</span><span class='keyword'>class</span> Source<span class='anglebracket'>&gt;</span>
      path<span class='parenthesis'>(</span><span class='keyword'>const</span> Source<span class='operator'>&amp;</span> source, <span class='keyword'>const</span> locale<span class='operator'>&amp;</span> loc, format fmt <span class='operator'>=</span> auto_format<span class='parenthesis'>)</span>;
    <span class='keyword'>template</span><span class='anglebracket'>&lt;</span><span class='keyword'>class</span> InputIterator<span class='anglebracket'>&gt;</span>
      path<span class='parenthesis'>(</span>InputIterator first, InputIterator last, <span class='keyword'>const</span> locale<span class='operator'>&amp;</span> loc, format fmt <span class='operator'>=</span> auto_format<span class='parenthesis'>)</span>;
    <span class='operator'>~</span>path<span class='parenthesis'>(</span><span class='parenthesis'>)</span>;

    <span class='comment'>// <a href='#fs.path.assign'>[fs.path.assign]</a>, assignments</span>
    path<span class='operator'>&amp;</span> <span class='keyword'>operator</span><span class='operator'>=</span><span class='parenthesis'>(</span><span class='keyword'>const</span> path<span class='operator'>&amp;</span> p<span class='parenthesis'>)</span>;
    path<span class='operator'>&amp;</span> <span class='keyword'>operator</span><span class='operator'>=</span><span class='parenthesis'>(</span>path<span class='operator'>&amp;</span><span class='operator'>&amp;</span> p<span class='parenthesis'>)</span> <span class='keyword'>noexcept</span>;
    path<span class='operator'>&amp;</span> <span class='keyword'>operator</span><span class='operator'>=</span><span class='parenthesis'>(</span>string_type<span class='operator'>&amp;</span><span class='operator'>&amp;</span> source<span class='parenthesis'>)</span>;
    path<span class='operator'>&amp;</span> assign<span class='parenthesis'>(</span>string_type<span class='operator'>&amp;</span><span class='operator'>&amp;</span> source<span class='parenthesis'>)</span>;
    <span class='keyword'>template</span><span class='anglebracket'>&lt;</span><span class='keyword'>class</span> Source<span class='anglebracket'>&gt;</span>
      path<span class='operator'>&amp;</span> <span class='keyword'>operator</span><span class='operator'>=</span><span class='parenthesis'>(</span><span class='keyword'>const</span> Source<span class='operator'>&amp;</span> source<span class='parenthesis'>)</span>;
    <span class='keyword'>template</span><span class='anglebracket'>&lt;</span><span class='keyword'>class</span> Source<span class='anglebracket'>&gt;</span>
      path<span class='operator'>&amp;</span> assign<span class='parenthesis'>(</span><span class='keyword'>const</span> Source<span class='operator'>&amp;</span> source<span class='parenthesis'>)</span>;
    <span class='keyword'>template</span><span class='anglebracket'>&lt;</span><span class='keyword'>class</span> InputIterator<span class='anglebracket'>&gt;</span>
      path<span class='operator'>&amp;</span> assign<span class='parenthesis'>(</span>InputIterator first, InputIterator last<span class='parenthesis'>)</span>;

    <span class='comment'>// <a href='#fs.path.append'>[fs.path.append]</a>, appends</span>
    path<span class='operator'>&amp;</span> <span class='keyword'>operator</span><span class='operator'>/</span><span class='operator'>=</span><span class='parenthesis'>(</span><span class='keyword'>const</span> path<span class='operator'>&amp;</span> p<span class='parenthesis'>)</span>;
    <span class='keyword'>template</span><span class='anglebracket'>&lt;</span><span class='keyword'>class</span> Source<span class='anglebracket'>&gt;</span>
      path<span class='operator'>&amp;</span> <span class='keyword'>operator</span><span class='operator'>/</span><span class='operator'>=</span><span class='parenthesis'>(</span><span class='keyword'>const</span> Source<span class='operator'>&amp;</span> source<span class='parenthesis'>)</span>;
    <span class='keyword'>template</span><span class='anglebracket'>&lt;</span><span class='keyword'>class</span> Source<span class='anglebracket'>&gt;</span>
      path<span class='operator'>&amp;</span> append<span class='parenthesis'>(</span><span class='keyword'>const</span> Source<span class='operator'>&amp;</span> source<span class='parenthesis'>)</span>;
    <span class='keyword'>template</span><span class='anglebracket'>&lt;</span><span class='keyword'>class</span> InputIterator<span class='anglebracket'>&gt;</span>
      path<span class='operator'>&amp;</span> append<span class='parenthesis'>(</span>InputIterator first, InputIterator last<span class='parenthesis'>)</span>;

    <span class='comment'>// <a href='#fs.path.concat'>[fs.path.concat]</a>, concatenation</span>
    path<span class='operator'>&amp;</span> <span class='keyword'>operator</span><span class='operator'>+</span><span class='operator'>=</span><span class='parenthesis'>(</span><span class='keyword'>const</span> path<span class='operator'>&amp;</span> x<span class='parenthesis'>)</span>;
    path<span class='operator'>&amp;</span> <span class='keyword'>operator</span><span class='operator'>+</span><span class='operator'>=</span><span class='parenthesis'>(</span><span class='keyword'>const</span> string_type<span class='operator'>&amp;</span> x<span class='parenthesis'>)</span>;
    path<span class='operator'>&amp;</span> <span class='keyword'>operator</span><span class='operator'>+</span><span class='operator'>=</span><span class='parenthesis'>(</span>basic_string_view<span class='anglebracket'>&lt;</span>value_type<span class='anglebracket'>&gt;</span> x<span class='parenthesis'>)</span>;
    path<span class='operator'>&amp;</span> <span class='keyword'>operator</span><span class='operator'>+</span><span class='operator'>=</span><span class='parenthesis'>(</span><span class='keyword'>const</span> value_type<span class='operator'>*</span> x<span class='parenthesis'>)</span>;
    path<span class='operator'>&amp;</span> <span class='keyword'>operator</span><span class='operator'>+</span><span class='operator'>=</span><span class='parenthesis'>(</span>value_type x<span class='parenthesis'>)</span>;
    <span class='keyword'>template</span><span class='anglebracket'>&lt;</span><span class='keyword'>class</span> Source<span class='anglebracket'>&gt;</span>
      path<span class='operator'>&amp;</span> <span class='keyword'>operator</span><span class='operator'>+</span><span class='operator'>=</span><span class='parenthesis'>(</span><span class='keyword'>const</span> Source<span class='operator'>&amp;</span> x<span class='parenthesis'>)</span>;
    <span class='keyword'>template</span><span class='anglebracket'>&lt;</span><span class='keyword'>class</span> EcharT<span class='anglebracket'>&gt;</span>
      path<span class='operator'>&amp;</span> <span class='keyword'>operator</span><span class='operator'>+</span><span class='operator'>=</span><span class='parenthesis'>(</span>EcharT x<span class='parenthesis'>)</span>;
    <span class='keyword'>template</span><span class='anglebracket'>&lt;</span><span class='keyword'>class</span> Source<span class='anglebracket'>&gt;</span>
      path<span class='operator'>&amp;</span> concat<span class='parenthesis'>(</span><span class='keyword'>const</span> Source<span class='operator'>&amp;</span> x<span class='parenthesis'>)</span>;
    <span class='keyword'>template</span><span class='anglebracket'>&lt;</span><span class='keyword'>class</span> InputIterator<span class='anglebracket'>&gt;</span>
      path<span class='operator'>&amp;</span> concat<span class='parenthesis'>(</span>InputIterator first, InputIterator last<span class='parenthesis'>)</span>;

    <span class='comment'>// <a href='#fs.path.modifiers'>[fs.path.modifiers]</a>, modifiers</span>
    <span class='keyword'>void</span>  clear<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>noexcept</span>;
    path<span class='operator'>&amp;</span> make_preferred<span class='parenthesis'>(</span><span class='parenthesis'>)</span>;
    path<span class='operator'>&amp;</span> remove_filename<span class='parenthesis'>(</span><span class='parenthesis'>)</span>;
    path<span class='operator'>&amp;</span> replace_filename<span class='parenthesis'>(</span><span class='keyword'>const</span> path<span class='operator'>&amp;</span> replacement<span class='parenthesis'>)</span>;
    path<span class='operator'>&amp;</span> replace_extension<span class='parenthesis'>(</span><span class='keyword'>const</span> path<span class='operator'>&amp;</span> replacement <span class='operator'>=</span> path<span class='parenthesis'>(</span><span class='parenthesis'>)</span><span class='parenthesis'>)</span>;
    <span class='keyword'>void</span>  swap<span class='parenthesis'>(</span>path<span class='operator'>&amp;</span> rhs<span class='parenthesis'>)</span> <span class='keyword'>noexcept</span>;

    <span class='comment'>// <a href='#fs.path.nonmember'>[fs.path.nonmember]</a>, non-member operators</span>
    <span class='keyword'>friend</span> <span class='keyword'>bool</span> <span class='keyword'>operator</span><span class='operator'>=</span><span class='operator'>=</span><span class='parenthesis'>(</span><span class='keyword'>const</span> path<span class='operator'>&amp;</span> lhs, <span class='keyword'>const</span> path<span class='operator'>&amp;</span> rhs<span class='parenthesis'>)</span> <span class='keyword'>noexcept</span>;
    <span class='keyword'>friend</span> <span class='keyword'>bool</span> <span class='keyword'>operator</span><span class='operator'>!</span><span class='operator'>=</span><span class='parenthesis'>(</span><span class='keyword'>const</span> path<span class='operator'>&amp;</span> lhs, <span class='keyword'>const</span> path<span class='operator'>&amp;</span> rhs<span class='parenthesis'>)</span> <span class='keyword'>noexcept</span>;
    <span class='keyword'>friend</span> <span class='keyword'>bool</span> <span class='keyword'>operator</span><span class='anglebracket'>&lt;</span> <span class='parenthesis'>(</span><span class='keyword'>const</span> path<span class='operator'>&amp;</span> lhs, <span class='keyword'>const</span> path<span class='operator'>&amp;</span> rhs<span class='parenthesis'>)</span> <span class='keyword'>noexcept</span>;
    <span class='keyword'>friend</span> <span class='keyword'>bool</span> <span class='keyword'>operator</span><span class='anglebracket'>&lt;</span><span class='operator'>=</span><span class='parenthesis'>(</span><span class='keyword'>const</span> path<span class='operator'>&amp;</span> lhs, <span class='keyword'>const</span> path<span class='operator'>&amp;</span> rhs<span class='parenthesis'>)</span> <span class='keyword'>noexcept</span>;
    <span class='keyword'>friend</span> <span class='keyword'>bool</span> <span class='keyword'>operator</span><span class='anglebracket'>&gt;</span> <span class='parenthesis'>(</span><span class='keyword'>const</span> path<span class='operator'>&amp;</span> lhs, <span class='keyword'>const</span> path<span class='operator'>&amp;</span> rhs<span class='parenthesis'>)</span> <span class='keyword'>noexcept</span>;
    <span class='keyword'>friend</span> <span class='keyword'>bool</span> <span class='keyword'>operator</span><span class='anglebracket'>&gt;</span><span class='operator'>=</span><span class='parenthesis'>(</span><span class='keyword'>const</span> path<span class='operator'>&amp;</span> lhs, <span class='keyword'>const</span> path<span class='operator'>&amp;</span> rhs<span class='parenthesis'>)</span> <span class='keyword'>noexcept</span>;

    <span class='keyword'>friend</span> path <span class='keyword'>operator</span><span class='operator'>/</span> <span class='parenthesis'>(</span><span class='keyword'>const</span> path<span class='operator'>&amp;</span> lhs, <span class='keyword'>const</span> path<span class='operator'>&amp;</span> rhs<span class='parenthesis'>)</span>;

    <span class='comment'>// <a href='#fs.path.native.obs'>[fs.path.native.obs]</a>, native format observers</span>
    <span class='keyword'>const</span> string_type<span class='operator'>&amp;</span> native<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span> <span class='keyword'>noexcept</span>;
    <span class='keyword'>const</span> value_type<span class='operator'>*</span>  c_str<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span> <span class='keyword'>noexcept</span>;
    <span class='keyword'>operator</span> string_type<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;

    <span class='keyword'>template</span><span class='anglebracket'>&lt;</span><span class='keyword'>class</span> EcharT, <span class='keyword'>class</span> traits <span class='operator'>=</span> char_traits<span class='anglebracket'>&lt;</span>EcharT<span class='anglebracket'>&gt;</span>,
             <span class='keyword'>class</span> Allocator <span class='operator'>=</span> allocator<span class='anglebracket'>&lt;</span>EcharT<span class='anglebracket'>&gt;</span><span class='anglebracket'>&gt;</span>
      basic_string<span class='anglebracket'>&lt;</span>EcharT, traits, Allocator<span class='anglebracket'>&gt;</span>
        string<span class='parenthesis'>(</span><span class='keyword'>const</span> Allocator<span class='operator'>&amp;</span> a <span class='operator'>=</span> Allocator<span class='parenthesis'>(</span><span class='parenthesis'>)</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
    std<span class='operator'>:</span><span class='operator'>:</span>string    string<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
    std<span class='operator'>:</span><span class='operator'>:</span>wstring   wstring<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
    std<span class='operator'>:</span><span class='operator'>:</span>u8string  u8string<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
    std<span class='operator'>:</span><span class='operator'>:</span>u16string u16string<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
    std<span class='operator'>:</span><span class='operator'>:</span>u32string u32string<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;

    <span class='comment'>// <a href='#fs.path.generic.obs'>[fs.path.generic.obs]</a>, generic format observers</span>
    <span class='keyword'>template</span><span class='anglebracket'>&lt;</span><span class='keyword'>class</span> EcharT, <span class='keyword'>class</span> traits <span class='operator'>=</span> char_traits<span class='anglebracket'>&lt;</span>EcharT<span class='anglebracket'>&gt;</span>,
             <span class='keyword'>class</span> Allocator <span class='operator'>=</span> allocator<span class='anglebracket'>&lt;</span>EcharT<span class='anglebracket'>&gt;</span><span class='anglebracket'>&gt;</span>
      basic_string<span class='anglebracket'>&lt;</span>EcharT, traits, Allocator<span class='anglebracket'>&gt;</span>
        generic_string<span class='parenthesis'>(</span><span class='keyword'>const</span> Allocator<span class='operator'>&amp;</span> a <span class='operator'>=</span> Allocator<span class='parenthesis'>(</span><span class='parenthesis'>)</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
    std<span class='operator'>:</span><span class='operator'>:</span>string    generic_string<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
    std<span class='operator'>:</span><span class='operator'>:</span>wstring   generic_wstring<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
    std<span class='operator'>:</span><span class='operator'>:</span>u8string  generic_u8string<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
    std<span class='operator'>:</span><span class='operator'>:</span>u16string generic_u16string<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
    std<span class='operator'>:</span><span class='operator'>:</span>u32string generic_u32string<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;

    <span class='comment'>// <a href='#fs.path.compare'>[fs.path.compare]</a>, compare</span>
    <span class='keyword'>int</span> compare<span class='parenthesis'>(</span><span class='keyword'>const</span> path<span class='operator'>&amp;</span> p<span class='parenthesis'>)</span> <span class='keyword'>const</span> <span class='keyword'>noexcept</span>;
    <span class='keyword'>int</span> compare<span class='parenthesis'>(</span><span class='keyword'>const</span> string_type<span class='operator'>&amp;</span> s<span class='parenthesis'>)</span> <span class='keyword'>const</span>;
    <span class='keyword'>int</span> compare<span class='parenthesis'>(</span>basic_string_view<span class='anglebracket'>&lt;</span>value_type<span class='anglebracket'>&gt;</span> s<span class='parenthesis'>)</span> <span class='keyword'>const</span>;
    <span class='keyword'>int</span> compare<span class='parenthesis'>(</span><span class='keyword'>const</span> value_type<span class='operator'>*</span> s<span class='parenthesis'>)</span> <span class='keyword'>const</span>;

    <span class='comment'>// <a href='#fs.path.decompose'>[fs.path.decompose]</a>, decomposition</span>
    path root_name<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
    path root_directory<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
    path root_path<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
    path relative_path<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
    path parent_path<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
    path filename<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
    path stem<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
    path extension<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;

    <span class='comment'>// <a href='#fs.path.query'>[fs.path.query]</a>, query</span>
    <span class='squarebracket'>[</span><span class='squarebracket'>[</span>nodiscard<span class='squarebracket'>]</span><span class='squarebracket'>]</span> <span class='keyword'>bool</span> empty<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span> <span class='keyword'>noexcept</span>;
    <span class='keyword'>bool</span> has_root_name<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
    <span class='keyword'>bool</span> has_root_directory<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
    <span class='keyword'>bool</span> has_root_path<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
    <span class='keyword'>bool</span> has_relative_path<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
    <span class='keyword'>bool</span> has_parent_path<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
    <span class='keyword'>bool</span> has_filename<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
    <span class='keyword'>bool</span> has_stem<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
    <span class='keyword'>bool</span> has_extension<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
    <span class='keyword'>bool</span> is_absolute<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
    <span class='keyword'>bool</span> is_relative<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;

    <span class='comment'>// <a href='#fs.path.gen'>[fs.path.gen]</a>, generation</span>
    path lexically_normal<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
    path lexically_relative<span class='parenthesis'>(</span><span class='keyword'>const</span> path<span class='operator'>&amp;</span> base<span class='parenthesis'>)</span> <span class='keyword'>const</span>;
    path lexically_proximate<span class='parenthesis'>(</span><span class='keyword'>const</span> path<span class='operator'>&amp;</span> base<span class='parenthesis'>)</span> <span class='keyword'>const</span>;

    <span class='comment'>// <a href='#fs.path.itr'>[fs.path.itr]</a>, iterators</span>
    <span class='keyword'>class</span> iterator;
    <span class='keyword'>using</span> const_iterator <span class='operator'>=</span> iterator;

    iterator begin<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
    iterator end<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;

    <span class='comment'>// <a href='#fs.path.io'>[fs.path.io]</a>, <span class='tcode_in_codeblock'>path</span> inserter and extractor</span>
    <span class='keyword'>template</span><span class='anglebracket'>&lt;</span><span class='keyword'>class</span> charT, <span class='keyword'>class</span> traits<span class='anglebracket'>&gt;</span>
      <span class='keyword'>friend</span> basic_ostream<span class='anglebracket'>&lt;</span>charT, traits<span class='anglebracket'>&gt;</span><span class='operator'>&amp;</span>
        <span class='keyword'>operator</span><span class='anglebracket'>&lt;</span><span class='anglebracket'>&lt;</span><span class='parenthesis'>(</span>basic_ostream<span class='anglebracket'>&lt;</span>charT, traits<span class='anglebracket'>&gt;</span><span class='operator'>&amp;</span> os, <span class='keyword'>const</span> path<span class='operator'>&amp;</span> p<span class='parenthesis'>)</span>;
    <span class='keyword'>template</span><span class='anglebracket'>&lt;</span><span class='keyword'>class</span> charT, <span class='keyword'>class</span> traits<span class='anglebracket'>&gt;</span>
      <span class='keyword'>friend</span> basic_istream<span class='anglebracket'>&lt;</span>charT, traits<span class='anglebracket'>&gt;</span><span class='operator'>&amp;</span>
        <span class='keyword'>operator</span><span class='anglebracket'>&gt;</span><span class='anglebracket'>&gt;</span><span class='parenthesis'>(</span>basic_istream<span class='anglebracket'>&lt;</span>charT, traits<span class='anglebracket'>&gt;</span><span class='operator'>&amp;</span> is, path<span class='operator'>&amp;</span> p<span class='parenthesis'>)</span>;
  <span class='curlybracket'>}</span>;
<span class='curlybracket'>}</span>
</pre><span class='indexparent'><a class='index' id='lib:value_type,path'></a></span><span class='indexparent'><a class='index' id='lib:path,value_type'></a></span></div><div class='para' id='7'><div class='marginalizedparent'><a class='marginalized' href='#7'>7</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L11324'>#</a></div><div id='7.sentence-1' class='sentence'><span class='texttt'>value_&shy;type</span> is a <span class='texttt'><span class='keyword'>typedef</span></span> for the
operating system dependent encoded character type used to represent pathnames<a class='hidden_link' href='#7.sentence-1'>.</a></div> <span class='indexparent'><a class='index' id='lib:preferred_separator,path'></a></span><span class='indexparent'><a class='index' id='lib:path,preferred_separator'></a></span></div><div class='para' id='8'><div class='marginalizedparent'><a class='marginalized' href='#8'>8</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L11329'>#</a></div><div id='8.sentence-1' class='sentence'>The value of the <span class='texttt'>preferred_&shy;separator</span> member
is the operating system dependent <i ><a href='#nt:preferred-separator'>preferred-separator</a></i> character (<a href='#fs.path.generic'>[fs.path.generic]</a>)<a class='hidden_link' href='#8.sentence-1'>.</a></div></div><div class='para' id='9'><div class='marginalizedparent'><a class='marginalized' href='#9'>9</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L11333'>#</a></div><div id='9.example-1' class='example'>[<span style='white-space:nowrap'> </span><a class='example_link' href='#9.example-1'><span class='textit'>Example</span></a><div class='exampleBody'><span class='textit'>:</span> <div id='9.sentence-1' class='sentence'>For POSIX-based operating systems,
<span class='texttt'>value_&shy;type</span> is <span class='texttt'><span class='keyword'>char</span></span> and
<span class='texttt'>preferred_&shy;separator</span> is the slash character (<span class='texttt'><span class='literal'>'/'</span></span>)<a class='hidden_link' href='#9.sentence-1'>.</a></div> <div id='9.sentence-2' class='sentence'>For Windows-based operating systems,
<span class='texttt'>value_&shy;type</span> is <span class='texttt'><span class='keyword'>wchar_&shy;t</span></span> and
<span class='texttt'>preferred_&shy;separator</span> is the backslash character (<span class='texttt'><span class='literal'>L'\\'</span></span>)<a class='hidden_link' href='#9.sentence-2'>.</a></div> —<span style='white-space:nowrap'> </span><i>end example</i></div><span style='white-space:nowrap'> </span>]</div> </div><div id='fs.path.generic' class='section'><h4 ><a class='secnum' href='#fs.path.generic' style='min-width:118pt'>28.11.7.1</a> Generic pathname format <a class='abbr_ref' href='fs.path.generic'>[fs.path.generic]</a></h4><pre class='ncbnf'><a class='nontermdef' href='#nt:pathname' id='nt:pathname'>pathname:</a>
&#9;<i ><a href='#nt:root-name'>root-name</a></i><span class="mjx-chtml"><span class="mjx-math" aria-label="_\mathit{opt}"><span class="mjx-mrow" aria-hidden="true"><span class="mjx-msubsup"><span class="mjx-base"><span class="mjx-mi"><span class="mjx-char"></span></span></span><span class="mjx-sub" style="font-size: 70.7%; vertical-align: -0.212em; padding-right: 0.071em;"><span class="mjx-texatom"><span class="mjx-mrow"><span class="mjx-mi"><span class="mjx-char MJXc-TeX-main-I" style="padding-top: 0.225em; padding-bottom: 0.298em;">o</span></span><span class="mjx-mi"><span class="mjx-char MJXc-TeX-main-I" style="padding-top: 0.225em; padding-bottom: 0.446em;">p</span></span><span class="mjx-mi"><span class="mjx-char MJXc-TeX-main-I" style="padding-top: 0.372em; padding-bottom: 0.298em;">t</span></span></span></span></span></span></span></span></span> <i ><a href='#nt:root-directory'>root-directory</a></i><span class="mjx-chtml"><span class="mjx-math" aria-label="_\mathit{opt}"><span class="mjx-mrow" aria-hidden="true"><span class="mjx-msubsup"><span class="mjx-base"><span class="mjx-mi"><span class="mjx-char"></span></span></span><span class="mjx-sub" style="font-size: 70.7%; vertical-align: -0.212em; padding-right: 0.071em;"><span class="mjx-texatom"><span class="mjx-mrow"><span class="mjx-mi"><span class="mjx-char MJXc-TeX-main-I" style="padding-top: 0.225em; padding-bottom: 0.298em;">o</span></span><span class="mjx-mi"><span class="mjx-char MJXc-TeX-main-I" style="padding-top: 0.225em; padding-bottom: 0.446em;">p</span></span><span class="mjx-mi"><span class="mjx-char MJXc-TeX-main-I" style="padding-top: 0.372em; padding-bottom: 0.298em;">t</span></span></span></span></span></span></span></span></span> <i ><a href='#nt:relative-path'>relative-path</a></i>
</pre><pre class='ncbnf'><a class='nontermdef' href='#nt:root-name' id='nt:root-name'>root-name:</a>
&#9;<span class='textnormal'>operating system dependent sequences of characters</span>
&#9;<span class='textnormal'><span class='indexparent'><a class='index' id=':supported_root-names_in_addition_to_any_operating_system_dependent_root-names'></a></span>implementation-defined sequences of characters</span>
</pre><pre class='ncbnf'><a class='nontermdef' href='#nt:root-directory' id='nt:root-directory'>root-directory:</a>
&#9;<i ><a href='#nt:directory-separator'>directory-separator</a></i>
</pre><pre class='ncbnf'><a class='nontermdef' href='#nt:relative-path' id='nt:relative-path'>relative-path:</a>
&#9;<i ><a href='#nt:filename'>filename</a></i>
&#9;<i ><a href='#nt:filename'>filename</a></i> <i ><a href='#nt:directory-separator'>directory-separator</a></i> <i ><a href='#nt:relative-path'>relative-path</a></i>
&#9;<span class='textnormal'>an empty path</span>
</pre><pre class='ncbnf'><a class='nontermdef' href='#nt:filename' id='nt:filename'>filename:</a>
&#9;<span class='textnormal'>non-empty sequence of characters other than <span class='grammarterm'><i ><a href='#nt:directory-separator'>directory-separator</a></i></span> characters</span>
</pre><pre class='ncbnf'><a class='nontermdef' href='#nt:directory-separator' id='nt:directory-separator'>directory-separator:</a>
&#9;<i ><a href='#nt:preferred-separator'>preferred-separator</a></i> <i ><a href='#nt:directory-separator'>directory-separator</a></i><span class="mjx-chtml"><span class="mjx-math" aria-label="_\mathit{opt}"><span class="mjx-mrow" aria-hidden="true"><span class="mjx-msubsup"><span class="mjx-base"><span class="mjx-mi"><span class="mjx-char"></span></span></span><span class="mjx-sub" style="font-size: 70.7%; vertical-align: -0.212em; padding-right: 0.071em;"><span class="mjx-texatom"><span class="mjx-mrow"><span class="mjx-mi"><span class="mjx-char MJXc-TeX-main-I" style="padding-top: 0.225em; padding-bottom: 0.298em;">o</span></span><span class="mjx-mi"><span class="mjx-char MJXc-TeX-main-I" style="padding-top: 0.225em; padding-bottom: 0.446em;">p</span></span><span class="mjx-mi"><span class="mjx-char MJXc-TeX-main-I" style="padding-top: 0.372em; padding-bottom: 0.298em;">t</span></span></span></span></span></span></span></span></span>
&#9;<i ><a href='#nt:fallback-separator'>fallback-separator</a></i> <i ><a href='#nt:directory-separator'>directory-separator</a></i><span class="mjx-chtml"><span class="mjx-math" aria-label="_\mathit{opt}"><span class="mjx-mrow" aria-hidden="true"><span class="mjx-msubsup"><span class="mjx-base"><span class="mjx-mi"><span class="mjx-char"></span></span></span><span class="mjx-sub" style="font-size: 70.7%; vertical-align: -0.212em; padding-right: 0.071em;"><span class="mjx-texatom"><span class="mjx-mrow"><span class="mjx-mi"><span class="mjx-char MJXc-TeX-main-I" style="padding-top: 0.225em; padding-bottom: 0.298em;">o</span></span><span class="mjx-mi"><span class="mjx-char MJXc-TeX-main-I" style="padding-top: 0.225em; padding-bottom: 0.446em;">p</span></span><span class="mjx-mi"><span class="mjx-char MJXc-TeX-main-I" style="padding-top: 0.372em; padding-bottom: 0.298em;">t</span></span></span></span></span></span></span></span></span>
</pre><pre class='ncbnf'><a class='nontermdef' href='#nt:preferred-separator' id='nt:preferred-separator'>preferred-separator:</a>
&#9;<span class='textnormal'>operating system dependent directory separator character</span>
</pre><pre class='ncbnf'><a class='nontermdef' href='#nt:fallback-separator' id='nt:fallback-separator'>fallback-separator:</a>
&#9;<span class='textnormal'><span class='texttt'><span class='operator'>/</span></span>, if <span class='grammarterm'><i ><a href='#nt:preferred-separator'>preferred-separator</a></i></span> is not <span class='texttt'><span class='operator'>/</span></span></span>
</pre><div class='para' id='fs.path.generic-1'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.generic-1'>1</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L11392'>#</a></div><div id='fs.path.generic-1.sentence-1' class='sentence'>A <a class='hidden_link' href='#def:filename' id='def:filename'><i >filename</i></a> is
the name of a file<a class='hidden_link' href='#fs.path.generic-1.sentence-1'>.</a></div> <div id='fs.path.generic-1.sentence-2' class='sentence'>The <a class='hidden_link' href='#def:dot,filename' id='def:dot,filename'><i >dot</i></a> and <a class='hidden_link' href='#def:dot-dot,filename' id='def:dot-dot,filename'><i >dot-dot</i></a> filenames,
consisting solely of one and two period characters respectively,
have special meaning<a class='hidden_link' href='#fs.path.generic-1.sentence-2'>.</a></div> <div id='fs.path.generic-1.sentence-3' class='sentence'>The following characteristics of filenames are operating system dependent:
<ul class='itemize'><li id='fs.path.generic-1.1'><div class='marginalizedparent' style='left:-7em'><a class='marginalized' href='#fs.path.generic-1.1'>(1.1)</a></div><div id='fs.path.generic-1.1.sentence-1' class='sentence'>The permitted characters<a class='hidden_link' href='#fs.path.generic-1.1.sentence-1'>.</a></div> <div id='fs.path.generic-1.1.example-1' class='example'>[<span style='white-space:nowrap'> </span><a class='example_link' href='#fs.path.generic-1.1.example-1'><span class='textit'>Example</span></a><div class='exampleBody'><span class='textit'>:</span> <div id='fs.path.generic-1.1.sentence-2' class='sentence'>Some operating systems prohibit
      the ASCII control characters (0x00 – 0x1F) in filenames<a class='hidden_link' href='#fs.path.generic-1.1.sentence-2'>.</a></div> —<span style='white-space:nowrap'> </span><i>end example</i></div><span style='white-space:nowrap'> </span>]</div>  <div id='fs.path.generic-1.1.note-1' class='note'>[<span style='white-space:nowrap'> </span><a class='note_link' href='#fs.path.generic-1.1.note-1'><span class='textit'>Note</span></a><div class='noteBody'><span class='textit'>:</span> <div id='fs.path.generic-1.1.sentence-3' class='sentence'>For wide portability, users may wish to limit <i ><a href='#nt:filename'>filename</a></i>
characters to the POSIX Portable Filename Character Set: <br/></div> <div id='fs.path.generic-1.1.sentence-4' class='sentence'><span class='texttt'>A B C D E F G H I J K L M N O P Q R S T U V W X Y Z</span> <br/></div> <div id='fs.path.generic-1.1.sentence-5' class='sentence'><span class='texttt'>a b c d e f g h i j k l m n o p q r s t u v w x y z</span> <br/></div> <div id='fs.path.generic-1.1.sentence-6' class='sentence'><span class='texttt'><span class='literal'>0</span> <span class='literal'>1</span> <span class='literal'>2</span> <span class='literal'>3</span> <span class='literal'>4</span> <span class='literal'>5</span> <span class='literal'>6</span> <span class='literal'>7</span> <span class='literal'>8</span> <span class='literal'>9</span> <span class='operator'>.</span> _&shy; <span class='operator'>-</span></span></div> —<span style='white-space:nowrap'> </span><i>end note</i></div><span style='white-space:nowrap'> </span>]</div> </li><li id='fs.path.generic-1.2'><div class='marginalizedparent' style='left:-7em'><a class='marginalized' href='#fs.path.generic-1.2'>(1.2)</a></div><div id='fs.path.generic-1.2.sentence-1' class='sentence'>The maximum permitted length<a class='hidden_link' href='#fs.path.generic-1.2.sentence-1'>.</a></div></li><li id='fs.path.generic-1.3'><div class='marginalizedparent' style='left:-7em'><a class='marginalized' href='#fs.path.generic-1.3'>(1.3)</a></div><div id='fs.path.generic-1.3.sentence-1' class='sentence'>Filenames that are not permitted<a class='hidden_link' href='#fs.path.generic-1.3.sentence-1'>.</a></div></li><li id='fs.path.generic-1.4'><div class='marginalizedparent' style='left:-7em'><a class='marginalized' href='#fs.path.generic-1.4'>(1.4)</a></div><div id='fs.path.generic-1.4.sentence-1' class='sentence'>Filenames that have special meaning<a class='hidden_link' href='#fs.path.generic-1.4.sentence-1'>.</a></div></li><li id='fs.path.generic-1.5'><div class='marginalizedparent' style='left:-7em'><a class='marginalized' href='#fs.path.generic-1.5'>(1.5)</a></div><div id='fs.path.generic-1.5.sentence-1' class='sentence'>Case awareness and sensitivity during path resolution<a class='hidden_link' href='#fs.path.generic-1.5.sentence-1'>.</a></div></li><li id='fs.path.generic-1.6'><div class='marginalizedparent' style='left:-7em'><a class='marginalized' href='#fs.path.generic-1.6'>(1.6)</a></div><div id='fs.path.generic-1.6.sentence-1' class='sentence'>Special rules that may apply to file types other than regular
  files, such as directories<a class='hidden_link' href='#fs.path.generic-1.6.sentence-1'>.</a></div></li></ul></div></div><div class='para' id='fs.path.generic-2'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.generic-2'>2</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L11416'>#</a></div><div id='fs.path.generic-2.sentence-1' class='sentence'>Except in a <i ><a href='#nt:root-name'>root-name</a></i>,
multiple successive <i ><a href='#nt:directory-separator'>directory-separator</a></i> characters are considered to
be the same as one <i ><a href='#nt:directory-separator'>directory-separator</a></i> character<a class='hidden_link' href='#fs.path.generic-2.sentence-1'>.</a></div></div><div class='para' id='fs.path.generic-3'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.generic-3'>3</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L11421'>#</a></div><div id='fs.path.generic-3.sentence-1' class='sentence'>The dot filename is treated as a reference to the current directory<a class='hidden_link' href='#fs.path.generic-3.sentence-1'>.</a></div> <div id='fs.path.generic-3.sentence-2' class='sentence'>The dot-dot filename is treated as a reference to the parent directory<a class='hidden_link' href='#fs.path.generic-3.sentence-2'>.</a></div> <div id='fs.path.generic-3.sentence-3' class='sentence'>What the dot-dot filename refers to
relative to <i ><a href='#nt:root-directory'>root-directory</a></i> is <span class='indexparent'><a class='index' id=':meaning_of_dot-dot_in_root-directory'></a></span>implementation-defined<a class='hidden_link' href='#fs.path.generic-3.sentence-3'>.</a></div> <div id='fs.path.generic-3.sentence-4' class='sentence'>Specific filenames may have special meanings for a particular operating system<a class='hidden_link' href='#fs.path.generic-3.sentence-4'>.</a></div></div><div class='para' id='fs.path.generic-4'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.generic-4'>4</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L11428'>#</a></div><div id='fs.path.generic-4.sentence-1' class='sentence'>A <i ><a href='#nt:root-name'>root-name</a></i> identifies the
starting location for pathname resolution (<a href='#fs.class.path'>[fs.class.path]</a>)<a class='hidden_link' href='#fs.path.generic-4.sentence-1'>.</a></div> <div id='fs.path.generic-4.sentence-2' class='sentence'>If there are no operating system dependent <i ><a href='#nt:root-name'>root-name</a></i><span class='textit'>s</span>,
at least one <span class='indexparent'><a class='index' id=':supported_root-names_in_addition_to_any_operating_system_dependent_root-names_'></a></span>implementation-defined <i ><a href='#nt:root-name'>root-name</a></i> is required<a class='hidden_link' href='#fs.path.generic-4.sentence-2'>.</a></div> <div id='fs.path.generic-4.note-1' class='note'>[<span style='white-space:nowrap'> </span><a class='note_link' href='#fs.path.generic-4.note-1'><span class='textit'>Note</span></a><div class='noteBody'><span class='textit'>:</span> <div id='fs.path.generic-4.sentence-3' class='sentence'>Many operating systems define a name
beginning with two <i ><a href='#nt:directory-separator'>directory-separator</a></i> characters
as a <i ><a href='#nt:root-name'>root-name</a></i> that identifies
network or other resource locations<a class='hidden_link' href='#fs.path.generic-4.sentence-3'>.</a></div> <div id='fs.path.generic-4.sentence-4' class='sentence'>Some operating systems
define a single letter followed by a colon
as a drive specifier – a <i ><a href='#nt:root-name'>root-name</a></i>
identifying a specific device such as a disk drive<a class='hidden_link' href='#fs.path.generic-4.sentence-4'>.</a></div> —<span style='white-space:nowrap'> </span><i>end note</i></div><span style='white-space:nowrap'> </span>]</div> </div><div class='para' id='fs.path.generic-5'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.generic-5'>5</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L11443'>#</a></div><div id='fs.path.generic-5.sentence-1' class='sentence'>If a <i ><a href='#nt:root-name'>root-name</a></i> is otherwise ambiguous,
the possibility with the longest sequence of characters is chosen<a class='hidden_link' href='#fs.path.generic-5.sentence-1'>.</a></div> <div id='fs.path.generic-5.note-1' class='note'>[<span style='white-space:nowrap'> </span><a class='note_link' href='#fs.path.generic-5.note-1'><span class='textit'>Note</span></a><div class='noteBody'><span class='textit'>:</span> <div id='fs.path.generic-5.sentence-2' class='sentence'>On a POSIX-like operating system, it is impossible to have a
<i ><a href='#nt:root-name'>root-name</a></i> and a <i ><a href='#nt:relative-path'>relative-path</a></i>
without an intervening <i ><a href='#nt:root-directory'>root-directory</a></i> element<a class='hidden_link' href='#fs.path.generic-5.sentence-2'>.</a></div> —<span style='white-space:nowrap'> </span><i>end note</i></div><span style='white-space:nowrap'> </span>]</div> </div><div class='para' id='fs.path.generic-6'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.generic-6'>6</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L11452'>#</a></div><div id='fs.path.generic-6.sentence-1' class='sentence'><span class='indexparent'><a class='index' id=':path,normalization'></a></span><a class='hidden_link' href='#def:normalization,path' id='def:normalization,path'><i >Normalization</i></a> of a generic format pathname means:</div><div id='fs.path.generic-6.sentence-2' class='sentence'><ol class='enumerate'><li id='fs.path.generic-6.1'><a class='enumerated_item_num' href='#fs.path.generic-6.1'>1.</a><div id='fs.path.generic-6.1.sentence-1' class='sentence'>If the path is empty, stop<a class='hidden_link' href='#fs.path.generic-6.1.sentence-1'>.</a></div></li><li id='fs.path.generic-6.2'><a class='enumerated_item_num' href='#fs.path.generic-6.2'>2.</a><div id='fs.path.generic-6.2.sentence-1' class='sentence'>Replace each slash character in the <i ><a href='#nt:root-name'>root-name</a></i> with a <i ><a href='#nt:preferred-separator'>preferred-separator</a></i><a class='hidden_link' href='#fs.path.generic-6.2.sentence-1'>.</a></div></li><li id='fs.path.generic-6.3'><a class='enumerated_item_num' href='#fs.path.generic-6.3'>3.</a><div id='fs.path.generic-6.3.sentence-1' class='sentence'>Replace each <i ><a href='#nt:directory-separator'>directory-separator</a></i> with a <i ><a href='#nt:preferred-separator'>preferred-separator</a></i><a class='hidden_link' href='#fs.path.generic-6.3.sentence-1'>.</a></div> <div id='fs.path.generic-6.3.note-1' class='note'>[<span style='white-space:nowrap'> </span><a class='note_link' href='#fs.path.generic-6.3.note-1'><span class='textit'>Note</span></a><div class='noteBody'><span class='textit'>:</span> <div id='fs.path.generic-6.3.sentence-2' class='sentence'>The generic pathname grammar (<a href='#fs.path.generic'>[fs.path.generic]</a>) defines <i ><a href='#nt:directory-separator'>directory-separator</a></i> as one or more slashes and <i ><a href='#nt:preferred-separator'>preferred-separator</a></i><span class='textit'>s</span><a class='hidden_link' href='#fs.path.generic-6.3.sentence-2'>.</a></div> —<span style='white-space:nowrap'> </span><i>end note</i></div><span style='white-space:nowrap'> </span>]</div> </li><li id='fs.path.generic-6.4'><a class='enumerated_item_num' href='#fs.path.generic-6.4'>4.</a><div id='fs.path.generic-6.4.sentence-1' class='sentence'>Remove each dot filename and any immediately following <i ><a href='#nt:directory-separator'>directory-separator</a></i><a class='hidden_link' href='#fs.path.generic-6.4.sentence-1'>.</a></div></li><li id='fs.path.generic-6.5'><a class='enumerated_item_num' href='#fs.path.generic-6.5'>5.</a><div id='fs.path.generic-6.5.sentence-1' class='sentence'>As long as any appear, remove a non-dot-dot filename immediately followed by a <i ><a href='#nt:directory-separator'>directory-separator</a></i> and a dot-dot filename, along with any immediately following <i ><a href='#nt:directory-separator'>directory-separator</a></i><a class='hidden_link' href='#fs.path.generic-6.5.sentence-1'>.</a></div></li><li id='fs.path.generic-6.6'><a class='enumerated_item_num' href='#fs.path.generic-6.6'>6.</a><div id='fs.path.generic-6.6.sentence-1' class='sentence'>If there is a <i ><a href='#nt:root-directory'>root-directory</a></i>, remove all dot-dot filenames and any <i ><a href='#nt:directory-separator'>directory-separator</a></i><span class='textit'>s</span> immediately following them<a class='hidden_link' href='#fs.path.generic-6.6.sentence-1'>.</a></div> <div id='fs.path.generic-6.6.note-2' class='note'>[<span style='white-space:nowrap'> </span><a class='note_link' href='#fs.path.generic-6.6.note-2'><span class='textit'>Note</span></a><div class='noteBody'><span class='textit'>:</span> <div id='fs.path.generic-6.6.sentence-2' class='sentence'>These dot-dot filenames attempt to refer to nonexistent parent directories<a class='hidden_link' href='#fs.path.generic-6.6.sentence-2'>.</a></div> —<span style='white-space:nowrap'> </span><i>end note</i></div><span style='white-space:nowrap'> </span>]</div> </li><li id='fs.path.generic-6.7'><a class='enumerated_item_num' href='#fs.path.generic-6.7'>7.</a><div id='fs.path.generic-6.7.sentence-1' class='sentence'>If the last filename is dot-dot, remove any trailing <i ><a href='#nt:directory-separator'>directory-separator</a></i><a class='hidden_link' href='#fs.path.generic-6.7.sentence-1'>.</a></div></li><li id='fs.path.generic-6.8'><a class='enumerated_item_num' href='#fs.path.generic-6.8'>8.</a><div id='fs.path.generic-6.8.sentence-1' class='sentence'>If the path is empty, add a dot<a class='hidden_link' href='#fs.path.generic-6.8.sentence-1'>.</a></div></li></ol></div><div id='fs.path.generic-6.sentence-3' class='sentence'>The result of normalization is a path in <a class='hidden_link' href='#def:normal_form,path' id='def:normal_form,path'><i >normal form</i></a>,
which is said to be <a class='hidden_link' href='#def:normalized' id='def:normalized'><i>normalized</i></a><a class='hidden_link' href='#fs.path.generic-6.sentence-3'>.</a></div> </div></div><div id='fs.path.cvt' class='section'><h4 ><a class='secnum' href='#fs.path.cvt' style='min-width:118pt'>28.11.7.2</a> Conversions <a class='abbr_ref' href='fs.path.cvt'>[fs.path.cvt]</a></h4><div id='fs.path.fmt.cvt' class='section'><h4 ><a class='secnum' href='#fs.path.fmt.cvt' style='min-width:133pt'>28.11.7.2.1</a> Argument format conversions <a class='abbr_ref' href='fs.path.fmt.cvt'>[fs.path.fmt.cvt]</a></h4><div class='para' id='fs.path.fmt.cvt-1'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.fmt.cvt-1'>1</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L11481'>#</a></div><div id='fs.path.fmt.cvt-1.note-1' class='note'>[<span style='white-space:nowrap'> </span><a class='note_link' href='#fs.path.fmt.cvt-1.note-1'><span class='textit'>Note</span></a><div class='noteBody'><span class='textit'>:</span> <div id='fs.path.fmt.cvt-1.sentence-1' class='sentence'>The format conversions described in this subclause
are not applied on POSIX-based operating systems
because on these systems:
<ul class='itemize'><li id='fs.path.fmt.cvt-1.1'><div class='marginalizedparent' style='left:-7em'><a class='marginalized' href='#fs.path.fmt.cvt-1.1'>(1.1)</a></div><div id='fs.path.fmt.cvt-1.1.sentence-1' class='sentence'>The generic format is acceptable as a native path<a class='hidden_link' href='#fs.path.fmt.cvt-1.1.sentence-1'>.</a></div></li><li id='fs.path.fmt.cvt-1.2'><div class='marginalizedparent' style='left:-7em'><a class='marginalized' href='#fs.path.fmt.cvt-1.2'>(1.2)</a></div><div id='fs.path.fmt.cvt-1.2.sentence-1' class='sentence'>There is no need to distinguish between native format and generic format in function arguments<a class='hidden_link' href='#fs.path.fmt.cvt-1.2.sentence-1'>.</a></div></li><li id='fs.path.fmt.cvt-1.3'><div class='marginalizedparent' style='left:-7em'><a class='marginalized' href='#fs.path.fmt.cvt-1.3'>(1.3)</a></div><div id='fs.path.fmt.cvt-1.3.sentence-1' class='sentence'>Paths for regular files and paths for directories share the same syntax<a class='hidden_link' href='#fs.path.fmt.cvt-1.3.sentence-1'>.</a></div></li></ul></div> —<span style='white-space:nowrap'> </span><i>end note</i></div><span style='white-space:nowrap'> </span>]</div> </div><div class='para' id='fs.path.fmt.cvt-2'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.fmt.cvt-2'>2</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L11493'>#</a></div><div id='fs.path.fmt.cvt-2.sentence-1' class='sentence'>Several functions are defined to accept <a class='hidden_link' href='#def:detected-format' id='def:detected-format'><i>detected-format</i></a> arguments,
which are character sequences<a class='hidden_link' href='#fs.path.fmt.cvt-2.sentence-1'>.</a></div> <div id='fs.path.fmt.cvt-2.sentence-2' class='sentence'>A detected-format argument represents a path
using either a pathname in the generic format (<a href='#fs.path.generic'>[fs.path.generic]</a>)
or a pathname in the native format (<a href='#fs.class.path'>[fs.class.path]</a>)<a class='hidden_link' href='#fs.path.fmt.cvt-2.sentence-2'>.</a></div> <div id='fs.path.fmt.cvt-2.sentence-3' class='sentence'>Such an argument is taken to be in the generic format if and only if
it matches the generic format and is not acceptable to the operating system
as a native path<a class='hidden_link' href='#fs.path.fmt.cvt-2.sentence-3'>.</a></div></div><div class='para' id='fs.path.fmt.cvt-3'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.fmt.cvt-3'>3</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L11502'>#</a></div><div id='fs.path.fmt.cvt-3.note-1' class='note'>[<span style='white-space:nowrap'> </span><a class='note_link' href='#fs.path.fmt.cvt-3.note-1'><span class='textit'>Note</span></a><div class='noteBody'><span class='textit'>:</span> <div id='fs.path.fmt.cvt-3.sentence-1' class='sentence'>Some operating systems may have no unambiguous way to distinguish between native format and generic format arguments<a class='hidden_link' href='#fs.path.fmt.cvt-3.sentence-1'>.</a></div> <div id='fs.path.fmt.cvt-3.sentence-2' class='sentence'>This is by design as it simplifies use for operating systems that do not require
disambiguation<a class='hidden_link' href='#fs.path.fmt.cvt-3.sentence-2'>.</a></div> <div id='fs.path.fmt.cvt-3.sentence-3' class='sentence'>An implementation for an operating system where disambiguation
is required is permitted to distinguish between the formats<a class='hidden_link' href='#fs.path.fmt.cvt-3.sentence-3'>.</a></div> —<span style='white-space:nowrap'> </span><i>end note</i></div><span style='white-space:nowrap'> </span>]</div> </div><div class='para' id='fs.path.fmt.cvt-4'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.fmt.cvt-4'>4</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L11510'>#</a></div><div id='fs.path.fmt.cvt-4.sentence-1' class='sentence'>Pathnames are converted as needed between the generic and native formats
in an operating-system-dependent manner<a class='hidden_link' href='#fs.path.fmt.cvt-4.sentence-1'>.</a></div> <div id='fs.path.fmt.cvt-4.sentence-2' class='sentence'>Let <span class='textit'>G(n)</span> and <span class='textit'>N(g)</span> in a mathematical sense
be the implementation's functions that convert native-to-generic
and generic-to-native formats respectively<a class='hidden_link' href='#fs.path.fmt.cvt-4.sentence-2'>.</a></div> <div id='fs.path.fmt.cvt-4.sentence-3' class='sentence'>If <span class='textit'>g=G(n)</span> for some <span class='textit'>n</span>, then <span class='textit'>G(N(g))=g</span>;
if <span class='textit'>n=N(g)</span> for some <span class='textit'>g</span>, then <span class='textit'>N(G(n))=n</span><a class='hidden_link' href='#fs.path.fmt.cvt-4.sentence-3'>.</a></div> <div id='fs.path.fmt.cvt-4.note-1' class='note'>[<span style='white-space:nowrap'> </span><a class='note_link' href='#fs.path.fmt.cvt-4.note-1'><span class='textit'>Note</span></a><div class='noteBody'><span class='textit'>:</span> <div id='fs.path.fmt.cvt-4.sentence-4' class='sentence'>Neither <span class='textit'>G</span> nor <span class='textit'>N</span> need be invertible<a class='hidden_link' href='#fs.path.fmt.cvt-4.sentence-4'>.</a></div> —<span style='white-space:nowrap'> </span><i>end note</i></div><span style='white-space:nowrap'> </span>]</div> </div><div class='para' id='fs.path.fmt.cvt-5'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.fmt.cvt-5'>5</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L11520'>#</a></div><div id='fs.path.fmt.cvt-5.sentence-1' class='sentence'>If the native format requires paths for regular files to be formatted
differently from paths for directories, the path shall be treated as a directory
path if its last element is a <i ><a href='#nt:directory-separator'>directory-separator</a></i>,
otherwise it shall be treated as a path to a regular file<a class='hidden_link' href='#fs.path.fmt.cvt-5.sentence-1'>.</a></div></div><div class='para' id='fs.path.fmt.cvt-6'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.fmt.cvt-6'>6</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L11526'>#</a></div><div id='fs.path.fmt.cvt-6.note-1' class='note'>[<span style='white-space:nowrap'> </span><a class='note_link' href='#fs.path.fmt.cvt-6.note-1'><span class='textit'>Note</span></a><div class='noteBody'><span class='textit'>:</span> <div id='fs.path.fmt.cvt-6.sentence-1' class='sentence'>A path stores a native format pathname (<a href='#fs.path.native.obs'>[fs.path.native.obs]</a>)
and acts as if it also stores a generic format pathname,
related as given below<a class='hidden_link' href='#fs.path.fmt.cvt-6.sentence-1'>.</a></div> <div id='fs.path.fmt.cvt-6.sentence-2' class='sentence'>The implementation may generate the generic format pathname
based on the native format pathname (and possibly other information)
when requested<a class='hidden_link' href='#fs.path.fmt.cvt-6.sentence-2'>.</a></div> —<span style='white-space:nowrap'> </span><i>end note</i></div><span style='white-space:nowrap'> </span>]</div> </div><div class='para' id='fs.path.fmt.cvt-7'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.fmt.cvt-7'>7</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L11536'>#</a></div><div id='fs.path.fmt.cvt-7.sentence-1' class='sentence'>When a path is constructed from or is assigned a single representation
separate from any path, the other representation is selected
by the appropriate conversion function (<span class='textit'>G</span> or <span class='textit'>N</span>)<a class='hidden_link' href='#fs.path.fmt.cvt-7.sentence-1'>.</a></div></div><div class='para' id='fs.path.fmt.cvt-8'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.fmt.cvt-8'>8</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L11541'>#</a></div><div id='fs.path.fmt.cvt-8.sentence-1' class='sentence'>When the (new) value <span class='textit'>p</span> of one representation of a path
is derived from the representation of that or another path,
a value <span class='textit'>q</span> is chosen for the other representation<a class='hidden_link' href='#fs.path.fmt.cvt-8.sentence-1'>.</a></div> <div id='fs.path.fmt.cvt-8.sentence-2' class='sentence'>The value <span class='textit'>q</span> converts to <span class='textit'>p</span>
(by <span class='textit'>G</span> or <span class='textit'>N</span> as appropriate)
if any such value does so;
<span class='textit'>q</span> is otherwise unspecified<a class='hidden_link' href='#fs.path.fmt.cvt-8.sentence-2'>.</a></div> <div id='fs.path.fmt.cvt-8.note-1' class='note'>[<span style='white-space:nowrap'> </span><a class='note_link' href='#fs.path.fmt.cvt-8.note-1'><span class='textit'>Note</span></a><div class='noteBody'><span class='textit'>:</span> <div id='fs.path.fmt.cvt-8.sentence-3' class='sentence'>If <span class='textit'>q</span> is the result of converting any path at all,
it is the result of converting <span class='textit'>p</span><a class='hidden_link' href='#fs.path.fmt.cvt-8.sentence-3'>.</a></div> —<span style='white-space:nowrap'> </span><i>end note</i></div><span style='white-space:nowrap'> </span>]</div> </div></div><div id='fs.path.type.cvt' class='section'><h4 ><a class='secnum' href='#fs.path.type.cvt' style='min-width:133pt'>28.11.7.2.2</a> Type and encoding conversions <a class='abbr_ref' href='fs.path.type.cvt'>[fs.path.type.cvt]</a></h4><div class='para' id='fs.path.type.cvt-1'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.type.cvt-1'>1</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L11557'>#</a></div><div id='fs.path.type.cvt-1.sentence-1' class='sentence'>The <a class='hidden_link' href='#def:native_encoding' id='def:native_encoding'><i >native encoding</i></a> of an ordinary character string is
the operating system dependent current encoding
for pathnames (<a href='#fs.class.path'>[fs.class.path]</a>)<a class='hidden_link' href='#fs.path.type.cvt-1.sentence-1'>.</a></div> <div id='fs.path.type.cvt-1.sentence-2' class='sentence'>The <a class='hidden_link' href='#def:native_encoding_' id='def:native_encoding_'><i >native encoding</i></a> for wide character strings is
the implementation-defined execution
wide-character set encoding (<a href='lex.charset'>[lex.charset]</a>)<a class='hidden_link' href='#fs.path.type.cvt-1.sentence-2'>.</a></div></div><div class='para' id='fs.path.type.cvt-2'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.type.cvt-2'>2</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L11565'>#</a></div><div id='fs.path.type.cvt-2.sentence-1' class='sentence'>For member function arguments that take character sequences representing
paths and for member functions returning strings, value type and encoding
conversion is performed if the value type of the argument or return value differs from
<span class='texttt'>path<span class='operator'>:</span><span class='operator'>:</span>value_&shy;type</span><a class='hidden_link' href='#fs.path.type.cvt-2.sentence-1'>.</a></div> <div id='fs.path.type.cvt-2.sentence-2' class='sentence'>For the argument or return value, the method of conversion and the encoding
to be converted to is determined
by its value type:
<ul class='itemize'><li id='fs.path.type.cvt-2.1'><div class='marginalizedparent' style='left:-7em'><a class='marginalized' href='#fs.path.type.cvt-2.1'>(2.1)</a></div><div id='fs.path.type.cvt-2.1.sentence-1' class='sentence'><span class='texttt'><span class='keyword'>char</span></span>: The encoding is the native ordinary encoding<a class='hidden_link' href='#fs.path.type.cvt-2.1.sentence-1'>.</a></div> <div id='fs.path.type.cvt-2.1.sentence-2' class='sentence'>The method of conversion, if any, is operating system dependent<a class='hidden_link' href='#fs.path.type.cvt-2.1.sentence-2'>.</a></div> <div id='fs.path.type.cvt-2.1.note-1' class='note'>[<span style='white-space:nowrap'> </span><a class='note_link' href='#fs.path.type.cvt-2.1.note-1'><span class='textit'>Note</span></a><div class='noteBody'><span class='textit'>:</span> <div id='fs.path.type.cvt-2.1.sentence-3' class='sentence'>For POSIX-based operating systems <span class='texttt'>path<span class='operator'>:</span><span class='operator'>:</span>value_&shy;type</span> is <span class='texttt'><span class='keyword'>char</span></span>
so no conversion from <span class='texttt'><span class='keyword'>char</span></span> value type arguments or to <span class='texttt'><span class='keyword'>char</span></span>
value type return values is performed<a class='hidden_link' href='#fs.path.type.cvt-2.1.sentence-3'>.</a></div> <div id='fs.path.type.cvt-2.1.sentence-4' class='sentence'>For Windows-based operating systems, the
native ordinary encoding is determined by calling a Windows API function<a class='hidden_link' href='#fs.path.type.cvt-2.1.sentence-4'>.</a></div> —<span style='white-space:nowrap'> </span><i>end note</i></div><span style='white-space:nowrap'> </span>]</div>  <div id='fs.path.type.cvt-2.1.note-2' class='note'>[<span style='white-space:nowrap'> </span><a class='note_link' href='#fs.path.type.cvt-2.1.note-2'><span class='textit'>Note</span></a><div class='noteBody'><span class='textit'>:</span> <div id='fs.path.type.cvt-2.1.sentence-5' class='sentence'>This results in behavior identical to other C and C++
standard library functions that perform file operations using ordinary character
strings to identify paths<a class='hidden_link' href='#fs.path.type.cvt-2.1.sentence-5'>.</a></div> <div id='fs.path.type.cvt-2.1.sentence-6' class='sentence'>Changing this behavior would be surprising and error
prone<a class='hidden_link' href='#fs.path.type.cvt-2.1.sentence-6'>.</a></div> —<span style='white-space:nowrap'> </span><i>end note</i></div><span style='white-space:nowrap'> </span>]</div> </li><li id='fs.path.type.cvt-2.2'><div class='marginalizedparent' style='left:-7em'><a class='marginalized' href='#fs.path.type.cvt-2.2'>(2.2)</a></div><div id='fs.path.type.cvt-2.2.sentence-1' class='sentence'><span class='texttt'><span class='keyword'>wchar_&shy;t</span></span>: The encoding is the native wide encoding<a class='hidden_link' href='#fs.path.type.cvt-2.2.sentence-1'>.</a></div> <div id='fs.path.type.cvt-2.2.sentence-2' class='sentence'>The method of conversion is unspecified<a class='hidden_link' href='#fs.path.type.cvt-2.2.sentence-2'>.</a></div> <div id='fs.path.type.cvt-2.2.note-3' class='note'>[<span style='white-space:nowrap'> </span><a class='note_link' href='#fs.path.type.cvt-2.2.note-3'><span class='textit'>Note</span></a><div class='noteBody'><span class='textit'>:</span> <div id='fs.path.type.cvt-2.2.sentence-3' class='sentence'>For Windows-based operating systems <span class='texttt'>path<span class='operator'>:</span><span class='operator'>:</span>value_&shy;type</span> is <span class='texttt'><span class='keyword'>wchar_&shy;t</span></span>
so no conversion from <span class='texttt'><span class='keyword'>wchar_&shy;t</span></span> value type arguments or to <span class='texttt'><span class='keyword'>wchar_&shy;t</span></span>
value type return values is performed<a class='hidden_link' href='#fs.path.type.cvt-2.2.sentence-3'>.</a></div> —<span style='white-space:nowrap'> </span><i>end note</i></div><span style='white-space:nowrap'> </span>]</div> </li><li id='fs.path.type.cvt-2.3'><div class='marginalizedparent' style='left:-7em'><a class='marginalized' href='#fs.path.type.cvt-2.3'>(2.3)</a></div><div id='fs.path.type.cvt-2.3.sentence-1' class='sentence'><span class='texttt'><span class='keyword'>char8_&shy;t</span></span>: The encoding is UTF-8<a class='hidden_link' href='#fs.path.type.cvt-2.3.sentence-1'>.</a></div> <div id='fs.path.type.cvt-2.3.sentence-2' class='sentence'>The method of conversion
is unspecified<a class='hidden_link' href='#fs.path.type.cvt-2.3.sentence-2'>.</a></div></li><li id='fs.path.type.cvt-2.4'><div class='marginalizedparent' style='left:-7em'><a class='marginalized' href='#fs.path.type.cvt-2.4'>(2.4)</a></div><div id='fs.path.type.cvt-2.4.sentence-1' class='sentence'><span class='texttt'><span class='keyword'>char16_&shy;t</span></span>: The encoding is UTF-16<a class='hidden_link' href='#fs.path.type.cvt-2.4.sentence-1'>.</a></div> <div id='fs.path.type.cvt-2.4.sentence-2' class='sentence'>The method of conversion
is unspecified<a class='hidden_link' href='#fs.path.type.cvt-2.4.sentence-2'>.</a></div></li><li id='fs.path.type.cvt-2.5'><div class='marginalizedparent' style='left:-7em'><a class='marginalized' href='#fs.path.type.cvt-2.5'>(2.5)</a></div><div id='fs.path.type.cvt-2.5.sentence-1' class='sentence'><span class='texttt'><span class='keyword'>char32_&shy;t</span></span>: The encoding is UTF-32<a class='hidden_link' href='#fs.path.type.cvt-2.5.sentence-1'>.</a></div> <div id='fs.path.type.cvt-2.5.sentence-2' class='sentence'>The method of conversion
is unspecified<a class='hidden_link' href='#fs.path.type.cvt-2.5.sentence-2'>.</a></div></li></ul></div></div><div class='para' id='fs.path.type.cvt-3'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.type.cvt-3'>3</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L11604'>#</a></div><div id='fs.path.type.cvt-3.sentence-1' class='sentence'>If the encoding being converted to has no representation for source
characters, the resulting converted characters, if any, are unspecified<a class='hidden_link' href='#fs.path.type.cvt-3.sentence-1'>.</a></div> <div id='fs.path.type.cvt-3.sentence-2' class='sentence'>Implementations should not modify member function arguments
if already of type <span class='texttt'>path<span class='operator'>:</span><span class='operator'>:</span>value_&shy;type</span><a class='hidden_link' href='#fs.path.type.cvt-3.sentence-2'>.</a></div></div></div></div><div id='fs.path.req' class='section'><h4 ><a class='secnum' href='#fs.path.req' style='min-width:118pt'>28.11.7.3</a> Requirements <a class='abbr_ref' href='fs.path.req'>[fs.path.req]</a></h4><div class='para' id='fs.path.req-1'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.req-1'>1</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L11612'>#</a></div><div id='fs.path.req-1.sentence-1' class='sentence'>In addition to the requirements (<a href='fs.req'>[fs.req]</a>),
function template parameters named <span class='texttt'>Source</span>
shall be one of:
<ul class='itemize'><li id='fs.path.req-1.1'><div class='marginalizedparent' style='left:-7em'><a class='marginalized' href='#fs.path.req-1.1'>(1.1)</a></div><div id='fs.path.req-1.1.sentence-1' class='sentence'><span class='texttt'>basic_&shy;string<span class='anglebracket'>&lt;</span>EcharT, traits, Allocator<span class='anglebracket'>&gt;</span></span><a class='hidden_link' href='#fs.path.req-1.1.sentence-1'>.</a></div> <div id='fs.path.req-1.1.sentence-2' class='sentence'>A function
  argument <span class='texttt'><span class='keyword'>const</span> Source<span class='operator'>&amp;</span></span> <span class='texttt'>source</span> shall have an
  effective range <span class='texttt'>[</span><span class='texttt'>source<span class='operator'>.</span>begin<span class='parenthesis'>(</span><span class='parenthesis'>)</span>, source<span class='operator'>.</span>end<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span><span class='texttt'>)</span><a class='hidden_link' href='#fs.path.req-1.1.sentence-2'>.</a></div></li><li id='fs.path.req-1.2'><div class='marginalizedparent' style='left:-7em'><a class='marginalized' href='#fs.path.req-1.2'>(1.2)</a></div><div id='fs.path.req-1.2.sentence-1' class='sentence'><span class='texttt'>basic_&shy;string_&shy;view<span class='anglebracket'>&lt;</span>EcharT, traits<span class='anglebracket'>&gt;</span></span><a class='hidden_link' href='#fs.path.req-1.2.sentence-1'>.</a></div> <div id='fs.path.req-1.2.sentence-2' class='sentence'>A function
  argument <span class='texttt'><span class='keyword'>const</span> Source<span class='operator'>&amp;</span></span> <span class='texttt'>source</span> shall have an
  effective range <span class='texttt'>[</span><span class='texttt'>source<span class='operator'>.</span>begin<span class='parenthesis'>(</span><span class='parenthesis'>)</span>, source<span class='operator'>.</span>end<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span><span class='texttt'>)</span><a class='hidden_link' href='#fs.path.req-1.2.sentence-2'>.</a></div></li><li id='fs.path.req-1.3'><div class='marginalizedparent' style='left:-7em'><a class='marginalized' href='#fs.path.req-1.3'>(1.3)</a></div><div id='fs.path.req-1.3.sentence-1' class='sentence'>A type meeting the <span class='textit'>Cpp17InputIterator</span> requirements that iterates over a NTCTS<a class='hidden_link' href='#fs.path.req-1.3.sentence-1'>.</a></div> <div id='fs.path.req-1.3.sentence-2' class='sentence'>The value type shall be an encoded character type<a class='hidden_link' href='#fs.path.req-1.3.sentence-2'>.</a></div> <div id='fs.path.req-1.3.sentence-3' class='sentence'>A function argument
  <span class='texttt'><span class='keyword'>const</span> Source<span class='operator'>&amp;</span></span> <span class='texttt'>source</span> shall have an effective range
  <span class='texttt'>[</span><span class='texttt'>source, end</span><span class='texttt'>)</span> where <span class='texttt'>end</span> is the first
  iterator value with an element value equal to
  <span class='texttt'>iterator_&shy;traits<span class='anglebracket'>&lt;</span>Source<span class='anglebracket'>&gt;</span><span class='operator'>:</span><span class='operator'>:</span>value_&shy;type<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span><a class='hidden_link' href='#fs.path.req-1.3.sentence-3'>.</a></div></li><li id='fs.path.req-1.4'><div class='marginalizedparent' style='left:-7em'><a class='marginalized' href='#fs.path.req-1.4'>(1.4)</a></div><div id='fs.path.req-1.4.sentence-1' class='sentence'>A character array that after array-to-pointer decay results in a
  pointer to the start of a NTCTS<a class='hidden_link' href='#fs.path.req-1.4.sentence-1'>.</a></div> <div id='fs.path.req-1.4.sentence-2' class='sentence'>The value type shall be an encoded character type<a class='hidden_link' href='#fs.path.req-1.4.sentence-2'>.</a></div> <div id='fs.path.req-1.4.sentence-3' class='sentence'>A
  function argument <span class='texttt'><span class='keyword'>const</span> Source<span class='operator'>&amp;</span></span> <span class='texttt'>source</span> shall
  have an effective range <span class='texttt'>[</span><span class='texttt'>source, end</span><span class='texttt'>)</span> where
  <span class='texttt'>end</span> is the first iterator value with an element value equal to
  <span class='texttt'>iterator_&shy;traits<span class='anglebracket'>&lt;</span>decay_&shy;t<span class='anglebracket'>&lt;</span>Source<span class='anglebracket'>&gt;</span><span class='anglebracket'>&gt;</span><span class='operator'>:</span><span class='operator'>:</span>value_&shy;type<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span><a class='hidden_link' href='#fs.path.req-1.4.sentence-3'>.</a></div></li></ul></div></div><div class='para' id='fs.path.req-2'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.req-2'>2</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L11637'>#</a></div><div id='fs.path.req-2.sentence-1' class='sentence'>Functions taking template parameters named <span class='texttt'>Source</span>
shall not participate in overload resolution unless either
<ul class='itemize'><li id='fs.path.req-2.1'><div class='marginalizedparent' style='left:-7em'><a class='marginalized' href='#fs.path.req-2.1'>(2.1)</a></div><div id='fs.path.req-2.1.sentence-1' class='sentence'><span class='texttt'>Source</span> is a specialization of
<span class='texttt'>basic_&shy;string</span> or <span class='texttt'>basic_&shy;string_&shy;view</span>, or</div></li><li id='fs.path.req-2.2'><div class='marginalizedparent' style='left:-7em'><a class='marginalized' href='#fs.path.req-2.2'>(2.2)</a></div><div id='fs.path.req-2.2.sentence-1' class='sentence'>the <i ><a href='expr.prim.id.qual#nt:qualified-id'>qualified-id</a></i> <span class='texttt'>iterator_&shy;traits<span class='anglebracket'>&lt;</span>decay_&shy;t<span class='anglebracket'>&lt;</span>Source<span class='anglebracket'>&gt;</span><span class='anglebracket'>&gt;</span><span class='operator'>:</span><span class='operator'>:</span>value_&shy;type</span> is valid and
denotes a possibly <span class='texttt'><span class='keyword'>const</span></span> encoded character type (<a href='temp.deduct'>[temp.deduct]</a>)<a class='hidden_link' href='#fs.path.req-2.2.sentence-1'>.</a></div></li></ul></div></div><div class='para' id='fs.path.req-3'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.req-3'>3</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L11649'>#</a></div><div id='fs.path.req-3.note-1' class='note'>[<span style='white-space:nowrap'> </span><a class='note_link' href='#fs.path.req-3.note-1'><span class='textit'>Note</span></a><div class='noteBody'><span class='textit'>:</span> <div id='fs.path.req-3.sentence-1' class='sentence'>See <a href='#fs.path.cvt'>path conversions</a>
for how the value types above and their encodings convert to
<span class='texttt'>path<span class='operator'>:</span><span class='operator'>:</span>value_&shy;type</span> and its encoding<a class='hidden_link' href='#fs.path.req-3.sentence-1'>.</a></div> —<span style='white-space:nowrap'> </span><i>end note</i></div><span style='white-space:nowrap'> </span>]</div> </div><div class='para' id='fs.path.req-4'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.req-4'>4</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L11656'>#</a></div><div id='fs.path.req-4.sentence-1' class='sentence'>Arguments of type <span class='texttt'>Source</span>
shall not be null pointers<a class='hidden_link' href='#fs.path.req-4.sentence-1'>.</a></div></div></div><div id='fs.path.member' class='section'><h4 ><a class='secnum' href='#fs.path.member' style='min-width:118pt'>28.11.7.4</a> Members <a class='abbr_ref' href='fs.path.member'>[fs.path.member]</a></h4><div id='fs.path.construct' class='section'><h4 ><a class='secnum' href='#fs.path.construct' style='min-width:133pt'>28.11.7.4.1</a> Constructors <a class='abbr_ref' href='fs.path.construct'>[fs.path.construct]</a></h4><span class='indexparent'><a class='index' id='lib:path,constructor'></a></span><div class='itemdecl' id='fs.path.construct-itemdecl:1'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.construct-itemdecl:1'>🔗</a></div><code class='itemdeclcode'>path<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>noexcept</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.construct-1'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.construct-1'>1</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L11670'>#</a></div><div id='fs.path.construct-1.sentence-1' class='sentence'><span class='textit'>Effects:</span> Constructs an object of class <span class='texttt'>path</span><a class='hidden_link' href='#fs.path.construct-1.sentence-1'>.</a></div></div></div><div class='para' id='fs.path.construct-2'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.construct-2'>2</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L11673'>#</a></div><div id='fs.path.construct-2.sentence-1' class='sentence'><span class='textit'>Ensures:</span> <span class='texttt'>empty<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='operator'>=</span><span class='operator'>=</span> <span class='literal'>true</span></span><a class='hidden_link' href='#fs.path.construct-2.sentence-1'>.</a></div></div></div><span class='indexparent'><a class='index' id='lib:path,constructor_'></a></span><div class='itemdecl' id='fs.path.construct-itemdecl:2'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.construct-itemdecl:2'>🔗</a></div><code class='itemdeclcode'>path<span class='parenthesis'>(</span><span class='keyword'>const</span> path<span class='operator'>&amp;</span> p<span class='parenthesis'>)</span>;
path<span class='parenthesis'>(</span>path<span class='operator'>&amp;</span><span class='operator'>&amp;</span> p<span class='parenthesis'>)</span> <span class='keyword'>noexcept</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.construct-3'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.construct-3'>3</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L11684'>#</a></div><div id='fs.path.construct-3.sentence-1' class='sentence'><span class='textit'>Effects:</span> 
Constructs an object of class <span class='texttt'>path</span>
having the same pathname in the native and generic formats, respectively,
as the original value of <span class='texttt'>p</span><a class='hidden_link' href='#fs.path.construct-3.sentence-1'>.</a></div> <div id='fs.path.construct-3.sentence-2' class='sentence'>In the second form, <span class='texttt'>p</span> is left in a valid but unspecified state<a class='hidden_link' href='#fs.path.construct-3.sentence-2'>.</a></div></div></div><span class='indexparent'><a class='index' id='lib:path,constructor__'></a></span><div class='itemdecl' id='fs.path.construct-itemdecl:3'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.construct-itemdecl:3'>🔗</a></div><code class='itemdeclcode'>path<span class='parenthesis'>(</span>string_type<span class='operator'>&amp;</span><span class='operator'>&amp;</span> source, format fmt <span class='operator'>=</span> auto_format<span class='parenthesis'>)</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.construct-4'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.construct-4'>4</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L11698'>#</a></div><div id='fs.path.construct-4.sentence-1' class='sentence'><span class='textit'>Effects:</span> 
Constructs an object of class <span class='texttt'>path</span>
for which the pathname in the detected-format of <span class='texttt'>source</span>
has the original value of <span class='texttt'>source</span> (<a href='#fs.path.fmt.cvt'>[fs.path.fmt.cvt]</a>),
converting format if required (<a href='#fs.path.fmt.cvt'>[fs.path.fmt.cvt]</a>)<a class='hidden_link' href='#fs.path.construct-4.sentence-1'>.</a></div> <div id='fs.path.construct-4.sentence-2' class='sentence'><span class='texttt'>source</span> is left in a valid but unspecified state<a class='hidden_link' href='#fs.path.construct-4.sentence-2'>.</a></div></div></div><span class='indexparent'><a class='index' id='lib:path,constructor___'></a></span><div class='itemdecl' id='fs.path.construct-itemdecl:4'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.construct-itemdecl:4'>🔗</a></div><code class='itemdeclcode'><span class='keyword'>template</span><span class='anglebracket'>&lt;</span><span class='keyword'>class</span> Source<span class='anglebracket'>&gt;</span>
  path<span class='parenthesis'>(</span><span class='keyword'>const</span> Source<span class='operator'>&amp;</span> source, format fmt <span class='operator'>=</span> auto_format<span class='parenthesis'>)</span>;
<span class='keyword'>template</span><span class='anglebracket'>&lt;</span><span class='keyword'>class</span> InputIterator<span class='anglebracket'>&gt;</span>
  path<span class='parenthesis'>(</span>InputIterator first, InputIterator last, format fmt <span class='operator'>=</span> auto_format<span class='parenthesis'>)</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.construct-5'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.construct-5'>5</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L11716'>#</a></div><div id='fs.path.construct-5.sentence-1' class='sentence'><span class='textit'>Effects:</span> Let <span class='texttt'>s</span> be the effective range of <span class='texttt'>source</span> (<a href='#fs.path.req'>[fs.path.req]</a>)
or the range <span class='texttt'>[</span><span class='texttt'>first, last</span><span class='texttt'>)</span>, with the encoding converted if required (<a href='#fs.path.cvt'>[fs.path.cvt]</a>)<a class='hidden_link' href='#fs.path.construct-5.sentence-1'>.</a></div> <div id='fs.path.construct-5.sentence-2' class='sentence'>Finds the detected-format of <span class='texttt'>s</span> (<a href='#fs.path.fmt.cvt'>[fs.path.fmt.cvt]</a>)
and constructs an object of class <span class='texttt'>path</span>
for which the pathname in that format is <span class='texttt'>s</span><a class='hidden_link' href='#fs.path.construct-5.sentence-2'>.</a></div></div></div><span class='indexparent'><a class='index' id='lib:path,constructor____'></a></span><div class='itemdecl' id='fs.path.construct-itemdecl:5'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.construct-itemdecl:5'>🔗</a></div><code class='itemdeclcode'><span class='keyword'>template</span><span class='anglebracket'>&lt;</span><span class='keyword'>class</span> Source<span class='anglebracket'>&gt;</span>
  path<span class='parenthesis'>(</span><span class='keyword'>const</span> Source<span class='operator'>&amp;</span> source, <span class='keyword'>const</span> locale<span class='operator'>&amp;</span> loc, format fmt <span class='operator'>=</span> auto_format<span class='parenthesis'>)</span>;
<span class='keyword'>template</span><span class='anglebracket'>&lt;</span><span class='keyword'>class</span> InputIterator<span class='anglebracket'>&gt;</span>
  path<span class='parenthesis'>(</span>InputIterator first, InputIterator last, <span class='keyword'>const</span> locale<span class='operator'>&amp;</span> loc, format fmt <span class='operator'>=</span> auto_format<span class='parenthesis'>)</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.construct-6'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.construct-6'>6</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L11733'>#</a></div><div id='fs.path.construct-6.sentence-1' class='sentence'><span class='textit'>Requires:</span> 
The value type of <span class='texttt'>Source</span> and <span class='texttt'>InputIterator</span> is
<span class='texttt'><span class='keyword'>char</span></span><a class='hidden_link' href='#fs.path.construct-6.sentence-1'>.</a></div></div></div><div class='para' id='fs.path.construct-7'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.construct-7'>7</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L11738'>#</a></div><div id='fs.path.construct-7.sentence-1' class='sentence'><span class='textit'>Effects:</span> Let <span class='texttt'>s</span> be the effective range of <span class='texttt'>source</span>
or the range <span class='texttt'>[</span><span class='texttt'>first, last</span><span class='texttt'>)</span>,
after converting the encoding as
follows:
<ul class='itemize'><li id='fs.path.construct-7.1'><div class='marginalizedparent' style='left:-10em'><a class='marginalized' href='#fs.path.construct-7.1'>(7.1)</a></div><div id='fs.path.construct-7.1.sentence-1' class='sentence'>If <span class='texttt'>value_&shy;type</span> is <span class='texttt'><span class='keyword'>wchar_&shy;t</span></span>, converts to the native
wide encoding (<a href='#fs.path.type.cvt'>[fs.path.type.cvt]</a>) using the <span class='texttt'>codecvt<span class='anglebracket'>&lt;</span>&#x200b;<span class='keyword'>wchar_&shy;t</span>, <span class='keyword'>char</span>, mbstate_&shy;t<span class='anglebracket'>&gt;</span></span>
facet of <span class='texttt'>loc</span><a class='hidden_link' href='#fs.path.construct-7.1.sentence-1'>.</a></div></li><li id='fs.path.construct-7.2'><div class='marginalizedparent' style='left:-10em'><a class='marginalized' href='#fs.path.construct-7.2'>(7.2)</a></div><div id='fs.path.construct-7.2.sentence-1' class='sentence'>Otherwise a conversion is performed using the
<span class='texttt'>codecvt<span class='anglebracket'>&lt;</span><span class='keyword'>wchar_&shy;t</span>, <span class='keyword'>char</span>, mbstate_&shy;t<span class='anglebracket'>&gt;</span></span> facet of <span class='texttt'>loc</span>, and then a second
conversion to the current ordinary encoding<a class='hidden_link' href='#fs.path.construct-7.2.sentence-1'>.</a></div></li></ul></div></div></div><div class='para' id='fs.path.construct-8'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.construct-8'>8</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L11754'>#</a></div><div id='fs.path.construct-8.sentence-1' class='sentence'>Finds the detected-format of <span class='texttt'>s</span> (<a href='#fs.path.fmt.cvt'>[fs.path.fmt.cvt]</a>)
and constructs an object of class <span class='texttt'>path</span>
for which the pathname in that format is <span class='texttt'>s</span><a class='hidden_link' href='#fs.path.construct-8.sentence-1'>.</a></div><div style='height:0.6em;display:block'></div><div id='fs.path.construct-8.example-1' class='example'>[<span style='white-space:nowrap'> </span><a class='example_link' href='#fs.path.construct-8.example-1'><span class='textit'>Example</span></a><div class='exampleBody'><span class='textit'>:</span> <div id='fs.path.construct-8.sentence-2' class='sentence'>A string is to be read from a database
that is encoded in ISO/IEC 8859-1, and used to create a directory:
<pre class='codeblock'>
<span class='keyword'>namespace</span> fs <span class='operator'>=</span> std<span class='operator'>:</span><span class='operator'>:</span>filesystem;
std<span class='operator'>:</span><span class='operator'>:</span>string latin1_string <span class='operator'>=</span> read_latin1_data<span class='parenthesis'>(</span><span class='parenthesis'>)</span>;
codecvt_8859_1<span class='anglebracket'>&lt;</span><span class='keyword'>wchar_t</span><span class='anglebracket'>&gt;</span> latin1_facet;
std<span class='operator'>:</span><span class='operator'>:</span>locale latin1_locale<span class='parenthesis'>(</span>std<span class='operator'>:</span><span class='operator'>:</span>locale<span class='parenthesis'>(</span><span class='parenthesis'>)</span>, latin1_facet<span class='parenthesis'>)</span>;
fs<span class='operator'>:</span><span class='operator'>:</span>create_directory<span class='parenthesis'>(</span>fs<span class='operator'>:</span><span class='operator'>:</span>path<span class='parenthesis'>(</span>latin1_string, latin1_locale<span class='parenthesis'>)</span><span class='parenthesis'>)</span>;
</pre></div> <div id='fs.path.construct-8.sentence-3' class='sentence'>
For POSIX-based operating systems, the path is constructed by first using
<span class='texttt'>latin1_&shy;facet</span> to convert ISO/IEC 8859-1 encoded
<span class='texttt'>latin1_&shy;string</span> to a wide character string in the native wide
encoding (<a href='#fs.path.type.cvt'>[fs.path.type.cvt]</a>)<a class='hidden_link' href='#fs.path.construct-8.sentence-3'>.</a></div> <div id='fs.path.construct-8.sentence-4' class='sentence'>The resulting wide string is then
converted to an ordinary character
pathname string in the current native ordinary encoding<a class='hidden_link' href='#fs.path.construct-8.sentence-4'>.</a></div> <div id='fs.path.construct-8.sentence-5' class='sentence'>If the
native wide encoding is UTF-16 or UTF-32, and the current native ordinary
encoding is UTF-8, all of the characters in the ISO/IEC 8859-1 character set
will be converted to their Unicode representation, but for other native
ordinary encodings some characters may have no representation<a class='hidden_link' href='#fs.path.construct-8.sentence-5'>.</a></div><div style='height:0.6em;display:block'></div><div id='fs.path.construct-8.sentence-6' class='sentence'>For Windows-based operating systems, the path is constructed by
using <span class='texttt'>latin1_&shy;facet</span> to convert ISO/IEC 8859-1 encoded
<span class='texttt'>latin1_&shy;string</span> to a UTF-16 encoded wide character pathname
string<a class='hidden_link' href='#fs.path.construct-8.sentence-6'>.</a></div> <div id='fs.path.construct-8.sentence-7' class='sentence'>All of the characters in the ISO/IEC 8859-1 character set will be
converted to their Unicode representation<a class='hidden_link' href='#fs.path.construct-8.sentence-7'>.</a></div> —<span style='white-space:nowrap'> </span><i>end example</i></div><span style='white-space:nowrap'> </span>]</div> </div></div></div><div id='fs.path.assign' class='section'><h4 ><a class='secnum' href='#fs.path.assign' style='min-width:133pt'>28.11.7.4.2</a> Assignments <a class='abbr_ref' href='fs.path.assign'>[fs.path.assign]</a></h4><span class='indexparent'><a class='index' id='lib:operator=,path'></a></span><span class='indexparent'><a class='index' id='lib:path,operator='></a></span><div class='itemdecl' id='fs.path.assign-itemdecl:1'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.assign-itemdecl:1'>🔗</a></div><code class='itemdeclcode'>path<span class='operator'>&amp;</span> <span class='keyword'>operator</span><span class='operator'>=</span><span class='parenthesis'>(</span><span class='keyword'>const</span> path<span class='operator'>&amp;</span> p<span class='parenthesis'>)</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.assign-1'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.assign-1'>1</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L11796'>#</a></div><div id='fs.path.assign-1.sentence-1' class='sentence'><span class='textit'>Effects:</span> If <span class='texttt'><span class='operator'>*</span><span class='keyword'>this</span></span> and <span class='texttt'>p</span> are the same
object, has no effect<a class='hidden_link' href='#fs.path.assign-1.sentence-1'>.</a></div> <div id='fs.path.assign-1.sentence-2' class='sentence'>Otherwise,
sets both respective pathnames of <span class='texttt'><span class='operator'>*</span><span class='keyword'>this</span></span>
to the respective pathnames of <span class='texttt'>p</span><a class='hidden_link' href='#fs.path.assign-1.sentence-2'>.</a></div></div></div><div class='para' id='fs.path.assign-2'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.assign-2'>2</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L11803'>#</a></div><div id='fs.path.assign-2.sentence-1' class='sentence'><span class='textit'>Returns:</span> <span class='texttt'><span class='operator'>*</span><span class='keyword'>this</span></span><a class='hidden_link' href='#fs.path.assign-2.sentence-1'>.</a></div></div></div><span class='indexparent'><a class='index' id='lib:operator=,path_'></a></span><span class='indexparent'><a class='index' id='lib:path,operator=_'></a></span><div class='itemdecl' id='fs.path.assign-itemdecl:2'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.assign-itemdecl:2'>🔗</a></div><code class='itemdeclcode'>path<span class='operator'>&amp;</span> <span class='keyword'>operator</span><span class='operator'>=</span><span class='parenthesis'>(</span>path<span class='operator'>&amp;</span><span class='operator'>&amp;</span> p<span class='parenthesis'>)</span> <span class='keyword'>noexcept</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.assign-3'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.assign-3'>3</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L11813'>#</a></div><div id='fs.path.assign-3.sentence-1' class='sentence'><span class='textit'>Effects:</span> If <span class='texttt'><span class='operator'>*</span><span class='keyword'>this</span></span> and <span class='texttt'>p</span> are the same
object, has no effect<a class='hidden_link' href='#fs.path.assign-3.sentence-1'>.</a></div> <div id='fs.path.assign-3.sentence-2' class='sentence'>Otherwise,
sets both respective pathnames of <span class='texttt'><span class='operator'>*</span><span class='keyword'>this</span></span>
to the respective pathnames of <span class='texttt'>p</span><a class='hidden_link' href='#fs.path.assign-3.sentence-2'>.</a></div> <div id='fs.path.assign-3.sentence-3' class='sentence'><span class='texttt'>p</span> is left in a valid but unspecified state<a class='hidden_link' href='#fs.path.assign-3.sentence-3'>.</a></div> <div id='fs.path.assign-3.note-1' class='note'>[<span style='white-space:nowrap'> </span><a class='note_link' href='#fs.path.assign-3.note-1'><span class='textit'>Note</span></a><div class='noteBody'><span class='textit'>:</span> <div id='fs.path.assign-3.sentence-4' class='sentence'>A valid implementation is <span class='texttt'>swap<span class='parenthesis'>(</span>p<span class='parenthesis'>)</span></span><a class='hidden_link' href='#fs.path.assign-3.sentence-4'>.</a></div> —<span style='white-space:nowrap'> </span><i>end note</i></div><span style='white-space:nowrap'> </span>]</div> </div></div><div class='para' id='fs.path.assign-4'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.assign-4'>4</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L11821'>#</a></div><div id='fs.path.assign-4.sentence-1' class='sentence'><span class='textit'>Returns:</span> <span class='texttt'><span class='operator'>*</span><span class='keyword'>this</span></span><a class='hidden_link' href='#fs.path.assign-4.sentence-1'>.</a></div></div></div><span class='indexparent'><a class='index' id='lib:operator=,path__'></a></span><span class='indexparent'><a class='index' id='lib:path,operator=__'></a></span><span class='indexparent'><a class='index' id='lib:assign,path'></a></span><span class='indexparent'><a class='index' id='lib:path,assign'></a></span><div class='itemdecl' id='fs.path.assign-itemdecl:3'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.assign-itemdecl:3'>🔗</a></div><code class='itemdeclcode'>path<span class='operator'>&amp;</span> <span class='keyword'>operator</span><span class='operator'>=</span><span class='parenthesis'>(</span>string_type<span class='operator'>&amp;</span><span class='operator'>&amp;</span> source<span class='parenthesis'>)</span>;
path<span class='operator'>&amp;</span> assign<span class='parenthesis'>(</span>string_type<span class='operator'>&amp;</span><span class='operator'>&amp;</span> source<span class='parenthesis'>)</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.assign-5'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.assign-5'>5</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L11833'>#</a></div><div id='fs.path.assign-5.sentence-1' class='sentence'><span class='textit'>Effects:</span> Sets the pathname in the detected-format of <span class='texttt'>source</span>
to the original value of <span class='texttt'>source</span><a class='hidden_link' href='#fs.path.assign-5.sentence-1'>.</a></div> <div id='fs.path.assign-5.sentence-2' class='sentence'><span class='texttt'>source</span> is left in a valid but unspecified state<a class='hidden_link' href='#fs.path.assign-5.sentence-2'>.</a></div></div></div><div class='para' id='fs.path.assign-6'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.assign-6'>6</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L11838'>#</a></div><div id='fs.path.assign-6.sentence-1' class='sentence'><span class='textit'>Returns:</span> <span class='texttt'><span class='operator'>*</span><span class='keyword'>this</span></span><a class='hidden_link' href='#fs.path.assign-6.sentence-1'>.</a></div></div></div><span class='indexparent'><a class='index' id='lib:operator=,path___'></a></span><span class='indexparent'><a class='index' id='lib:path,operator=___'></a></span><span class='indexparent'><a class='index' id='lib:assign,path_'></a></span><span class='indexparent'><a class='index' id='lib:path,assign_'></a></span><div class='itemdecl' id='fs.path.assign-itemdecl:4'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.assign-itemdecl:4'>🔗</a></div><code class='itemdeclcode'><span class='keyword'>template</span><span class='anglebracket'>&lt;</span><span class='keyword'>class</span> Source<span class='anglebracket'>&gt;</span>
  path<span class='operator'>&amp;</span> <span class='keyword'>operator</span><span class='operator'>=</span><span class='parenthesis'>(</span><span class='keyword'>const</span> Source<span class='operator'>&amp;</span> source<span class='parenthesis'>)</span>;
<span class='keyword'>template</span><span class='anglebracket'>&lt;</span><span class='keyword'>class</span> Source<span class='anglebracket'>&gt;</span>
  path<span class='operator'>&amp;</span> assign<span class='parenthesis'>(</span><span class='keyword'>const</span> Source<span class='operator'>&amp;</span> source<span class='parenthesis'>)</span>;
<span class='keyword'>template</span><span class='anglebracket'>&lt;</span><span class='keyword'>class</span> InputIterator<span class='anglebracket'>&gt;</span>
  path<span class='operator'>&amp;</span> assign<span class='parenthesis'>(</span>InputIterator first, InputIterator last<span class='parenthesis'>)</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.assign-7'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.assign-7'>7</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L11854'>#</a></div><div id='fs.path.assign-7.sentence-1' class='sentence'><span class='textit'>Effects:</span> 
Let <span class='texttt'>s</span> be the effective range of <span class='texttt'>source</span> (<a href='#fs.path.req'>[fs.path.req]</a>)
or the range <span class='texttt'>[</span><span class='texttt'>first, last</span><span class='texttt'>)</span>, with the encoding converted if required (<a href='#fs.path.cvt'>[fs.path.cvt]</a>)<a class='hidden_link' href='#fs.path.assign-7.sentence-1'>.</a></div> <div id='fs.path.assign-7.sentence-2' class='sentence'>Finds the detected-format of <span class='texttt'>s</span> (<a href='#fs.path.fmt.cvt'>[fs.path.fmt.cvt]</a>)
and sets the pathname in that format to <span class='texttt'>s</span><a class='hidden_link' href='#fs.path.assign-7.sentence-2'>.</a></div></div></div><div class='para' id='fs.path.assign-8'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.assign-8'>8</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L11861'>#</a></div><div id='fs.path.assign-8.sentence-1' class='sentence'><span class='textit'>Returns:</span> <span class='texttt'><span class='operator'>*</span><span class='keyword'>this</span></span><a class='hidden_link' href='#fs.path.assign-8.sentence-1'>.</a></div></div></div></div><div id='fs.path.append' class='section'><h4 ><a class='secnum' href='#fs.path.append' style='min-width:133pt'>28.11.7.4.3</a> Appends <a class='abbr_ref' href='fs.path.append'>[fs.path.append]</a></h4><div class='para' id='fs.path.append-1'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.append-1'>1</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L11867'>#</a></div><div id='fs.path.append-1.sentence-1' class='sentence'>The append operations use <span class='texttt'><span class='keyword'>operator</span><span class='operator'>/</span><span class='operator'>=</span></span> to denote their semantic effect of appending
<i ><a href='#nt:preferred-separator'>preferred-separator</a></i> when needed<a class='hidden_link' href='#fs.path.append-1.sentence-1'>.</a></div> <span class='indexparent'><a class='index' id='lib:operator/=,path'></a></span><span class='indexparent'><a class='index' id='lib:path,operator/='></a></span></div><div class='itemdecl' id='fs.path.append-itemdecl:1'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.append-itemdecl:1'>🔗</a></div><code class='itemdeclcode'>path<span class='operator'>&amp;</span> <span class='keyword'>operator</span><span class='operator'>/</span><span class='operator'>=</span><span class='parenthesis'>(</span><span class='keyword'>const</span> path<span class='operator'>&amp;</span> p<span class='parenthesis'>)</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.append-2'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.append-2'>2</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L11877'>#</a></div><div id='fs.path.append-2.sentence-1' class='sentence'><span class='textit'>Effects:</span> If <span class='texttt'>p<span class='operator'>.</span>is_&shy;absolute<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='operator'>|</span><span class='operator'>|</span> <span class='parenthesis'>(</span>p<span class='operator'>.</span>has_&shy;root_&shy;name<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='operator'>&amp;</span><span class='operator'>&amp;</span> p<span class='operator'>.</span>root_&shy;name<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='operator'>!</span><span class='operator'>=</span> root_&shy;name<span class='parenthesis'>(</span><span class='parenthesis'>)</span><span class='parenthesis'>)</span></span>,
then <span class='texttt'><span class='keyword'>operator</span><span class='operator'>=</span><span class='parenthesis'>(</span>p<span class='parenthesis'>)</span></span><a class='hidden_link' href='#fs.path.append-2.sentence-1'>.</a></div></div></div><div class='para' id='fs.path.append-3'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.append-3'>3</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L11881'>#</a></div><div id='fs.path.append-3.sentence-1' class='sentence'>Otherwise, modifies <span class='texttt'><span class='operator'>*</span><span class='keyword'>this</span></span> as if by these steps:
<ul class='itemize'><li id='fs.path.append-3.1'><div class='marginalizedparent' style='left:-10em'><a class='marginalized' href='#fs.path.append-3.1'>(3.1)</a></div><div id='fs.path.append-3.1.sentence-1' class='sentence'>If <span class='texttt'>p<span class='operator'>.</span>has_&shy;root_&shy;directory<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span>,
  then removes any root directory and relative path
  from the generic format pathname<a class='hidden_link' href='#fs.path.append-3.1.sentence-1'>.</a></div> <div id='fs.path.append-3.1.sentence-2' class='sentence'>Otherwise,
  if <span class='texttt'><span class='operator'>!</span>has_&shy;root_&shy;directory<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='operator'>&amp;</span><span class='operator'>&amp;</span> is_&shy;absolute<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span> is <span class='texttt'><span class='literal'>true</span></span>
  or if <span class='texttt'>has_&shy;filename<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span> is <span class='texttt'><span class='literal'>true</span></span>,
  then appends <span class='texttt'>path<span class='operator'>:</span><span class='operator'>:</span>preferred_&shy;separator</span> to the generic format pathname<a class='hidden_link' href='#fs.path.append-3.1.sentence-2'>.</a></div></li><li id='fs.path.append-3.2'><div class='marginalizedparent' style='left:-10em'><a class='marginalized' href='#fs.path.append-3.2'>(3.2)</a></div><div id='fs.path.append-3.2.sentence-1' class='sentence'>Then appends the native format pathname of <span class='texttt'>p</span>,
  omitting any <i ><a href='#nt:root-name'>root-name</a></i> from its generic format pathname,
  to the native format pathname<a class='hidden_link' href='#fs.path.append-3.2.sentence-1'>.</a></div></li></ul></div></div></div><div class='para' id='fs.path.append-4'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.append-4'>4</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L11896'>#</a></div><div id='fs.path.append-4.example-1' class='example'>[<span style='white-space:nowrap'> </span><a class='example_link' href='#fs.path.append-4.example-1'><span class='textit'>Example</span></a><div class='exampleBody'><span class='textit'>:</span> <div id='fs.path.append-4.sentence-1' class='sentence'>Even if <span class='texttt'><span class='comment'>//host</span></span> is interpreted as a <i ><a href='#nt:root-name'>root-name</a></i>,
both of the paths <span class='texttt'>path<span class='parenthesis'>(</span><span class='literal'>"//host"</span><span class='parenthesis'>)</span><span class='operator'>/</span><span class='literal'>"foo"</span></span> and <span class='texttt'>path<span class='parenthesis'>(</span><span class='literal'>"//host/"</span><span class='parenthesis'>)</span><span class='operator'>/</span><span class='literal'>"foo"</span></span>
equal <span class='texttt'><span class='literal'>"//host/foo"</span></span><a class='hidden_link' href='#fs.path.append-4.sentence-1'>.</a></div><div style='height:0.6em;display:block'></div><div id='fs.path.append-4.sentence-2' class='sentence'>Expression examples:
<pre class='codeblock'>
<span class='comment'>// On POSIX,</span>
path<span class='parenthesis'>(</span><span class='literal'>"foo"</span><span class='parenthesis'>)</span> <span class='operator'>/</span> <span class='literal'>""</span>;     <span class='comment'>// yields <span class='tcode_in_codeblock'>"foo/"</span></span>
path<span class='parenthesis'>(</span><span class='literal'>"foo"</span><span class='parenthesis'>)</span> <span class='operator'>/</span> <span class='literal'>"/bar"</span>; <span class='comment'>// yields <span class='tcode_in_codeblock'>"/bar"</span></span>
<span class='comment'>// On Windows, backslashes replace slashes in the above yields</span>

<span class='comment'>// On Windows,</span>
path<span class='parenthesis'>(</span><span class='literal'>"foo"</span><span class='parenthesis'>)</span> <span class='operator'>/</span> <span class='literal'>"c:/bar"</span>;  <span class='comment'>// yields <span class='tcode_in_codeblock'>"c:/bar"</span></span>
path<span class='parenthesis'>(</span><span class='literal'>"foo"</span><span class='parenthesis'>)</span> <span class='operator'>/</span> <span class='literal'>"c:"</span>;      <span class='comment'>// yields <span class='tcode_in_codeblock'>"c:"</span></span>
path<span class='parenthesis'>(</span><span class='literal'>"c:"</span><span class='parenthesis'>)</span> <span class='operator'>/</span> <span class='literal'>""</span>;         <span class='comment'>// yields <span class='tcode_in_codeblock'>"c:"</span></span>
path<span class='parenthesis'>(</span><span class='literal'>"c:foo"</span><span class='parenthesis'>)</span> <span class='operator'>/</span> <span class='literal'>"/bar"</span>;  <span class='comment'>// yields <span class='tcode_in_codeblock'>"c:/bar"</span></span>
path<span class='parenthesis'>(</span><span class='literal'>"c:foo"</span><span class='parenthesis'>)</span> <span class='operator'>/</span> <span class='literal'>"c:bar"</span>; <span class='comment'>// yields <span class='tcode_in_codeblock'>"c:foo/bar"</span></span>
</pre></div> —<span style='white-space:nowrap'> </span><i>end example</i></div><span style='white-space:nowrap'> </span>]</div> </div></div><div class='para' id='fs.path.append-5'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.append-5'>5</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L11918'>#</a></div><div id='fs.path.append-5.sentence-1' class='sentence'><span class='textit'>Returns:</span> <span class='texttt'><span class='operator'>*</span><span class='keyword'>this</span></span><a class='hidden_link' href='#fs.path.append-5.sentence-1'>.</a></div></div></div><span class='indexparent'><a class='index' id='lib:operator/=,path_'></a></span><span class='indexparent'><a class='index' id='lib:path,operator/=_'></a></span><span class='indexparent'><a class='index' id='lib:append,path'></a></span><span class='indexparent'><a class='index' id='lib:path,append'></a></span><div class='itemdecl' id='fs.path.append-itemdecl:2'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.append-itemdecl:2'>🔗</a></div><code class='itemdeclcode'><span class='keyword'>template</span><span class='anglebracket'>&lt;</span><span class='keyword'>class</span> Source<span class='anglebracket'>&gt;</span>
  path<span class='operator'>&amp;</span> <span class='keyword'>operator</span><span class='operator'>/</span><span class='operator'>=</span><span class='parenthesis'>(</span><span class='keyword'>const</span> Source<span class='operator'>&amp;</span> source<span class='parenthesis'>)</span>;
<span class='keyword'>template</span><span class='anglebracket'>&lt;</span><span class='keyword'>class</span> Source<span class='anglebracket'>&gt;</span>
  path<span class='operator'>&amp;</span> append<span class='parenthesis'>(</span><span class='keyword'>const</span> Source<span class='operator'>&amp;</span> source<span class='parenthesis'>)</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.append-6'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.append-6'>6</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L11932'>#</a></div><div id='fs.path.append-6.sentence-1' class='sentence'><span class='textit'>Effects:</span> Equivalent to: <span class='texttt'><span class='keyword'>return</span> <span class='keyword'>operator</span><span class='operator'>/</span><span class='operator'>=</span><span class='parenthesis'>(</span>path<span class='parenthesis'>(</span>source<span class='parenthesis'>)</span><span class='parenthesis'>)</span>;</span></div></div></div><span class='indexparent'><a class='index' id='lib:operator/=,path__'></a></span><span class='indexparent'><a class='index' id='lib:path,operator/=__'></a></span><span class='indexparent'><a class='index' id='lib:append,path_'></a></span><span class='indexparent'><a class='index' id='lib:path,append_'></a></span><div class='itemdecl' id='fs.path.append-itemdecl:3'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.append-itemdecl:3'>🔗</a></div><code class='itemdeclcode'><span class='keyword'>template</span><span class='anglebracket'>&lt;</span><span class='keyword'>class</span> InputIterator<span class='anglebracket'>&gt;</span>
  path<span class='operator'>&amp;</span> append<span class='parenthesis'>(</span>InputIterator first, InputIterator last<span class='parenthesis'>)</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.append-7'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.append-7'>7</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L11944'>#</a></div><div id='fs.path.append-7.sentence-1' class='sentence'><span class='textit'>Effects:</span> Equivalent to: <span class='texttt'><span class='keyword'>return</span> <span class='keyword'>operator</span><span class='operator'>/</span><span class='operator'>=</span><span class='parenthesis'>(</span>path<span class='parenthesis'>(</span>first, last<span class='parenthesis'>)</span><span class='parenthesis'>)</span>;</span></div></div></div></div><div id='fs.path.concat' class='section'><h4 ><a class='secnum' href='#fs.path.concat' style='min-width:133pt'>28.11.7.4.4</a> Concatenation <a class='abbr_ref' href='fs.path.concat'>[fs.path.concat]</a></h4><span class='indexparent'><a class='index' id='lib:operator+=,path'></a></span><span class='indexparent'><a class='index' id='lib:path,operator+='></a></span><span class='indexparent'><a class='index' id='lib:concat,path'></a></span><span class='indexparent'><a class='index' id='lib:path,concat'></a></span><div class='itemdecl' id='fs.path.concat-itemdecl:1'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.concat-itemdecl:1'>🔗</a></div><code class='itemdeclcode'>path<span class='operator'>&amp;</span> <span class='keyword'>operator</span><span class='operator'>+</span><span class='operator'>=</span><span class='parenthesis'>(</span><span class='keyword'>const</span> path<span class='operator'>&amp;</span> x<span class='parenthesis'>)</span>;
path<span class='operator'>&amp;</span> <span class='keyword'>operator</span><span class='operator'>+</span><span class='operator'>=</span><span class='parenthesis'>(</span><span class='keyword'>const</span> string_type<span class='operator'>&amp;</span> x<span class='parenthesis'>)</span>;
path<span class='operator'>&amp;</span> <span class='keyword'>operator</span><span class='operator'>+</span><span class='operator'>=</span><span class='parenthesis'>(</span>basic_string_view<span class='anglebracket'>&lt;</span>value_type<span class='anglebracket'>&gt;</span> x<span class='parenthesis'>)</span>;
path<span class='operator'>&amp;</span> <span class='keyword'>operator</span><span class='operator'>+</span><span class='operator'>=</span><span class='parenthesis'>(</span><span class='keyword'>const</span> value_type<span class='operator'>*</span> x<span class='parenthesis'>)</span>;
path<span class='operator'>&amp;</span> <span class='keyword'>operator</span><span class='operator'>+</span><span class='operator'>=</span><span class='parenthesis'>(</span>value_type x<span class='parenthesis'>)</span>;
<span class='keyword'>template</span><span class='anglebracket'>&lt;</span><span class='keyword'>class</span> Source<span class='anglebracket'>&gt;</span>
  path<span class='operator'>&amp;</span> <span class='keyword'>operator</span><span class='operator'>+</span><span class='operator'>=</span><span class='parenthesis'>(</span><span class='keyword'>const</span> Source<span class='operator'>&amp;</span> x<span class='parenthesis'>)</span>;
<span class='keyword'>template</span><span class='anglebracket'>&lt;</span><span class='keyword'>class</span> EcharT<span class='anglebracket'>&gt;</span>
  path<span class='operator'>&amp;</span> <span class='keyword'>operator</span><span class='operator'>+</span><span class='operator'>=</span><span class='parenthesis'>(</span>EcharT x<span class='parenthesis'>)</span>;
<span class='keyword'>template</span><span class='anglebracket'>&lt;</span><span class='keyword'>class</span> Source<span class='anglebracket'>&gt;</span>
  path<span class='operator'>&amp;</span> concat<span class='parenthesis'>(</span><span class='keyword'>const</span> Source<span class='operator'>&amp;</span> x<span class='parenthesis'>)</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.concat-1'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.concat-1'>1</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L11967'>#</a></div><div id='fs.path.concat-1.sentence-1' class='sentence'><span class='textit'>Effects:</span> Appends <span class='texttt'>path<span class='parenthesis'>(</span>x<span class='parenthesis'>)</span><span class='operator'>.</span>native<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span> to the pathname in the native format<a class='hidden_link' href='#fs.path.concat-1.sentence-1'>.</a></div> <div id='fs.path.concat-1.note-1' class='note'>[<span style='white-space:nowrap'> </span><a class='note_link' href='#fs.path.concat-1.note-1'><span class='textit'>Note</span></a><div class='noteBody'><span class='textit'>:</span> <div id='fs.path.concat-1.sentence-2' class='sentence'>This directly manipulates the value of <span class='texttt'>native<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span>
and may not be portable between operating systems<a class='hidden_link' href='#fs.path.concat-1.sentence-2'>.</a></div> —<span style='white-space:nowrap'> </span><i>end note</i></div><span style='white-space:nowrap'> </span>]</div> </div></div><div class='para' id='fs.path.concat-2'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.concat-2'>2</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L11974'>#</a></div><div id='fs.path.concat-2.sentence-1' class='sentence'><span class='textit'>Returns:</span> <span class='texttt'><span class='operator'>*</span><span class='keyword'>this</span></span><a class='hidden_link' href='#fs.path.concat-2.sentence-1'>.</a></div></div></div><span class='indexparent'><a class='index' id='lib:concat,path_'></a></span><span class='indexparent'><a class='index' id='lib:path,concat_'></a></span><div class='itemdecl' id='fs.path.concat-itemdecl:2'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.concat-itemdecl:2'>🔗</a></div><code class='itemdeclcode'><span class='keyword'>template</span><span class='anglebracket'>&lt;</span><span class='keyword'>class</span> InputIterator<span class='anglebracket'>&gt;</span>
  path<span class='operator'>&amp;</span> concat<span class='parenthesis'>(</span>InputIterator first, InputIterator last<span class='parenthesis'>)</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.concat-3'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.concat-3'>3</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L11985'>#</a></div><div id='fs.path.concat-3.sentence-1' class='sentence'><span class='textit'>Effects:</span> Equivalent to: <span class='texttt'><span class='keyword'>return</span> <span class='operator'>*</span><span class='keyword'>this</span> <span class='operator'>+</span><span class='operator'>=</span> path<span class='parenthesis'>(</span>first, last<span class='parenthesis'>)</span>;</span></div></div></div></div><div id='fs.path.modifiers' class='section'><h4 ><a class='secnum' href='#fs.path.modifiers' style='min-width:133pt'>28.11.7.4.5</a> Modifiers <a class='abbr_ref' href='fs.path.modifiers'>[fs.path.modifiers]</a></h4><span class='indexparent'><a class='index' id='lib:clear,path'></a></span><span class='indexparent'><a class='index' id='lib:path,clear'></a></span><div class='itemdecl' id='fs.path.modifiers-itemdecl:1'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.modifiers-itemdecl:1'>🔗</a></div><code class='itemdeclcode'><span class='keyword'>void</span> clear<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>noexcept</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.modifiers-1'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.modifiers-1'>1</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L11997'>#</a></div><div id='fs.path.modifiers-1.sentence-1' class='sentence'><span class='textit'>Ensures:</span> <span class='texttt'>empty<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='operator'>=</span><span class='operator'>=</span> <span class='literal'>true</span></span><a class='hidden_link' href='#fs.path.modifiers-1.sentence-1'>.</a></div></div></div><span class='indexparent'><a class='index' id='lib:make_preferred,path'></a></span><span class='indexparent'><a class='index' id='lib:path,make_preferred'></a></span><div class='itemdecl' id='fs.path.modifiers-itemdecl:2'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.modifiers-itemdecl:2'>🔗</a></div><code class='itemdeclcode'>path<span class='operator'>&amp;</span> make_preferred<span class='parenthesis'>(</span><span class='parenthesis'>)</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.modifiers-2'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.modifiers-2'>2</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12007'>#</a></div><div id='fs.path.modifiers-2.sentence-1' class='sentence'><span class='textit'>Effects:</span> Each <i ><a href='#nt:directory-separator'>directory-separator</a></i>
of the pathname in the generic format
  is converted to <i ><a href='#nt:preferred-separator'>preferred-separator</a></i><a class='hidden_link' href='#fs.path.modifiers-2.sentence-1'>.</a></div></div></div><div class='para' id='fs.path.modifiers-3'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.modifiers-3'>3</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12012'>#</a></div><div id='fs.path.modifiers-3.sentence-1' class='sentence'><span class='textit'>Returns:</span> <span class='texttt'><span class='operator'>*</span><span class='keyword'>this</span></span><a class='hidden_link' href='#fs.path.modifiers-3.sentence-1'>.</a></div></div></div><div class='para' id='fs.path.modifiers-4'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.modifiers-4'>4</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12015'>#</a></div><div id='fs.path.modifiers-4.example-1' class='example'>[<span style='white-space:nowrap'> </span><a class='example_link' href='#fs.path.modifiers-4.example-1'><span class='textit'>Example</span></a><div class='exampleBody'><span class='textit'>:</span> <pre class='codeblock'>
path p<span class='parenthesis'>(</span><span class='literal'>"foo/bar"</span><span class='parenthesis'>)</span>;
std<span class='operator'>:</span><span class='operator'>:</span>cout <span class='anglebracket'>&lt;</span><span class='anglebracket'>&lt;</span> p <span class='anglebracket'>&lt;</span><span class='anglebracket'>&lt;</span> <span class='literal'>'\n'</span>;
p<span class='operator'>.</span>make_preferred<span class='parenthesis'>(</span><span class='parenthesis'>)</span>;
std<span class='operator'>:</span><span class='operator'>:</span>cout <span class='anglebracket'>&lt;</span><span class='anglebracket'>&lt;</span> p <span class='anglebracket'>&lt;</span><span class='anglebracket'>&lt;</span> <span class='literal'>'\n'</span>;
</pre> <div id='fs.path.modifiers-4.sentence-1' class='sentence'>
On an operating system where <i ><a href='#nt:preferred-separator'>preferred-separator</a></i> is a slash,
the output is:
<pre class='codeblock'>
<span class='literal'>"foo/bar"</span>
<span class='literal'>"foo/bar"</span>
</pre></div> <div id='fs.path.modifiers-4.sentence-2' class='sentence'>
On an operating system where <i ><a href='#nt:preferred-separator'>preferred-separator</a></i> is a backslash, the
output is:
<pre class='codeblock'>
<span class='literal'>"foo/bar"</span>
<span class='literal'>"foo\bar"</span>
</pre></div> —<span style='white-space:nowrap'> </span><i>end example</i></div><span style='white-space:nowrap'> </span>]</div> </div></div><span class='indexparent'><a class='index' id='lib:remove_filename,path'></a></span><span class='indexparent'><a class='index' id='lib:path,remove_filename'></a></span><div class='itemdecl' id='fs.path.modifiers-itemdecl:3'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.modifiers-itemdecl:3'>🔗</a></div><code class='itemdeclcode'>path<span class='operator'>&amp;</span> remove_filename<span class='parenthesis'>(</span><span class='parenthesis'>)</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.modifiers-5'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.modifiers-5'>5</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12044'>#</a></div><div id='fs.path.modifiers-5.sentence-1' class='sentence'><span class='textit'>Ensures:</span> <span class='texttt'><span class='operator'>!</span>has_&shy;filename<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span><a class='hidden_link' href='#fs.path.modifiers-5.sentence-1'>.</a></div></div></div><div class='para' id='fs.path.modifiers-6'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.modifiers-6'>6</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12047'>#</a></div><div id='fs.path.modifiers-6.sentence-1' class='sentence'><span class='textit'>Effects:</span> Remove the generic format pathname of <span class='texttt'>filename<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span> from the generic format pathname<a class='hidden_link' href='#fs.path.modifiers-6.sentence-1'>.</a></div></div></div><div class='para' id='fs.path.modifiers-7'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.modifiers-7'>7</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12050'>#</a></div><div id='fs.path.modifiers-7.sentence-1' class='sentence'><span class='textit'>Returns:</span> <span class='texttt'><span class='operator'>*</span><span class='keyword'>this</span></span><a class='hidden_link' href='#fs.path.modifiers-7.sentence-1'>.</a></div></div></div><div class='para' id='fs.path.modifiers-8'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.modifiers-8'>8</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12053'>#</a></div><div id='fs.path.modifiers-8.example-1' class='example'>[<span style='white-space:nowrap'> </span><a class='example_link' href='#fs.path.modifiers-8.example-1'><span class='textit'>Example</span></a><div class='exampleBody'><span class='textit'>:</span> <pre class='codeblock'>
path<span class='parenthesis'>(</span><span class='literal'>"foo/bar"</span><span class='parenthesis'>)</span><span class='operator'>.</span>remove_filename<span class='parenthesis'>(</span><span class='parenthesis'>)</span>; <span class='comment'>// yields <span class='tcode_in_codeblock'>"foo/"</span></span>
path<span class='parenthesis'>(</span><span class='literal'>"foo/"</span><span class='parenthesis'>)</span><span class='operator'>.</span>remove_filename<span class='parenthesis'>(</span><span class='parenthesis'>)</span>;    <span class='comment'>// yields <span class='tcode_in_codeblock'>"foo/"</span></span>
path<span class='parenthesis'>(</span><span class='literal'>"/foo"</span><span class='parenthesis'>)</span><span class='operator'>.</span>remove_filename<span class='parenthesis'>(</span><span class='parenthesis'>)</span>;    <span class='comment'>// yields <span class='tcode_in_codeblock'>"/"</span></span>
path<span class='parenthesis'>(</span><span class='literal'>"/"</span><span class='parenthesis'>)</span><span class='operator'>.</span>remove_filename<span class='parenthesis'>(</span><span class='parenthesis'>)</span>;       <span class='comment'>// yields <span class='tcode_in_codeblock'>"/"</span></span>
</pre> —<span style='white-space:nowrap'> </span><i>end example</i></div><span style='white-space:nowrap'> </span>]</div> </div></div><span class='indexparent'><a class='index' id='lib:replace_filename,path'></a></span><span class='indexparent'><a class='index' id='lib:path,replace_filename'></a></span><div class='itemdecl' id='fs.path.modifiers-itemdecl:4'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.modifiers-itemdecl:4'>🔗</a></div><code class='itemdeclcode'>path<span class='operator'>&amp;</span> replace_filename<span class='parenthesis'>(</span><span class='keyword'>const</span> path<span class='operator'>&amp;</span> replacement<span class='parenthesis'>)</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.modifiers-9'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.modifiers-9'>9</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12070'>#</a></div><div id='fs.path.modifiers-9.sentence-1' class='sentence'><span class='textit'>Effects:</span> 
Equivalent to:
<pre class='codeblock'>
remove_filename<span class='parenthesis'>(</span><span class='parenthesis'>)</span>;
<span class='keyword'>operator</span><span class='operator'>/</span><span class='operator'>=</span><span class='parenthesis'>(</span>replacement<span class='parenthesis'>)</span>;
</pre></div></div></div><div class='para' id='fs.path.modifiers-10'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.modifiers-10'>10</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12078'>#</a></div><div id='fs.path.modifiers-10.sentence-1' class='sentence'><span class='textit'>Returns:</span> <span class='texttt'><span class='operator'>*</span><span class='keyword'>this</span></span><a class='hidden_link' href='#fs.path.modifiers-10.sentence-1'>.</a></div></div></div><div class='para' id='fs.path.modifiers-11'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.modifiers-11'>11</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12081'>#</a></div><div id='fs.path.modifiers-11.example-1' class='example'>[<span style='white-space:nowrap'> </span><a class='example_link' href='#fs.path.modifiers-11.example-1'><span class='textit'>Example</span></a><div class='exampleBody'><span class='textit'>:</span> <pre class='codeblock'>
path<span class='parenthesis'>(</span><span class='literal'>"/foo"</span><span class='parenthesis'>)</span><span class='operator'>.</span>replace_filename<span class='parenthesis'>(</span><span class='literal'>"bar"</span><span class='parenthesis'>)</span>;  <span class='comment'>// yields <span class='tcode_in_codeblock'>"/bar"</span> on POSIX</span>
path<span class='parenthesis'>(</span><span class='literal'>"/"</span><span class='parenthesis'>)</span><span class='operator'>.</span>replace_filename<span class='parenthesis'>(</span><span class='literal'>"bar"</span><span class='parenthesis'>)</span>;     <span class='comment'>// yields <span class='tcode_in_codeblock'>"/bar"</span> on POSIX</span>
</pre> —<span style='white-space:nowrap'> </span><i>end example</i></div><span style='white-space:nowrap'> </span>]</div> </div></div><span class='indexparent'><a class='index' id='lib:replace_extension,path'></a></span><span class='indexparent'><a class='index' id='lib:path,replace_extension'></a></span><div class='itemdecl' id='fs.path.modifiers-itemdecl:5'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.modifiers-itemdecl:5'>🔗</a></div><code class='itemdeclcode'>path<span class='operator'>&amp;</span> replace_extension<span class='parenthesis'>(</span><span class='keyword'>const</span> path<span class='operator'>&amp;</span> replacement <span class='operator'>=</span> path<span class='parenthesis'>(</span><span class='parenthesis'>)</span><span class='parenthesis'>)</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.modifiers-12'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.modifiers-12'>12</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12096'>#</a></div><div id='fs.path.modifiers-12.sentence-1' class='sentence'><span class='textit'>Effects:</span> 
  <ul class='itemize'><li id='fs.path.modifiers-12.1'><div class='marginalizedparent' style='left:-10em'><a class='marginalized' href='#fs.path.modifiers-12.1'>(12.1)</a></div><div id='fs.path.modifiers-12.1.sentence-1' class='sentence'>Any existing <span class='texttt'>extension<span class='parenthesis'>(</span><span class='parenthesis'>)</span><span class='parenthesis'>(</span></span><a href='#fs.path.decompose'>[fs.path.decompose]</a><span class='texttt'><span class='parenthesis'>)</span></span> is removed from the
    pathname in the generic format,
    then</div></li><li id='fs.path.modifiers-12.2'><div class='marginalizedparent' style='left:-10em'><a class='marginalized' href='#fs.path.modifiers-12.2'>(12.2)</a></div><div id='fs.path.modifiers-12.2.sentence-1' class='sentence'>If <span class='texttt'>replacement</span> is not empty and does not begin with a dot
    character, a dot character is appended to the pathname in the generic format, then</div></li><li id='fs.path.modifiers-12.3'><div class='marginalizedparent' style='left:-10em'><a class='marginalized' href='#fs.path.modifiers-12.3'>(12.3)</a></div><div id='fs.path.modifiers-12.3.sentence-1' class='sentence'><span class='texttt'><span class='keyword'>operator</span><span class='operator'>+</span><span class='operator'>=</span><span class='parenthesis'>(</span>replacement<span class='parenthesis'>)</span>;</span><a class='hidden_link' href='#fs.path.modifiers-12.3.sentence-1'>.</a></div></li></ul></div></div></div><div class='para' id='fs.path.modifiers-13'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.modifiers-13'>13</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12108'>#</a></div><div id='fs.path.modifiers-13.sentence-1' class='sentence'><span class='textit'>Returns:</span> <span class='texttt'><span class='operator'>*</span><span class='keyword'>this</span></span><a class='hidden_link' href='#fs.path.modifiers-13.sentence-1'>.</a></div></div></div><span class='indexparent'><a class='index' id='lib:swap,path'></a></span><span class='indexparent'><a class='index' id='lib:path,swap'></a></span><div class='itemdecl' id='fs.path.modifiers-itemdecl:6'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.modifiers-itemdecl:6'>🔗</a></div><code class='itemdeclcode'><span class='keyword'>void</span> swap<span class='parenthesis'>(</span>path<span class='operator'>&amp;</span> rhs<span class='parenthesis'>)</span> <span class='keyword'>noexcept</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.modifiers-14'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.modifiers-14'>14</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12118'>#</a></div><div id='fs.path.modifiers-14.sentence-1' class='sentence'><span class='textit'>Effects:</span> Swaps the contents (in all formats) of the two paths<a class='hidden_link' href='#fs.path.modifiers-14.sentence-1'>.</a></div></div></div><div class='para' id='fs.path.modifiers-15'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.modifiers-15'>15</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12121'>#</a></div><div id='fs.path.modifiers-15.sentence-1' class='sentence'><span class='textit'>Complexity:</span> Constant time<a class='hidden_link' href='#fs.path.modifiers-15.sentence-1'>.</a></div></div></div></div><div id='fs.path.native.obs' class='section'><h4 ><a class='secnum' href='#fs.path.native.obs' style='min-width:133pt'>28.11.7.4.6</a> Native format observers <a class='abbr_ref' href='fs.path.native.obs'>[fs.path.native.obs]</a></h4><div class='para' id='fs.path.native.obs-1'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.native.obs-1'>1</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12127'>#</a></div><div id='fs.path.native.obs-1.sentence-1' class='sentence'>The string returned by all native format observers is in the native pathname format (<a href='#fs.class.path'>[fs.class.path]</a>)<a class='hidden_link' href='#fs.path.native.obs-1.sentence-1'>.</a></div> <span class='indexparent'><a class='index' id='lib:native,path'></a></span><span class='indexparent'><a class='index' id='lib:path,native'></a></span></div><div class='itemdecl' id='fs.path.native.obs-itemdecl:1'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.native.obs-itemdecl:1'>🔗</a></div><code class='itemdeclcode'><span class='keyword'>const</span> string_type<span class='operator'>&amp;</span> native<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span> <span class='keyword'>noexcept</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.native.obs-2'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.native.obs-2'>2</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12136'>#</a></div><div id='fs.path.native.obs-2.sentence-1' class='sentence'><span class='textit'>Returns:</span> The pathname in the native format<a class='hidden_link' href='#fs.path.native.obs-2.sentence-1'>.</a></div></div></div><span class='indexparent'><a class='index' id='lib:c_str,path'></a></span><span class='indexparent'><a class='index' id='lib:path,c_str'></a></span><div class='itemdecl' id='fs.path.native.obs-itemdecl:2'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.native.obs-itemdecl:2'>🔗</a></div><code class='itemdeclcode'><span class='keyword'>const</span> value_type<span class='operator'>*</span> c_str<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span> <span class='keyword'>noexcept</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.native.obs-3'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.native.obs-3'>3</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12146'>#</a></div><div id='fs.path.native.obs-3.sentence-1' class='sentence'><span class='textit'>Effects:</span> Equivalent to: <span class='texttt'><span class='keyword'>return</span> native<span class='parenthesis'>(</span><span class='parenthesis'>)</span><span class='operator'>.</span>c_&shy;str<span class='parenthesis'>(</span><span class='parenthesis'>)</span>;</span></div></div></div><span class='indexparent'><a class='index' id='lib:operator_string_type,path'></a></span><span class='indexparent'><a class='index' id='lib:path,operator_string_type'></a></span><div class='itemdecl' id='fs.path.native.obs-itemdecl:3'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.native.obs-itemdecl:3'>🔗</a></div><code class='itemdeclcode'><span class='keyword'>operator</span> string_type<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.native.obs-4'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.native.obs-4'>4</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12156'>#</a></div><div id='fs.path.native.obs-4.sentence-1' class='sentence'><span class='textit'>Returns:</span> <span class='texttt'>native<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span><a class='hidden_link' href='#fs.path.native.obs-4.sentence-1'>.</a></div></div></div><div class='para' id='fs.path.native.obs-5'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.native.obs-5'>5</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12159'>#</a></div><div id='fs.path.native.obs-5.note-1' class='note'>[<span style='white-space:nowrap'> </span><a class='note_link' href='#fs.path.native.obs-5.note-1'><span class='textit'>Note</span></a><div class='noteBody'><span class='textit'>:</span> <div id='fs.path.native.obs-5.sentence-1' class='sentence'>Conversion to <span class='texttt'>string_&shy;type</span> is provided so that an
  object of class <span class='texttt'>path</span> can be given as an argument to existing
  standard library file stream constructors and open functions<a class='hidden_link' href='#fs.path.native.obs-5.sentence-1'>.</a></div> —<span style='white-space:nowrap'> </span><i>end note</i></div><span style='white-space:nowrap'> </span>]</div> </div></div><span class='indexparent'><a class='index' id='lib:string,path'></a></span><span class='indexparent'><a class='index' id='lib:path,string'></a></span><div class='itemdecl' id='fs.path.native.obs-itemdecl:4'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.native.obs-itemdecl:4'>🔗</a></div><code class='itemdeclcode'><span class='keyword'>template</span><span class='anglebracket'>&lt;</span><span class='keyword'>class</span> EcharT, <span class='keyword'>class</span> traits <span class='operator'>=</span> char_traits<span class='anglebracket'>&lt;</span>EcharT<span class='anglebracket'>&gt;</span>,
         <span class='keyword'>class</span> Allocator <span class='operator'>=</span> allocator<span class='anglebracket'>&lt;</span>EcharT<span class='anglebracket'>&gt;</span><span class='anglebracket'>&gt;</span>
  basic_string<span class='anglebracket'>&lt;</span>EcharT, traits, Allocator<span class='anglebracket'>&gt;</span>
    string<span class='parenthesis'>(</span><span class='keyword'>const</span> Allocator<span class='operator'>&amp;</span> a <span class='operator'>=</span> Allocator<span class='parenthesis'>(</span><span class='parenthesis'>)</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.native.obs-6'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.native.obs-6'>6</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12174'>#</a></div><div id='fs.path.native.obs-6.sentence-1' class='sentence'><span class='textit'>Returns:</span> <span class='texttt'>native<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span><a class='hidden_link' href='#fs.path.native.obs-6.sentence-1'>.</a></div></div></div><div class='para' id='fs.path.native.obs-7'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.native.obs-7'>7</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12177'>#</a></div><div id='fs.path.native.obs-7.sentence-1' class='sentence'><span class='textit'>Remarks:</span> All memory allocation, including for the return value, shall
be performed by <span class='texttt'>a</span><a class='hidden_link' href='#fs.path.native.obs-7.sentence-1'>.</a></div> <div id='fs.path.native.obs-7.sentence-2' class='sentence'>Conversion, if any, is specified by
<a href='#fs.path.cvt'>[fs.path.cvt]</a><a class='hidden_link' href='#fs.path.native.obs-7.sentence-2'>.</a></div></div></div><span class='indexparent'><a class='index' id='lib:string,path_'></a></span><span class='indexparent'><a class='index' id='lib:path,string_'></a></span><span class='indexparent'><a class='index' id='lib:wstring,path'></a></span><span class='indexparent'><a class='index' id='lib:path,wstring'></a></span><span class='indexparent'><a class='index' id='lib:u8string,path'></a></span><span class='indexparent'><a class='index' id='lib:path,u8string'></a></span><span class='indexparent'><a class='index' id='lib:u16string,path'></a></span><span class='indexparent'><a class='index' id='lib:path,u16string'></a></span><span class='indexparent'><a class='index' id='lib:u32string,path'></a></span><span class='indexparent'><a class='index' id='lib:path,u32string'></a></span><div class='itemdecl' id='fs.path.native.obs-itemdecl:5'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.native.obs-itemdecl:5'>🔗</a></div><code class='itemdeclcode'>std<span class='operator'>:</span><span class='operator'>:</span>string string<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
std<span class='operator'>:</span><span class='operator'>:</span>wstring wstring<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
std<span class='operator'>:</span><span class='operator'>:</span>u8string u8string<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
std<span class='operator'>:</span><span class='operator'>:</span>u16string u16string<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
std<span class='operator'>:</span><span class='operator'>:</span>u32string u32string<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.native.obs-8'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.native.obs-8'>8</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12197'>#</a></div><div id='fs.path.native.obs-8.sentence-1' class='sentence'><span class='textit'>Returns:</span> <span class='texttt'>native<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span><a class='hidden_link' href='#fs.path.native.obs-8.sentence-1'>.</a></div></div></div><div class='para' id='fs.path.native.obs-9'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.native.obs-9'>9</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12200'>#</a></div><div id='fs.path.native.obs-9.sentence-1' class='sentence'><span class='textit'>Remarks:</span> Conversion, if any, is performed as specified
by <a href='#fs.path.cvt'>[fs.path.cvt]</a><a class='hidden_link' href='#fs.path.native.obs-9.sentence-1'>.</a></div></div></div></div><div id='fs.path.generic.obs' class='section'><h4 ><a class='secnum' href='#fs.path.generic.obs' style='min-width:133pt'>28.11.7.4.7</a> Generic format observers <a class='abbr_ref' href='fs.path.generic.obs'>[fs.path.generic.obs]</a></h4><div class='para' id='fs.path.generic.obs-1'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.generic.obs-1'>1</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12208'>#</a></div><div id='fs.path.generic.obs-1.sentence-1' class='sentence'>Generic format observer functions return strings formatted according to the
<a href='#fs.path.generic'>generic pathname format</a><a class='hidden_link' href='#fs.path.generic.obs-1.sentence-1'>.</a></div> <div id='fs.path.generic.obs-1.sentence-2' class='sentence'>A single slash (<span class='texttt'><span class='literal'>'/'</span></span>) character is used as
the <i ><a href='#nt:directory-separator'>directory-separator</a></i><a class='hidden_link' href='#fs.path.generic.obs-1.sentence-2'>.</a></div></div><div class='para' id='fs.path.generic.obs-2'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.generic.obs-2'>2</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12214'>#</a></div><div id='fs.path.generic.obs-2.example-1' class='example'>[<span style='white-space:nowrap'> </span><a class='example_link' href='#fs.path.generic.obs-2.example-1'><span class='textit'>Example</span></a><div class='exampleBody'><span class='textit'>:</span> <div id='fs.path.generic.obs-2.sentence-1' class='sentence'>On an operating system that uses backslash as
its <i ><a href='#nt:preferred-separator'>preferred-separator</a></i>,
<pre class='codeblock'>
path<span class='parenthesis'>(</span><span class='literal'>"foo\\bar"</span><span class='parenthesis'>)</span><span class='operator'>.</span>generic_string<span class='parenthesis'>(</span><span class='parenthesis'>)</span>
</pre>
returns <span class='texttt'><span class='literal'>"foo/bar"</span></span><a class='hidden_link' href='#fs.path.generic.obs-2.sentence-1'>.</a></div> —<span style='white-space:nowrap'> </span><i>end example</i></div><span style='white-space:nowrap'> </span>]</div>  <span class='indexparent'><a class='index' id='lib:generic_string,path'></a></span><span class='indexparent'><a class='index' id='lib:path,generic_string'></a></span></div><div class='itemdecl' id='fs.path.generic.obs-itemdecl:1'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.generic.obs-itemdecl:1'>🔗</a></div><code class='itemdeclcode'><span class='keyword'>template</span><span class='anglebracket'>&lt;</span><span class='keyword'>class</span> EcharT, <span class='keyword'>class</span> traits <span class='operator'>=</span> char_traits<span class='anglebracket'>&lt;</span>EcharT<span class='anglebracket'>&gt;</span>,
         <span class='keyword'>class</span> Allocator <span class='operator'>=</span> allocator<span class='anglebracket'>&lt;</span>EcharT<span class='anglebracket'>&gt;</span><span class='anglebracket'>&gt;</span>
  basic_string<span class='anglebracket'>&lt;</span>EcharT, traits, Allocator<span class='anglebracket'>&gt;</span>
    generic_string<span class='parenthesis'>(</span><span class='keyword'>const</span> Allocator<span class='operator'>&amp;</span> a <span class='operator'>=</span> Allocator<span class='parenthesis'>(</span><span class='parenthesis'>)</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.generic.obs-3'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.generic.obs-3'>3</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12231'>#</a></div><div id='fs.path.generic.obs-3.sentence-1' class='sentence'><span class='textit'>Returns:</span> The pathname in the generic format<a class='hidden_link' href='#fs.path.generic.obs-3.sentence-1'>.</a></div></div></div><div class='para' id='fs.path.generic.obs-4'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.generic.obs-4'>4</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12234'>#</a></div><div id='fs.path.generic.obs-4.sentence-1' class='sentence'><span class='textit'>Remarks:</span> All memory allocation, including for the return value, shall
be performed by <span class='texttt'>a</span><a class='hidden_link' href='#fs.path.generic.obs-4.sentence-1'>.</a></div> <div id='fs.path.generic.obs-4.sentence-2' class='sentence'>Conversion, if any, is specified by
<a href='#fs.path.cvt'>[fs.path.cvt]</a><a class='hidden_link' href='#fs.path.generic.obs-4.sentence-2'>.</a></div></div></div><span class='indexparent'><a class='index' id='lib:generic_string,path_'></a></span><span class='indexparent'><a class='index' id='lib:path,generic_string_'></a></span><span class='indexparent'><a class='index' id='lib:generic_wstring,path'></a></span><span class='indexparent'><a class='index' id='lib:path,generic_wstring'></a></span><span class='indexparent'><a class='index' id='lib:generic_u8string,path'></a></span><span class='indexparent'><a class='index' id='lib:path,generic_u8string'></a></span><span class='indexparent'><a class='index' id='lib:generic_u16string,path'></a></span><span class='indexparent'><a class='index' id='lib:path,generic_u16string'></a></span><span class='indexparent'><a class='index' id='lib:generic_u32string,path'></a></span><span class='indexparent'><a class='index' id='lib:path,generic_u32string'></a></span><div class='itemdecl' id='fs.path.generic.obs-itemdecl:2'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.generic.obs-itemdecl:2'>🔗</a></div><code class='itemdeclcode'>std<span class='operator'>:</span><span class='operator'>:</span>string generic_string<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
std<span class='operator'>:</span><span class='operator'>:</span>wstring generic_wstring<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
std<span class='operator'>:</span><span class='operator'>:</span>u8string generic_u8string<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
std<span class='operator'>:</span><span class='operator'>:</span>u16string generic_u16string<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
std<span class='operator'>:</span><span class='operator'>:</span>u32string generic_u32string<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.generic.obs-5'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.generic.obs-5'>5</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12254'>#</a></div><div id='fs.path.generic.obs-5.sentence-1' class='sentence'><span class='textit'>Returns:</span> The pathname in the generic format<a class='hidden_link' href='#fs.path.generic.obs-5.sentence-1'>.</a></div></div></div><div class='para' id='fs.path.generic.obs-6'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.generic.obs-6'>6</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12257'>#</a></div><div id='fs.path.generic.obs-6.sentence-1' class='sentence'><span class='textit'>Remarks:</span> Conversion, if any, is specified by <a href='#fs.path.cvt'>[fs.path.cvt]</a><a class='hidden_link' href='#fs.path.generic.obs-6.sentence-1'>.</a></div></div></div></div><div id='fs.path.compare' class='section'><h4 ><a class='secnum' href='#fs.path.compare' style='min-width:133pt'>28.11.7.4.8</a> Compare <a class='abbr_ref' href='fs.path.compare'>[fs.path.compare]</a></h4><span class='indexparent'><a class='index' id='lib:compare,path'></a></span><span class='indexparent'><a class='index' id='lib:path,compare'></a></span><div class='itemdecl' id='fs.path.compare-itemdecl:1'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.compare-itemdecl:1'>🔗</a></div><code class='itemdeclcode'><span class='keyword'>int</span> compare<span class='parenthesis'>(</span><span class='keyword'>const</span> path<span class='operator'>&amp;</span> p<span class='parenthesis'>)</span> <span class='keyword'>const</span> <span class='keyword'>noexcept</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.compare-1'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.compare-1'>1</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12269'>#</a></div><div id='fs.path.compare-1.sentence-1' class='sentence'><span class='textit'>Returns:</span> 
<ul class='itemize'><li id='fs.path.compare-1.1'><div class='marginalizedparent' style='left:-10em'><a class='marginalized' href='#fs.path.compare-1.1'>(1.1)</a></div><div id='fs.path.compare-1.1.sentence-1' class='sentence'>Let <span class='texttt'>rootNameComparison</span> be the result of
  <span class='texttt'><span class='keyword'>this</span><span class='operator'>-</span><span class='anglebracket'>&gt;</span>root_&shy;name<span class='parenthesis'>(</span><span class='parenthesis'>)</span><span class='operator'>.</span>native<span class='parenthesis'>(</span><span class='parenthesis'>)</span><span class='operator'>.</span>compare<span class='parenthesis'>(</span>p<span class='operator'>.</span>root_&shy;name<span class='parenthesis'>(</span><span class='parenthesis'>)</span><span class='operator'>.</span>native<span class='parenthesis'>(</span><span class='parenthesis'>)</span><span class='parenthesis'>)</span></span><a class='hidden_link' href='#fs.path.compare-1.1.sentence-1'>.</a></div> <div id='fs.path.compare-1.1.sentence-2' class='sentence'>If <span class='texttt'>rootNameComparison</span> is not <span class='texttt'><span class='literal'>0</span></span>,
  <span class='texttt'>rootNameComparison</span><a class='hidden_link' href='#fs.path.compare-1.1.sentence-2'>.</a></div></li><li id='fs.path.compare-1.2'><div class='marginalizedparent' style='left:-10em'><a class='marginalized' href='#fs.path.compare-1.2'>(1.2)</a></div><div id='fs.path.compare-1.2.sentence-1' class='sentence'>Otherwise, if
  <span class='texttt'><span class='operator'>!</span><span class='keyword'>this</span><span class='operator'>-</span><span class='anglebracket'>&gt;</span>has_&shy;root_&shy;directory<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span> and <span class='texttt'>p<span class='operator'>.</span>has_&shy;root_&shy;directory<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span>,
  a value less than <span class='texttt'><span class='literal'>0</span></span><a class='hidden_link' href='#fs.path.compare-1.2.sentence-1'>.</a></div></li><li id='fs.path.compare-1.3'><div class='marginalizedparent' style='left:-10em'><a class='marginalized' href='#fs.path.compare-1.3'>(1.3)</a></div><div id='fs.path.compare-1.3.sentence-1' class='sentence'>Otherwise, if
  <span class='texttt'><span class='keyword'>this</span><span class='operator'>-</span><span class='anglebracket'>&gt;</span>has_&shy;root_&shy;directory<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span> and <span class='texttt'><span class='operator'>!</span>p<span class='operator'>.</span>has_&shy;root_&shy;directory<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span>,
  a value greater than <span class='texttt'><span class='literal'>0</span></span><a class='hidden_link' href='#fs.path.compare-1.3.sentence-1'>.</a></div></li><li id='fs.path.compare-1.4'><div class='marginalizedparent' style='left:-10em'><a class='marginalized' href='#fs.path.compare-1.4'>(1.4)</a></div><div id='fs.path.compare-1.4.sentence-1' class='sentence'>Otherwise, if
  <span class='texttt'>native<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span> for the elements of <span class='texttt'><span class='keyword'>this</span><span class='operator'>-</span><span class='anglebracket'>&gt;</span>relative_&shy;path<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span>
  are lexicographically less than
  <span class='texttt'>native<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span> for the elements of <span class='texttt'>p<span class='operator'>.</span>relative_&shy;path<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span>,
  a value less than <span class='texttt'><span class='literal'>0</span></span><a class='hidden_link' href='#fs.path.compare-1.4.sentence-1'>.</a></div></li><li id='fs.path.compare-1.5'><div class='marginalizedparent' style='left:-10em'><a class='marginalized' href='#fs.path.compare-1.5'>(1.5)</a></div><div id='fs.path.compare-1.5.sentence-1' class='sentence'>Otherwise, if
  <span class='texttt'>native<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span> for the elements of <span class='texttt'><span class='keyword'>this</span><span class='operator'>-</span><span class='anglebracket'>&gt;</span>relative_&shy;path<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span>
  are lexicographically greater than
  <span class='texttt'>native<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span> for the elements of <span class='texttt'>p<span class='operator'>.</span>relative_&shy;path<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span>,
  a value greater than <span class='texttt'><span class='literal'>0</span></span><a class='hidden_link' href='#fs.path.compare-1.5.sentence-1'>.</a></div></li><li id='fs.path.compare-1.6'><div class='marginalizedparent' style='left:-10em'><a class='marginalized' href='#fs.path.compare-1.6'>(1.6)</a></div><div id='fs.path.compare-1.6.sentence-1' class='sentence'>Otherwise, <span class='texttt'><span class='literal'>0</span></span><a class='hidden_link' href='#fs.path.compare-1.6.sentence-1'>.</a></div></li></ul></div></div></div><span class='indexparent'><a class='index' id='lib:compare,path_'></a></span><span class='indexparent'><a class='index' id='lib:path,compare_'></a></span><div class='itemdecl' id='fs.path.compare-itemdecl:2'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.compare-itemdecl:2'>🔗</a></div><code class='itemdeclcode'><span class='keyword'>int</span> compare<span class='parenthesis'>(</span><span class='keyword'>const</span> string_type<span class='operator'>&amp;</span> s<span class='parenthesis'>)</span> <span class='keyword'>const</span>
<span class='keyword'>int</span> compare<span class='parenthesis'>(</span>basic_string_view<span class='anglebracket'>&lt;</span>value_type<span class='anglebracket'>&gt;</span> s<span class='parenthesis'>)</span> <span class='keyword'>const</span>;
<span class='keyword'>int</span> compare<span class='parenthesis'>(</span><span class='keyword'>const</span> value_type<span class='operator'>*</span> s<span class='parenthesis'>)</span> <span class='keyword'>const</span>
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.compare-2'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.compare-2'>2</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12310'>#</a></div><div id='fs.path.compare-2.sentence-1' class='sentence'><span class='textit'>Effects:</span> Equivalent to: <span class='texttt'><span class='keyword'>return</span> compare<span class='parenthesis'>(</span>path<span class='parenthesis'>(</span>s<span class='parenthesis'>)</span><span class='parenthesis'>)</span>;</span></div></div></div></div><div id='fs.path.decompose' class='section'><h4 ><a class='secnum' href='#fs.path.decompose' style='min-width:133pt'>28.11.7.4.9</a> Decomposition <a class='abbr_ref' href='fs.path.decompose'>[fs.path.decompose]</a></h4><span class='indexparent'><a class='index' id='lib:root_name,path'></a></span><span class='indexparent'><a class='index' id='lib:path,root_name'></a></span><div class='itemdecl' id='fs.path.decompose-itemdecl:1'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.decompose-itemdecl:1'>🔗</a></div><code class='itemdeclcode'>path root_name<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.decompose-1'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.decompose-1'>1</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12322'>#</a></div><div id='fs.path.decompose-1.sentence-1' class='sentence'><span class='textit'>Returns:</span> <i ><a href='#nt:root-name'>root-name</a></i>, if the pathname in the generic format
includes <i ><a href='#nt:root-name'>root-name</a></i>, otherwise <span class='texttt'>path<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span><a class='hidden_link' href='#fs.path.decompose-1.sentence-1'>.</a></div></div></div><span class='indexparent'><a class='index' id='lib:root_directory,path'></a></span><span class='indexparent'><a class='index' id='lib:path,root_directory'></a></span><div class='itemdecl' id='fs.path.decompose-itemdecl:2'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.decompose-itemdecl:2'>🔗</a></div><code class='itemdeclcode'>path root_directory<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.decompose-2'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.decompose-2'>2</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12333'>#</a></div><div id='fs.path.decompose-2.sentence-1' class='sentence'><span class='textit'>Returns:</span> <i ><a href='#nt:root-directory'>root-directory</a></i>, if the pathname in the generic format
includes <i ><a href='#nt:root-directory'>root-directory</a></i>, otherwise <span class='texttt'>path<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span><a class='hidden_link' href='#fs.path.decompose-2.sentence-1'>.</a></div></div></div><span class='indexparent'><a class='index' id='lib:root_path,path'></a></span><span class='indexparent'><a class='index' id='lib:path,root_path'></a></span><div class='itemdecl' id='fs.path.decompose-itemdecl:3'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.decompose-itemdecl:3'>🔗</a></div><code class='itemdeclcode'>path root_path<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.decompose-3'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.decompose-3'>3</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12344'>#</a></div><div id='fs.path.decompose-3.sentence-1' class='sentence'><span class='textit'>Returns:</span> <span class='texttt'>root_&shy;name<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='operator'>/</span> root_&shy;directory<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span><a class='hidden_link' href='#fs.path.decompose-3.sentence-1'>.</a></div></div></div><span class='indexparent'><a class='index' id='lib:relative_path,path'></a></span><span class='indexparent'><a class='index' id='lib:path,relative_path'></a></span><div class='itemdecl' id='fs.path.decompose-itemdecl:4'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.decompose-itemdecl:4'>🔗</a></div><code class='itemdeclcode'>path relative_path<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.decompose-4'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.decompose-4'>4</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12354'>#</a></div><div id='fs.path.decompose-4.sentence-1' class='sentence'><span class='textit'>Returns:</span> A <span class='texttt'>path</span> composed from the pathname in the generic format,
if <span class='texttt'>empty<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span> is <span class='texttt'><span class='literal'>false</span></span>, beginning
with the first <i ><a href='#nt:filename'>filename</a></i> after <span class='texttt'>root_&shy;path<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span><a class='hidden_link' href='#fs.path.decompose-4.sentence-1'>.</a></div> <div id='fs.path.decompose-4.sentence-2' class='sentence'>Otherwise, <span class='texttt'>path<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span><a class='hidden_link' href='#fs.path.decompose-4.sentence-2'>.</a></div></div></div><span class='indexparent'><a class='index' id='lib:parent_path,path'></a></span><span class='indexparent'><a class='index' id='lib:path,parent_path'></a></span><div class='itemdecl' id='fs.path.decompose-itemdecl:5'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.decompose-itemdecl:5'>🔗</a></div><code class='itemdeclcode'>path parent_path<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.decompose-5'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.decompose-5'>5</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12366'>#</a></div><div id='fs.path.decompose-5.sentence-1' class='sentence'><span class='textit'>Returns:</span> <span class='texttt'><span class='operator'>*</span><span class='keyword'>this</span></span> if <span class='texttt'>has_&shy;relative_&shy;path<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span> is <span class='texttt'><span class='literal'>false</span></span>,
otherwise a path whose generic format pathname is
the longest prefix of the generic format pathname of <span class='texttt'><span class='operator'>*</span><span class='keyword'>this</span></span>
that produces one fewer element in its iteration<a class='hidden_link' href='#fs.path.decompose-5.sentence-1'>.</a></div></div></div><span class='indexparent'><a class='index' id='lib:filename,path'></a></span><span class='indexparent'><a class='index' id='lib:path,filename'></a></span><div class='itemdecl' id='fs.path.decompose-itemdecl:6'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.decompose-itemdecl:6'>🔗</a></div><code class='itemdeclcode'>path filename<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.decompose-6'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.decompose-6'>6</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12379'>#</a></div><div id='fs.path.decompose-6.sentence-1' class='sentence'><span class='textit'>Returns:</span> <span class='texttt'>relative_&shy;path<span class='parenthesis'>(</span><span class='parenthesis'>)</span><span class='operator'>.</span>empty<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='operator'>?</span> path<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='operator'>:</span> <span class='operator'>*</span><span class='operator'>-</span><span class='operator'>-</span>end<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span><a class='hidden_link' href='#fs.path.decompose-6.sentence-1'>.</a></div></div></div><div class='para' id='fs.path.decompose-7'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.decompose-7'>7</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12382'>#</a></div><div id='fs.path.decompose-7.example-1' class='example'>[<span style='white-space:nowrap'> </span><a class='example_link' href='#fs.path.decompose-7.example-1'><span class='textit'>Example</span></a><div class='exampleBody'><span class='textit'>:</span> <pre class='codeblock'>
path<span class='parenthesis'>(</span><span class='literal'>"/foo/bar.txt"</span><span class='parenthesis'>)</span><span class='operator'>.</span>filename<span class='parenthesis'>(</span><span class='parenthesis'>)</span>;   <span class='comment'>// yields <span class='tcode_in_codeblock'>"bar.txt"</span></span>
path<span class='parenthesis'>(</span><span class='literal'>"/foo/bar"</span><span class='parenthesis'>)</span><span class='operator'>.</span>filename<span class='parenthesis'>(</span><span class='parenthesis'>)</span>;       <span class='comment'>// yields <span class='tcode_in_codeblock'>"bar"</span></span>
path<span class='parenthesis'>(</span><span class='literal'>"/foo/bar/"</span><span class='parenthesis'>)</span><span class='operator'>.</span>filename<span class='parenthesis'>(</span><span class='parenthesis'>)</span>;      <span class='comment'>// yields <span class='tcode_in_codeblock'>""</span></span>
path<span class='parenthesis'>(</span><span class='literal'>"/"</span><span class='parenthesis'>)</span><span class='operator'>.</span>filename<span class='parenthesis'>(</span><span class='parenthesis'>)</span>;              <span class='comment'>// yields <span class='tcode_in_codeblock'>""</span></span>
path<span class='parenthesis'>(</span><span class='literal'>"//host"</span><span class='parenthesis'>)</span><span class='operator'>.</span>filename<span class='parenthesis'>(</span><span class='parenthesis'>)</span>;         <span class='comment'>// yields <span class='tcode_in_codeblock'>""</span></span>
path<span class='parenthesis'>(</span><span class='literal'>"."</span><span class='parenthesis'>)</span><span class='operator'>.</span>filename<span class='parenthesis'>(</span><span class='parenthesis'>)</span>;              <span class='comment'>// yields <span class='tcode_in_codeblock'>"."</span></span>
path<span class='parenthesis'>(</span><span class='literal'>".."</span><span class='parenthesis'>)</span><span class='operator'>.</span>filename<span class='parenthesis'>(</span><span class='parenthesis'>)</span>;             <span class='comment'>// yields <span class='tcode_in_codeblock'>".."</span></span>
</pre> —<span style='white-space:nowrap'> </span><i>end example</i></div><span style='white-space:nowrap'> </span>]</div> </div></div><span class='indexparent'><a class='index' id='lib:stem,path'></a></span><span class='indexparent'><a class='index' id='lib:path,stem'></a></span><div class='itemdecl' id='fs.path.decompose-itemdecl:7'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.decompose-itemdecl:7'>🔗</a></div><code class='itemdeclcode'>path stem<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.decompose-8'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.decompose-8'>8</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12402'>#</a></div><div id='fs.path.decompose-8.sentence-1' class='sentence'><span class='textit'>Returns:</span> Let <span class='texttt'>f</span> be the generic format pathname of <span class='texttt'>filename<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span><a class='hidden_link' href='#fs.path.decompose-8.sentence-1'>.</a></div> <div id='fs.path.decompose-8.sentence-2' class='sentence'>Returns a path whose pathname in the generic format is
<ul class='itemize'><li id='fs.path.decompose-8.1'><div class='marginalizedparent' style='left:-10em'><a class='marginalized' href='#fs.path.decompose-8.1'>(8.1)</a></div><div id='fs.path.decompose-8.1.sentence-1' class='sentence'><span class='texttt'>f</span>, if it contains no periods other than a leading period
or consists solely of one or two periods;</div></li><li id='fs.path.decompose-8.2'><div class='marginalizedparent' style='left:-10em'><a class='marginalized' href='#fs.path.decompose-8.2'>(8.2)</a></div><div id='fs.path.decompose-8.2.sentence-1' class='sentence'>otherwise, the prefix of <span class='texttt'>f</span> ending before its last period<a class='hidden_link' href='#fs.path.decompose-8.2.sentence-1'>.</a></div></li></ul></div></div></div><div class='para' id='fs.path.decompose-9'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.decompose-9'>9</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12411'>#</a></div><div id='fs.path.decompose-9.example-1' class='example'>[<span style='white-space:nowrap'> </span><a class='example_link' href='#fs.path.decompose-9.example-1'><span class='textit'>Example</span></a><div class='exampleBody'><span class='textit'>:</span> <pre class='codeblock'>
std<span class='operator'>:</span><span class='operator'>:</span>cout <span class='anglebracket'>&lt;</span><span class='anglebracket'>&lt;</span> path<span class='parenthesis'>(</span><span class='literal'>"/foo/bar.txt"</span><span class='parenthesis'>)</span><span class='operator'>.</span>stem<span class='parenthesis'>(</span><span class='parenthesis'>)</span>; <span class='comment'>// outputs <span class='tcode_in_codeblock'>"bar"</span></span>
path p <span class='operator'>=</span> <span class='literal'>"foo.bar.baz.tar"</span>;
<span class='keyword'>for</span> <span class='parenthesis'>(</span>; <span class='operator'>!</span>p<span class='operator'>.</span>extension<span class='parenthesis'>(</span><span class='parenthesis'>)</span><span class='operator'>.</span>empty<span class='parenthesis'>(</span><span class='parenthesis'>)</span>; p <span class='operator'>=</span> p<span class='operator'>.</span>stem<span class='parenthesis'>(</span><span class='parenthesis'>)</span><span class='parenthesis'>)</span>
  std<span class='operator'>:</span><span class='operator'>:</span>cout <span class='anglebracket'>&lt;</span><span class='anglebracket'>&lt;</span> p<span class='operator'>.</span>extension<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='anglebracket'>&lt;</span><span class='anglebracket'>&lt;</span> <span class='literal'>'\n'</span>;
  <span class='comment'>// outputs: <span class='tcode_in_codeblock'>.tar</span></span>
  <span class='comment'>//          <span class='tcode_in_codeblock'>.baz</span></span>
  <span class='comment'>//          <span class='tcode_in_codeblock'>.bar</span></span>
</pre> —<span style='white-space:nowrap'> </span><i>end example</i></div><span style='white-space:nowrap'> </span>]</div> </div></div><span class='indexparent'><a class='index' id='lib:extension,path'></a></span><span class='indexparent'><a class='index' id='lib:path,extension'></a></span><div class='itemdecl' id='fs.path.decompose-itemdecl:8'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.decompose-itemdecl:8'>🔗</a></div><code class='itemdeclcode'>path extension<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.decompose-10'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.decompose-10'>10</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12431'>#</a></div><div id='fs.path.decompose-10.sentence-1' class='sentence'><span class='textit'>Returns:</span> A path whose pathname in the generic format is
the suffix of <span class='texttt'>filename<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span> not included in <span class='texttt'>stem<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span><a class='hidden_link' href='#fs.path.decompose-10.sentence-1'>.</a></div></div></div><div class='para' id='fs.path.decompose-11'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.decompose-11'>11</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12435'>#</a></div><div id='fs.path.decompose-11.example-1' class='example'>[<span style='white-space:nowrap'> </span><a class='example_link' href='#fs.path.decompose-11.example-1'><span class='textit'>Example</span></a><div class='exampleBody'><span class='textit'>:</span> <pre class='codeblock'>
path<span class='parenthesis'>(</span><span class='literal'>"/foo/bar.txt"</span><span class='parenthesis'>)</span><span class='operator'>.</span>extension<span class='parenthesis'>(</span><span class='parenthesis'>)</span>;  <span class='comment'>// yields <span class='tcode_in_codeblock'>".txt"</span> and <span class='tcode_in_codeblock'>stem()</span> is <span class='tcode_in_codeblock'>"bar"</span></span>
path<span class='parenthesis'>(</span><span class='literal'>"/foo/bar"</span><span class='parenthesis'>)</span><span class='operator'>.</span>extension<span class='parenthesis'>(</span><span class='parenthesis'>)</span>;      <span class='comment'>// yields <span class='tcode_in_codeblock'>""</span> and <span class='tcode_in_codeblock'>stem()</span> is <span class='tcode_in_codeblock'>"bar"</span></span>
path<span class='parenthesis'>(</span><span class='literal'>"/foo/.profile"</span><span class='parenthesis'>)</span><span class='operator'>.</span>extension<span class='parenthesis'>(</span><span class='parenthesis'>)</span>; <span class='comment'>// yields <span class='tcode_in_codeblock'>""</span> and <span class='tcode_in_codeblock'>stem()</span> is <span class='tcode_in_codeblock'>".profile"</span></span>
path<span class='parenthesis'>(</span><span class='literal'>".bar"</span><span class='parenthesis'>)</span><span class='operator'>.</span>extension<span class='parenthesis'>(</span><span class='parenthesis'>)</span>;          <span class='comment'>// yields <span class='tcode_in_codeblock'>""</span> and <span class='tcode_in_codeblock'>stem()</span> is <span class='tcode_in_codeblock'>".bar"</span></span>
path<span class='parenthesis'>(</span><span class='literal'>"..bar"</span><span class='parenthesis'>)</span><span class='operator'>.</span>extension<span class='parenthesis'>(</span><span class='parenthesis'>)</span>;         <span class='comment'>// yields <span class='tcode_in_codeblock'>".bar"</span> and <span class='tcode_in_codeblock'>stem()</span> is <span class='tcode_in_codeblock'>"."</span></span>
</pre> —<span style='white-space:nowrap'> </span><i>end example</i></div><span style='white-space:nowrap'> </span>]</div> </div></div><div class='para' id='fs.path.decompose-12'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.decompose-12'>12</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12446'>#</a></div><div id='fs.path.decompose-12.note-1' class='note'>[<span style='white-space:nowrap'> </span><a class='note_link' href='#fs.path.decompose-12.note-1'><span class='textit'>Note</span></a><div class='noteBody'><span class='textit'>:</span> <div id='fs.path.decompose-12.sentence-1' class='sentence'>The period is included in the return value so that it is
  possible to distinguish between no extension and an empty extension<a class='hidden_link' href='#fs.path.decompose-12.sentence-1'>.</a></div> —<span style='white-space:nowrap'> </span><i>end note</i></div><span style='white-space:nowrap'> </span>]</div> </div></div><div class='para' id='fs.path.decompose-13'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.decompose-13'>13</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12451'>#</a></div><div id='fs.path.decompose-13.note-1' class='note'>[<span style='white-space:nowrap'> </span><a class='note_link' href='#fs.path.decompose-13.note-1'><span class='textit'>Note</span></a><div class='noteBody'><span class='textit'>:</span> <div id='fs.path.decompose-13.sentence-1' class='sentence'>On non-POSIX operating systems, for a path <span class='texttt'>p</span>,
it may not be the case that <span class='texttt'>p<span class='operator'>.</span>stem<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='operator'>+</span> p<span class='operator'>.</span>extension<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='operator'>=</span><span class='operator'>=</span> p<span class='operator'>.</span>filename<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span>,
even though the generic format pathnames are the same<a class='hidden_link' href='#fs.path.decompose-13.sentence-1'>.</a></div> —<span style='white-space:nowrap'> </span><i>end note</i></div><span style='white-space:nowrap'> </span>]</div> </div></div></div><div id='fs.path.query' class='section'><h4 ><a class='secnum' href='#fs.path.query' style='min-width:133pt'>28.11.7.4.10</a> Query <a class='abbr_ref' href='fs.path.query'>[fs.path.query]</a></h4><span class='indexparent'><a class='index' id='lib:empty,path'></a></span><span class='indexparent'><a class='index' id='lib:path,empty'></a></span><div class='itemdecl' id='fs.path.query-itemdecl:1'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.query-itemdecl:1'>🔗</a></div><code class='itemdeclcode'><span class='squarebracket'>[</span><span class='squarebracket'>[</span>nodiscard<span class='squarebracket'>]</span><span class='squarebracket'>]</span> <span class='keyword'>bool</span> empty<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span> <span class='keyword'>noexcept</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.query-1'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.query-1'>1</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12467'>#</a></div><div id='fs.path.query-1.sentence-1' class='sentence'><span class='textit'>Returns:</span> <span class='texttt'><span class='literal'>true</span></span> if the pathname in the generic format is empty, else <span class='texttt'><span class='literal'>false</span></span><a class='hidden_link' href='#fs.path.query-1.sentence-1'>.</a></div></div></div><span class='indexparent'><a class='index' id='lib:has_root_path,path'></a></span><span class='indexparent'><a class='index' id='lib:path,has_root_path'></a></span><div class='itemdecl' id='fs.path.query-itemdecl:2'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.query-itemdecl:2'>🔗</a></div><code class='itemdeclcode'><span class='keyword'>bool</span> has_root_path<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.query-2'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.query-2'>2</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12477'>#</a></div><div id='fs.path.query-2.sentence-1' class='sentence'><span class='textit'>Returns:</span> <span class='texttt'><span class='operator'>!</span>root_&shy;path<span class='parenthesis'>(</span><span class='parenthesis'>)</span><span class='operator'>.</span>empty<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span><a class='hidden_link' href='#fs.path.query-2.sentence-1'>.</a></div></div></div><span class='indexparent'><a class='index' id='lib:has_root_name,path'></a></span><span class='indexparent'><a class='index' id='lib:path,has_root_name'></a></span><div class='itemdecl' id='fs.path.query-itemdecl:3'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.query-itemdecl:3'>🔗</a></div><code class='itemdeclcode'><span class='keyword'>bool</span> has_root_name<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.query-3'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.query-3'>3</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12487'>#</a></div><div id='fs.path.query-3.sentence-1' class='sentence'><span class='textit'>Returns:</span> <span class='texttt'><span class='operator'>!</span>root_&shy;name<span class='parenthesis'>(</span><span class='parenthesis'>)</span><span class='operator'>.</span>empty<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span><a class='hidden_link' href='#fs.path.query-3.sentence-1'>.</a></div></div></div><span class='indexparent'><a class='index' id='lib:has_root_directory,path'></a></span><span class='indexparent'><a class='index' id='lib:path,has_root_directory'></a></span><div class='itemdecl' id='fs.path.query-itemdecl:4'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.query-itemdecl:4'>🔗</a></div><code class='itemdeclcode'><span class='keyword'>bool</span> has_root_directory<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.query-4'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.query-4'>4</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12497'>#</a></div><div id='fs.path.query-4.sentence-1' class='sentence'><span class='textit'>Returns:</span> <span class='texttt'><span class='operator'>!</span>root_&shy;directory<span class='parenthesis'>(</span><span class='parenthesis'>)</span><span class='operator'>.</span>empty<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span><a class='hidden_link' href='#fs.path.query-4.sentence-1'>.</a></div></div></div><span class='indexparent'><a class='index' id='lib:has_relative_path,path'></a></span><span class='indexparent'><a class='index' id='lib:path,has_relative_path'></a></span><div class='itemdecl' id='fs.path.query-itemdecl:5'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.query-itemdecl:5'>🔗</a></div><code class='itemdeclcode'><span class='keyword'>bool</span> has_relative_path<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.query-5'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.query-5'>5</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12507'>#</a></div><div id='fs.path.query-5.sentence-1' class='sentence'><span class='textit'>Returns:</span> <span class='texttt'><span class='operator'>!</span>relative_&shy;path<span class='parenthesis'>(</span><span class='parenthesis'>)</span><span class='operator'>.</span>empty<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span><a class='hidden_link' href='#fs.path.query-5.sentence-1'>.</a></div></div></div><span class='indexparent'><a class='index' id='lib:has_parent_path,path'></a></span><span class='indexparent'><a class='index' id='lib:path,has_parent_path'></a></span><div class='itemdecl' id='fs.path.query-itemdecl:6'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.query-itemdecl:6'>🔗</a></div><code class='itemdeclcode'><span class='keyword'>bool</span> has_parent_path<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.query-6'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.query-6'>6</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12517'>#</a></div><div id='fs.path.query-6.sentence-1' class='sentence'><span class='textit'>Returns:</span> <span class='texttt'><span class='operator'>!</span>parent_&shy;path<span class='parenthesis'>(</span><span class='parenthesis'>)</span><span class='operator'>.</span>empty<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span><a class='hidden_link' href='#fs.path.query-6.sentence-1'>.</a></div></div></div><span class='indexparent'><a class='index' id='lib:has_filename,path'></a></span><span class='indexparent'><a class='index' id='lib:path,has_filename'></a></span><div class='itemdecl' id='fs.path.query-itemdecl:7'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.query-itemdecl:7'>🔗</a></div><code class='itemdeclcode'><span class='keyword'>bool</span> has_filename<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.query-7'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.query-7'>7</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12527'>#</a></div><div id='fs.path.query-7.sentence-1' class='sentence'><span class='textit'>Returns:</span> <span class='texttt'><span class='operator'>!</span>filename<span class='parenthesis'>(</span><span class='parenthesis'>)</span><span class='operator'>.</span>empty<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span><a class='hidden_link' href='#fs.path.query-7.sentence-1'>.</a></div></div></div><span class='indexparent'><a class='index' id='lib:has_stem,path'></a></span><span class='indexparent'><a class='index' id='lib:path,has_stem'></a></span><div class='itemdecl' id='fs.path.query-itemdecl:8'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.query-itemdecl:8'>🔗</a></div><code class='itemdeclcode'><span class='keyword'>bool</span> has_stem<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.query-8'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.query-8'>8</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12537'>#</a></div><div id='fs.path.query-8.sentence-1' class='sentence'><span class='textit'>Returns:</span> <span class='texttt'><span class='operator'>!</span>stem<span class='parenthesis'>(</span><span class='parenthesis'>)</span><span class='operator'>.</span>empty<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span><a class='hidden_link' href='#fs.path.query-8.sentence-1'>.</a></div></div></div><span class='indexparent'><a class='index' id='lib:has_extension,path'></a></span><span class='indexparent'><a class='index' id='lib:path,has_extension'></a></span><div class='itemdecl' id='fs.path.query-itemdecl:9'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.query-itemdecl:9'>🔗</a></div><code class='itemdeclcode'><span class='keyword'>bool</span> has_extension<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.query-9'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.query-9'>9</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12547'>#</a></div><div id='fs.path.query-9.sentence-1' class='sentence'><span class='textit'>Returns:</span> <span class='texttt'><span class='operator'>!</span>extension<span class='parenthesis'>(</span><span class='parenthesis'>)</span><span class='operator'>.</span>empty<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span><a class='hidden_link' href='#fs.path.query-9.sentence-1'>.</a></div></div></div><span class='indexparent'><a class='index' id='lib:is_absolute,path'></a></span><span class='indexparent'><a class='index' id='lib:path,is_absolute'></a></span><div class='itemdecl' id='fs.path.query-itemdecl:10'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.query-itemdecl:10'>🔗</a></div><code class='itemdeclcode'><span class='keyword'>bool</span> is_absolute<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.query-10'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.query-10'>10</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12557'>#</a></div><div id='fs.path.query-10.sentence-1' class='sentence'><span class='textit'>Returns:</span> <span class='texttt'><span class='literal'>true</span></span> if the pathname in the native format
  contains an absolute path (<a href='#fs.class.path'>[fs.class.path]</a>), else <span class='texttt'><span class='literal'>false</span></span><a class='hidden_link' href='#fs.path.query-10.sentence-1'>.</a></div></div></div><div class='para' id='fs.path.query-11'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.query-11'>11</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12561'>#</a></div><div id='fs.path.query-11.example-1' class='example'>[<span style='white-space:nowrap'> </span><a class='example_link' href='#fs.path.query-11.example-1'><span class='textit'>Example</span></a><div class='exampleBody'><span class='textit'>:</span> <div id='fs.path.query-11.sentence-1' class='sentence'><span class='texttt'>path<span class='parenthesis'>(</span><span class='literal'>"/"</span><span class='parenthesis'>)</span><span class='operator'>.</span>is_&shy;absolute<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span> is
      <span class='texttt'><span class='literal'>true</span></span> for  POSIX-based operating systems, and <span class='texttt'><span class='literal'>false</span></span> for Windows-based
operating systems<a class='hidden_link' href='#fs.path.query-11.sentence-1'>.</a></div> —<span style='white-space:nowrap'> </span><i>end example</i></div><span style='white-space:nowrap'> </span>]</div> </div></div><span class='indexparent'><a class='index' id='lib:is_relative,path'></a></span><span class='indexparent'><a class='index' id='lib:path,is_relative'></a></span><div class='itemdecl' id='fs.path.query-itemdecl:11'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.query-itemdecl:11'>🔗</a></div><code class='itemdeclcode'><span class='keyword'>bool</span> is_relative<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.query-12'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.query-12'>12</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12573'>#</a></div><div id='fs.path.query-12.sentence-1' class='sentence'><span class='textit'>Returns:</span> <span class='texttt'><span class='operator'>!</span>is_&shy;absolute<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span><a class='hidden_link' href='#fs.path.query-12.sentence-1'>.</a></div></div></div></div><div id='fs.path.gen' class='section'><h4 ><a class='secnum' href='#fs.path.gen' style='min-width:133pt'>28.11.7.4.11</a> Generation <a class='abbr_ref' href='fs.path.gen'>[fs.path.gen]</a></h4><span class='indexparent'><a class='index' id='lib:lexically_normal,path'></a></span><span class='indexparent'><a class='index' id='lib:path,lexically_normal'></a></span><div class='itemdecl' id='fs.path.gen-itemdecl:1'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.gen-itemdecl:1'>🔗</a></div><code class='itemdeclcode'>path lexically_normal<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.gen-1'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.gen-1'>1</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12585'>#</a></div><div id='fs.path.gen-1.sentence-1' class='sentence'><span class='textit'>Returns:</span> A path whose pathname in the generic format is
the normal form (<a href='#fs.path.generic'>[fs.path.generic]</a>) of the pathname
in the generic format of <span class='texttt'><span class='operator'>*</span><span class='keyword'>this</span></span><a class='hidden_link' href='#fs.path.gen-1.sentence-1'>.</a></div></div></div><div class='para' id='fs.path.gen-2'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.gen-2'>2</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12590'>#</a></div><div id='fs.path.gen-2.example-1' class='example'>[<span style='white-space:nowrap'> </span><a class='example_link' href='#fs.path.gen-2.example-1'><span class='textit'>Example</span></a><div class='exampleBody'><span class='textit'>:</span> <pre class='codeblock'>
assert<span class='parenthesis'>(</span>path<span class='parenthesis'>(</span><span class='literal'>"foo/./bar/.."</span><span class='parenthesis'>)</span><span class='operator'>.</span>lexically_normal<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='operator'>=</span><span class='operator'>=</span> <span class='literal'>"foo/"</span><span class='parenthesis'>)</span>;
assert<span class='parenthesis'>(</span>path<span class='parenthesis'>(</span><span class='literal'>"foo/.///bar/../"</span><span class='parenthesis'>)</span><span class='operator'>.</span>lexically_normal<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='operator'>=</span><span class='operator'>=</span> <span class='literal'>"foo/"</span><span class='parenthesis'>)</span>;
</pre> <div id='fs.path.gen-2.sentence-1' class='sentence'>
The above assertions will succeed<a class='hidden_link' href='#fs.path.gen-2.sentence-1'>.</a></div> <div id='fs.path.gen-2.sentence-2' class='sentence'>On Windows, the returned path's <i ><a href='#nt:directory-separator'>directory-separator</a></i> characters
will be backslashes rather than slashes,
but that does not affect <span class='texttt'>path</span> equality<a class='hidden_link' href='#fs.path.gen-2.sentence-2'>.</a></div> —<span style='white-space:nowrap'> </span><i>end example</i></div><span style='white-space:nowrap'> </span>]</div> </div></div><span class='indexparent'><a class='index' id='lib:lexically_relative,path'></a></span><span class='indexparent'><a class='index' id='lib:path,lexically_relative'></a></span><div class='itemdecl' id='fs.path.gen-itemdecl:2'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.gen-itemdecl:2'>🔗</a></div><code class='itemdeclcode'>path lexically_relative<span class='parenthesis'>(</span><span class='keyword'>const</span> path<span class='operator'>&amp;</span> base<span class='parenthesis'>)</span> <span class='keyword'>const</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.gen-3'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.gen-3'>3</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12609'>#</a></div><div id='fs.path.gen-3.sentence-1' class='sentence'><span class='textit'>Returns:</span> <span class='texttt'><span class='operator'>*</span><span class='keyword'>this</span></span> made relative to <span class='texttt'>base</span><a class='hidden_link' href='#fs.path.gen-3.sentence-1'>.</a></div> <div id='fs.path.gen-3.sentence-2' class='sentence'>Does not resolve (<a href='#fs.class.path'>[fs.class.path]</a>) symlinks<a class='hidden_link' href='#fs.path.gen-3.sentence-2'>.</a></div> <div id='fs.path.gen-3.sentence-3' class='sentence'>Does not first normalize (<a href='#fs.path.generic'>[fs.path.generic]</a>) <span class='texttt'><span class='operator'>*</span><span class='keyword'>this</span></span> or <span class='texttt'>base</span><a class='hidden_link' href='#fs.path.gen-3.sentence-3'>.</a></div></div></div><div class='para' id='fs.path.gen-4'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.gen-4'>4</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12614'>#</a></div><div id='fs.path.gen-4.sentence-1' class='sentence'><span class='textit'>Effects:</span> 
If <span class='texttt'>root_&shy;name<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='operator'>!</span><span class='operator'>=</span> base<span class='operator'>.</span>root_&shy;name<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span> is <span class='texttt'><span class='literal'>true</span></span>
or <span class='texttt'>is_&shy;absolute<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='operator'>!</span><span class='operator'>=</span> base<span class='operator'>.</span>is_&shy;absolute<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span> is <span class='texttt'><span class='literal'>true</span></span>
or <span class='texttt'><span class='operator'>!</span>has_&shy;root_&shy;directory<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='operator'>&amp;</span><span class='operator'>&amp;</span> base<span class='operator'>.</span>has_&shy;root_&shy;directory<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span> is <span class='texttt'><span class='literal'>true</span></span>,
returns <span class='texttt'>path<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span><a class='hidden_link' href='#fs.path.gen-4.sentence-1'>.</a></div> <div id='fs.path.gen-4.sentence-2' class='sentence'>Determines the first mismatched element of <span class='texttt'><span class='operator'>*</span><span class='keyword'>this</span></span> and <span class='texttt'>base</span>
as if by:
<pre class='codeblock'>
<span class='keyword'>auto</span> <span class='squarebracket'>[</span>a, b<span class='squarebracket'>]</span> <span class='operator'>=</span> mismatch<span class='parenthesis'>(</span>begin<span class='parenthesis'>(</span><span class='parenthesis'>)</span>, end<span class='parenthesis'>(</span><span class='parenthesis'>)</span>, base<span class='operator'>.</span>begin<span class='parenthesis'>(</span><span class='parenthesis'>)</span>, base<span class='operator'>.</span>end<span class='parenthesis'>(</span><span class='parenthesis'>)</span><span class='parenthesis'>)</span>;
</pre></div> <div id='fs.path.gen-4.sentence-3' class='sentence'>
Then,
<ul class='itemize'><li id='fs.path.gen-4.1'><div class='marginalizedparent' style='left:-10em'><a class='marginalized' href='#fs.path.gen-4.1'>(4.1)</a></div><div id='fs.path.gen-4.1.sentence-1' class='sentence'>if <span class='texttt'>a <span class='operator'>=</span><span class='operator'>=</span> end<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span> and <span class='texttt'>b <span class='operator'>=</span><span class='operator'>=</span> base<span class='operator'>.</span>end<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span>, returns <span class='texttt'>path<span class='parenthesis'>(</span><span class='literal'>"."</span><span class='parenthesis'>)</span></span>; otherwise</div></li><li id='fs.path.gen-4.2'><div class='marginalizedparent' style='left:-10em'><a class='marginalized' href='#fs.path.gen-4.2'>(4.2)</a></div><div id='fs.path.gen-4.2.sentence-1' class='sentence'>let <span class='texttt'>n</span> be the number of <i ><a href='#nt:filename'>filename</a></i> elements in <span class='texttt'>[</span><span class='texttt'>b, base<span class='operator'>.</span>end<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span><span class='texttt'>)</span>
  that are not dot or dot-dot or empty, minus the number that are dot-dot<a class='hidden_link' href='#fs.path.gen-4.2.sentence-1'>.</a></div> <div id='fs.path.gen-4.2.sentence-2' class='sentence'>If <span class='texttt'>n<span class='anglebracket'>&lt;</span><span class='literal'>0</span>,</span> returns <span class='texttt'>path<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span>; otherwise</div></li><li id='fs.path.gen-4.3'><div class='marginalizedparent' style='left:-10em'><a class='marginalized' href='#fs.path.gen-4.3'>(4.3)</a></div><div id='fs.path.gen-4.3.sentence-1' class='sentence'>if <span class='texttt'>n <span class='operator'>=</span><span class='operator'>=</span> <span class='literal'>0</span></span> and <span class='texttt'><span class='parenthesis'>(</span>a <span class='operator'>=</span><span class='operator'>=</span> end<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='operator'>|</span><span class='operator'>|</span> a<span class='operator'>-</span><span class='anglebracket'>&gt;</span>empty<span class='parenthesis'>(</span><span class='parenthesis'>)</span><span class='parenthesis'>)</span></span>,
  returns <span class='texttt'>path<span class='parenthesis'>(</span><span class='literal'>"."</span><span class='parenthesis'>)</span></span>; otherwise</div></li><li id='fs.path.gen-4.4'><div class='marginalizedparent' style='left:-10em'><a class='marginalized' href='#fs.path.gen-4.4'>(4.4)</a></div><div id='fs.path.gen-4.4.sentence-1' class='sentence'>returns an object of class <span class='texttt'>path</span> that is default-constructed, followed by
<ul class='itemize'><li id='fs.path.gen-4.4.1'><div class='marginalizedparent' style='left:-12em'><a class='marginalized' href='#fs.path.gen-4.4.1'>(4.4.1)</a></div><div id='fs.path.gen-4.4.1.sentence-1' class='sentence'>application of <span class='texttt'><span class='keyword'>operator</span><span class='operator'>/</span><span class='operator'>=</span><span class='parenthesis'>(</span>path<span class='parenthesis'>(</span><span class='literal'>".."</span><span class='parenthesis'>)</span><span class='parenthesis'>)</span></span>
  <span class='texttt'>n</span> times, and then</div></li><li id='fs.path.gen-4.4.2'><div class='marginalizedparent' style='left:-12em'><a class='marginalized' href='#fs.path.gen-4.4.2'>(4.4.2)</a></div><div id='fs.path.gen-4.4.2.sentence-1' class='sentence'>application of <span class='texttt'><span class='keyword'>operator</span><span class='operator'>/</span><span class='operator'>=</span></span>
  for each element in <span class='texttt'>[</span><span class='texttt'>a, end<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span><span class='texttt'>)</span><a class='hidden_link' href='#fs.path.gen-4.4.2.sentence-1'>.</a></div></li></ul></div></li></ul></div></div></div><div class='para' id='fs.path.gen-5'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.gen-5'>5</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12644'>#</a></div><div id='fs.path.gen-5.example-1' class='example'>[<span style='white-space:nowrap'> </span><a class='example_link' href='#fs.path.gen-5.example-1'><span class='textit'>Example</span></a><div class='exampleBody'><span class='textit'>:</span> <pre class='codeblock'>
assert<span class='parenthesis'>(</span>path<span class='parenthesis'>(</span><span class='literal'>"/a/d"</span><span class='parenthesis'>)</span><span class='operator'>.</span>lexically_relative<span class='parenthesis'>(</span><span class='literal'>"/a/b/c"</span><span class='parenthesis'>)</span> <span class='operator'>=</span><span class='operator'>=</span> <span class='literal'>"../../d"</span><span class='parenthesis'>)</span>;
assert<span class='parenthesis'>(</span>path<span class='parenthesis'>(</span><span class='literal'>"/a/b/c"</span><span class='parenthesis'>)</span><span class='operator'>.</span>lexically_relative<span class='parenthesis'>(</span><span class='literal'>"/a/d"</span><span class='parenthesis'>)</span> <span class='operator'>=</span><span class='operator'>=</span> <span class='literal'>"../b/c"</span><span class='parenthesis'>)</span>;
assert<span class='parenthesis'>(</span>path<span class='parenthesis'>(</span><span class='literal'>"a/b/c"</span><span class='parenthesis'>)</span><span class='operator'>.</span>lexically_relative<span class='parenthesis'>(</span><span class='literal'>"a"</span><span class='parenthesis'>)</span> <span class='operator'>=</span><span class='operator'>=</span> <span class='literal'>"b/c"</span><span class='parenthesis'>)</span>;
assert<span class='parenthesis'>(</span>path<span class='parenthesis'>(</span><span class='literal'>"a/b/c"</span><span class='parenthesis'>)</span><span class='operator'>.</span>lexically_relative<span class='parenthesis'>(</span><span class='literal'>"a/b/c/x/y"</span><span class='parenthesis'>)</span> <span class='operator'>=</span><span class='operator'>=</span> <span class='literal'>"../.."</span><span class='parenthesis'>)</span>;
assert<span class='parenthesis'>(</span>path<span class='parenthesis'>(</span><span class='literal'>"a/b/c"</span><span class='parenthesis'>)</span><span class='operator'>.</span>lexically_relative<span class='parenthesis'>(</span><span class='literal'>"a/b/c"</span><span class='parenthesis'>)</span> <span class='operator'>=</span><span class='operator'>=</span> <span class='literal'>"."</span><span class='parenthesis'>)</span>;
assert<span class='parenthesis'>(</span>path<span class='parenthesis'>(</span><span class='literal'>"a/b"</span><span class='parenthesis'>)</span><span class='operator'>.</span>lexically_relative<span class='parenthesis'>(</span><span class='literal'>"c/d"</span><span class='parenthesis'>)</span> <span class='operator'>=</span><span class='operator'>=</span> <span class='literal'>"../../a/b"</span><span class='parenthesis'>)</span>;
</pre> <div id='fs.path.gen-5.sentence-1' class='sentence'>
The above assertions will succeed<a class='hidden_link' href='#fs.path.gen-5.sentence-1'>.</a></div> <div id='fs.path.gen-5.sentence-2' class='sentence'>On Windows, the returned path's <i ><a href='#nt:directory-separator'>directory-separator</a></i> characters
will be backslashes rather than slashes,
but that does not affect <span class='texttt'>path</span> equality<a class='hidden_link' href='#fs.path.gen-5.sentence-2'>.</a></div> —<span style='white-space:nowrap'> </span><i>end example</i></div><span style='white-space:nowrap'> </span>]</div> </div></div><div class='para' id='fs.path.gen-6'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.gen-6'>6</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12660'>#</a></div><div id='fs.path.gen-6.note-1' class='note'>[<span style='white-space:nowrap'> </span><a class='note_link' href='#fs.path.gen-6.note-1'><span class='textit'>Note</span></a><div class='noteBody'><span class='textit'>:</span> <div id='fs.path.gen-6.sentence-1' class='sentence'>If symlink following semantics are desired,
  use the operational function <span class='texttt'>relative<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span><a class='hidden_link' href='#fs.path.gen-6.sentence-1'>.</a></div> —<span style='white-space:nowrap'> </span><i>end note</i></div><span style='white-space:nowrap'> </span>]</div> </div></div><div class='para' id='fs.path.gen-7'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.gen-7'>7</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12664'>#</a></div><div id='fs.path.gen-7.note-1' class='note'>[<span style='white-space:nowrap'> </span><a class='note_link' href='#fs.path.gen-7.note-1'><span class='textit'>Note</span></a><div class='noteBody'><span class='textit'>:</span> <div id='fs.path.gen-7.sentence-1' class='sentence'>If normalization (<a href='#fs.path.generic'>[fs.path.generic]</a>) is needed
  to ensure consistent matching of elements,
  apply <span class='texttt'>lexically_&shy;normal<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span> to
  <span class='texttt'><span class='operator'>*</span><span class='keyword'>this</span></span>, <span class='texttt'>base</span>, or both<a class='hidden_link' href='#fs.path.gen-7.sentence-1'>.</a></div> —<span style='white-space:nowrap'> </span><i>end note</i></div><span style='white-space:nowrap'> </span>]</div> </div></div><span class='indexparent'><a class='index' id='lib:lexically_proximate,path'></a></span><span class='indexparent'><a class='index' id='lib:path,lexically_proximate'></a></span><div class='itemdecl' id='fs.path.gen-itemdecl:3'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.gen-itemdecl:3'>🔗</a></div><code class='itemdeclcode'>path lexically_proximate<span class='parenthesis'>(</span><span class='keyword'>const</span> path<span class='operator'>&amp;</span> base<span class='parenthesis'>)</span> <span class='keyword'>const</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.gen-8'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.gen-8'>8</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12677'>#</a></div><div id='fs.path.gen-8.sentence-1' class='sentence'><span class='textit'>Returns:</span> If the value of <span class='texttt'>lexically_&shy;relative<span class='parenthesis'>(</span>base<span class='parenthesis'>)</span></span> is not an empty path,
  return it<a class='hidden_link' href='#fs.path.gen-8.sentence-1'>.</a></div> <div id='fs.path.gen-8.sentence-2' class='sentence'>Otherwise return <span class='texttt'><span class='operator'>*</span><span class='keyword'>this</span></span><a class='hidden_link' href='#fs.path.gen-8.sentence-2'>.</a></div></div></div><div class='para' id='fs.path.gen-9'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.gen-9'>9</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12681'>#</a></div><div id='fs.path.gen-9.note-1' class='note'>[<span style='white-space:nowrap'> </span><a class='note_link' href='#fs.path.gen-9.note-1'><span class='textit'>Note</span></a><div class='noteBody'><span class='textit'>:</span> <div id='fs.path.gen-9.sentence-1' class='sentence'>If symlink following semantics are desired,
  use the operational function <span class='texttt'>proximate<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span><a class='hidden_link' href='#fs.path.gen-9.sentence-1'>.</a></div> —<span style='white-space:nowrap'> </span><i>end note</i></div><span style='white-space:nowrap'> </span>]</div> </div></div><div class='para' id='fs.path.gen-10'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.gen-10'>10</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12685'>#</a></div><div id='fs.path.gen-10.note-1' class='note'>[<span style='white-space:nowrap'> </span><a class='note_link' href='#fs.path.gen-10.note-1'><span class='textit'>Note</span></a><div class='noteBody'><span class='textit'>:</span> <div id='fs.path.gen-10.sentence-1' class='sentence'>If normalization (<a href='#fs.path.generic'>[fs.path.generic]</a>) is needed
  to ensure consistent matching of elements,
  apply <span class='texttt'>lexically_&shy;normal<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span> to
  <span class='texttt'><span class='operator'>*</span><span class='keyword'>this</span></span>, <span class='texttt'>base</span>, or both<a class='hidden_link' href='#fs.path.gen-10.sentence-1'>.</a></div> —<span style='white-space:nowrap'> </span><i>end note</i></div><span style='white-space:nowrap'> </span>]</div> </div></div></div></div><div id='fs.path.itr' class='section'><h4 ><a class='secnum' href='#fs.path.itr' style='min-width:118pt'>28.11.7.5</a> Iterators <a class='abbr_ref' href='fs.path.itr'>[fs.path.itr]</a></h4><span class='indexparent'><a class='index' id='lib:path,iterator'></a></span><div class='para' id='fs.path.itr-1'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.itr-1'>1</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12695'>#</a></div><div id='fs.path.itr-1.sentence-1' class='sentence'>Path iterators iterate over the elements of the pathname
in the <a href='#fs.path.generic'>generic format</a><a class='hidden_link' href='#fs.path.itr-1.sentence-1'>.</a></div></div><div class='para' id='fs.path.itr-2'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.itr-2'>2</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12699'>#</a></div><div id='fs.path.itr-2.sentence-1' class='sentence'>A <span class='texttt'>path<span class='operator'>:</span><span class='operator'>:</span>iterator</span> is a constant iterator satisfying all the
requirements of a <a href='bidirectional.iterators'>bidirectional iterator</a>
except that,
for dereferenceable iterators <span class='texttt'>a</span> and <span class='texttt'>b</span>
of type <span class='texttt'>path<span class='operator'>:</span><span class='operator'>:</span>iterator</span>
with <span class='texttt'>a <span class='operator'>=</span><span class='operator'>=</span> b</span>,
there is no requirement that <span class='texttt'><span class='operator'>*</span>a</span> and <span class='texttt'><span class='operator'>*</span>b</span>
are bound to the same object<a class='hidden_link' href='#fs.path.itr-2.sentence-1'>.</a></div> <div id='fs.path.itr-2.sentence-2' class='sentence'>Its <span class='texttt'>value_&shy;type</span> is <span class='texttt'>path</span><a class='hidden_link' href='#fs.path.itr-2.sentence-2'>.</a></div></div><div class='para' id='fs.path.itr-3'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.itr-3'>3</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12710'>#</a></div><div id='fs.path.itr-3.sentence-1' class='sentence'>Calling any non-const member function of a <span class='texttt'>path</span> object
invalidates all iterators referring to elements of that object<a class='hidden_link' href='#fs.path.itr-3.sentence-1'>.</a></div></div><div class='para' id='fs.path.itr-4'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.itr-4'>4</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12714'>#</a></div><div id='fs.path.itr-4.sentence-1' class='sentence'>For the elements of the pathname in the generic format,
the forward traversal order is as follows:
<ul class='itemize'><li id='fs.path.itr-4.1'><div class='marginalizedparent' style='left:-7em'><a class='marginalized' href='#fs.path.itr-4.1'>(4.1)</a></div><div id='fs.path.itr-4.1.sentence-1' class='sentence'>The <i ><a href='#nt:root-name'>root-name</a></i> element, if present<a class='hidden_link' href='#fs.path.itr-4.1.sentence-1'>.</a></div></li><li id='fs.path.itr-4.2'><div class='marginalizedparent' style='left:-7em'><a class='marginalized' href='#fs.path.itr-4.2'>(4.2)</a></div><div id='fs.path.itr-4.2.sentence-1' class='sentence'>The <i ><a href='#nt:root-directory'>root-directory</a></i> element, if present<a class='hidden_link' href='#fs.path.itr-4.2.sentence-1'>.</a></div> <div id='fs.path.itr-4.2.note-1' class='note'>[<span style='white-space:nowrap'> </span><a class='note_link' href='#fs.path.itr-4.2.note-1'><span class='textit'>Note</span></a><div class='noteBody'><span class='textit'>:</span> <div id='fs.path.itr-4.2.sentence-2' class='sentence'>The generic format is required to ensure lexicographical
comparison works correctly<a class='hidden_link' href='#fs.path.itr-4.2.sentence-2'>.</a></div> —<span style='white-space:nowrap'> </span><i>end note</i></div><span style='white-space:nowrap'> </span>]</div> </li><li id='fs.path.itr-4.3'><div class='marginalizedparent' style='left:-7em'><a class='marginalized' href='#fs.path.itr-4.3'>(4.3)</a></div><div id='fs.path.itr-4.3.sentence-1' class='sentence'>Each successive <i ><a href='#nt:filename'>filename</a></i> element, if present<a class='hidden_link' href='#fs.path.itr-4.3.sentence-1'>.</a></div></li><li id='fs.path.itr-4.4'><div class='marginalizedparent' style='left:-7em'><a class='marginalized' href='#fs.path.itr-4.4'>(4.4)</a></div><div id='fs.path.itr-4.4.sentence-1' class='sentence'>An empty element, if a trailing non-root <i ><a href='#nt:directory-separator'>directory-separator</a></i>
is present<a class='hidden_link' href='#fs.path.itr-4.4.sentence-1'>.</a></div></li></ul></div></div><div class='para' id='fs.path.itr-5'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.itr-5'>5</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12728'>#</a></div><div id='fs.path.itr-5.sentence-1' class='sentence'>The backward traversal order is the reverse of forward traversal<a class='hidden_link' href='#fs.path.itr-5.sentence-1'>.</a></div> <span class='indexparent'><a class='index' id='lib:begin,path'></a></span><span class='indexparent'><a class='index' id='lib:path,begin'></a></span></div><div class='itemdecl' id='fs.path.itr-itemdecl:1'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.itr-itemdecl:1'>🔗</a></div><code class='itemdeclcode'>iterator begin<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.itr-6'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.itr-6'>6</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12737'>#</a></div><div id='fs.path.itr-6.sentence-1' class='sentence'><span class='textit'>Returns:</span> An iterator for the first present element in the traversal
list above<a class='hidden_link' href='#fs.path.itr-6.sentence-1'>.</a></div> <div id='fs.path.itr-6.sentence-2' class='sentence'>If no elements are present, the end iterator<a class='hidden_link' href='#fs.path.itr-6.sentence-2'>.</a></div></div></div><span class='indexparent'><a class='index' id='lib:end,path'></a></span><span class='indexparent'><a class='index' id='lib:path,end'></a></span><div class='itemdecl' id='fs.path.itr-itemdecl:2'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.itr-itemdecl:2'>🔗</a></div><code class='itemdeclcode'>iterator end<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.itr-7'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.itr-7'>7</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12748'>#</a></div><div id='fs.path.itr-7.sentence-1' class='sentence'><span class='textit'>Returns:</span> The end iterator<a class='hidden_link' href='#fs.path.itr-7.sentence-1'>.</a></div></div></div></div><div id='fs.path.io' class='section'><h4 ><a class='secnum' href='#fs.path.io' style='min-width:118pt'>28.11.7.6</a> Inserter and extractor <a class='abbr_ref' href='fs.path.io'>[fs.path.io]</a></h4><span class='indexparent'><a class='index' id='lib:operator<<,path'></a></span><span class='indexparent'><a class='index' id='lib:path,operator<<'></a></span><div class='itemdecl' id='fs.path.io-itemdecl:1'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.io-itemdecl:1'>🔗</a></div><code class='itemdeclcode'><span class='keyword'>template</span><span class='anglebracket'>&lt;</span><span class='keyword'>class</span> charT, <span class='keyword'>class</span> traits<span class='anglebracket'>&gt;</span>
  <span class='keyword'>friend</span> basic_ostream<span class='anglebracket'>&lt;</span>charT, traits<span class='anglebracket'>&gt;</span><span class='operator'>&amp;</span>
    <span class='keyword'>operator</span><span class='anglebracket'>&lt;</span><span class='anglebracket'>&lt;</span><span class='parenthesis'>(</span>basic_ostream<span class='anglebracket'>&lt;</span>charT, traits<span class='anglebracket'>&gt;</span><span class='operator'>&amp;</span> os, <span class='keyword'>const</span> path<span class='operator'>&amp;</span> p<span class='parenthesis'>)</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.io-1'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.io-1'>1</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12762'>#</a></div><div id='fs.path.io-1.sentence-1' class='sentence'><span class='textit'>Effects:</span> Equivalent to <span class='texttt'>os <span class='anglebracket'>&lt;</span><span class='anglebracket'>&lt;</span> quoted<span class='parenthesis'>(</span>p<span class='operator'>.</span>string<span class='anglebracket'>&lt;</span>charT, traits<span class='anglebracket'>&gt;</span><span class='parenthesis'>(</span><span class='parenthesis'>)</span><span class='parenthesis'>)</span></span><a class='hidden_link' href='#fs.path.io-1.sentence-1'>.</a></div> <div id='fs.path.io-1.note-1' class='note'>[<span style='white-space:nowrap'> </span><a class='note_link' href='#fs.path.io-1.note-1'><span class='textit'>Note</span></a><div class='noteBody'><span class='textit'>:</span> <div id='fs.path.io-1.sentence-2' class='sentence'>The <span class='texttt'>quoted</span> function is described in <a href='quoted.manip'>[quoted.manip]</a><a class='hidden_link' href='#fs.path.io-1.sentence-2'>.</a></div> —<span style='white-space:nowrap'> </span><i>end note</i></div><span style='white-space:nowrap'> </span>]</div> </div></div><div class='para' id='fs.path.io-2'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.io-2'>2</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12766'>#</a></div><div id='fs.path.io-2.sentence-1' class='sentence'><span class='textit'>Returns:</span> <span class='texttt'>os</span><a class='hidden_link' href='#fs.path.io-2.sentence-1'>.</a></div></div></div><span class='indexparent'><a class='index' id='lib:operator>>,path'></a></span><span class='indexparent'><a class='index' id='lib:path,operator>>'></a></span><div class='itemdecl' id='fs.path.io-itemdecl:2'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.io-itemdecl:2'>🔗</a></div><code class='itemdeclcode'><span class='keyword'>template</span><span class='anglebracket'>&lt;</span><span class='keyword'>class</span> charT, <span class='keyword'>class</span> traits<span class='anglebracket'>&gt;</span>
  <span class='keyword'>friend</span> basic_istream<span class='anglebracket'>&lt;</span>charT, traits<span class='anglebracket'>&gt;</span><span class='operator'>&amp;</span>
    <span class='keyword'>operator</span><span class='anglebracket'>&gt;</span><span class='anglebracket'>&gt;</span><span class='parenthesis'>(</span>basic_istream<span class='anglebracket'>&lt;</span>charT, traits<span class='anglebracket'>&gt;</span><span class='operator'>&amp;</span> is, path<span class='operator'>&amp;</span> p<span class='parenthesis'>)</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.io-3'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.io-3'>3</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12778'>#</a></div><div id='fs.path.io-3.sentence-1' class='sentence'><span class='textit'>Effects:</span> 
Equivalent to:
<pre class='codeblock'>
basic_string<span class='anglebracket'>&lt;</span>charT, traits<span class='anglebracket'>&gt;</span> tmp;
is <span class='anglebracket'>&gt;</span><span class='anglebracket'>&gt;</span> quoted<span class='parenthesis'>(</span>tmp<span class='parenthesis'>)</span>;
p <span class='operator'>=</span> tmp;
</pre></div></div></div><div class='para' id='fs.path.io-4'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.io-4'>4</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12787'>#</a></div><div id='fs.path.io-4.sentence-1' class='sentence'><span class='textit'>Returns:</span> <span class='texttt'>is</span><a class='hidden_link' href='#fs.path.io-4.sentence-1'>.</a></div></div></div></div><div id='fs.path.nonmember' class='section'><h4 ><a class='secnum' href='#fs.path.nonmember' style='min-width:118pt'>28.11.7.7</a> Non-member functions <a class='abbr_ref' href='fs.path.nonmember'>[fs.path.nonmember]</a></h4><span class='indexparent'><a class='index' id='lib:swap,path_'></a></span><div class='itemdecl' id='fs.path.nonmember-itemdecl:1'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.nonmember-itemdecl:1'>🔗</a></div><code class='itemdeclcode'><span class='keyword'>void</span> swap<span class='parenthesis'>(</span>path<span class='operator'>&amp;</span> lhs, path<span class='operator'>&amp;</span> rhs<span class='parenthesis'>)</span> <span class='keyword'>noexcept</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.nonmember-1'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.nonmember-1'>1</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12799'>#</a></div><div id='fs.path.nonmember-1.sentence-1' class='sentence'><span class='textit'>Effects:</span> Equivalent to <span class='texttt'>lhs<span class='operator'>.</span>swap<span class='parenthesis'>(</span>rhs<span class='parenthesis'>)</span></span><a class='hidden_link' href='#fs.path.nonmember-1.sentence-1'>.</a></div></div></div><span class='indexparent'><a class='index' id='lib:hash_value,path'></a></span><div class='itemdecl' id='fs.path.nonmember-itemdecl:2'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.nonmember-itemdecl:2'>🔗</a></div><code class='itemdeclcode'>size_t hash_value <span class='parenthesis'>(</span><span class='keyword'>const</span> path<span class='operator'>&amp;</span> p<span class='parenthesis'>)</span> <span class='keyword'>noexcept</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.nonmember-2'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.nonmember-2'>2</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12809'>#</a></div><div id='fs.path.nonmember-2.sentence-1' class='sentence'><span class='textit'>Returns:</span> A hash value for the path <span class='texttt'>p</span><a class='hidden_link' href='#fs.path.nonmember-2.sentence-1'>.</a></div> <div id='fs.path.nonmember-2.sentence-2' class='sentence'>If
  for two paths, <span class='texttt'>p1 <span class='operator'>=</span><span class='operator'>=</span> p2</span> then <span class='texttt'>hash_&shy;value<span class='parenthesis'>(</span>p1<span class='parenthesis'>)</span> <span class='operator'>=</span><span class='operator'>=</span> hash_&shy;value<span class='parenthesis'>(</span>p2<span class='parenthesis'>)</span></span><a class='hidden_link' href='#fs.path.nonmember-2.sentence-2'>.</a></div></div></div><span class='indexparent'><a class='index' id='lib:operator==,path'></a></span><span class='indexparent'><a class='index' id='lib:path,operator=='></a></span><div class='itemdecl' id='fs.path.nonmember-itemdecl:3'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.nonmember-itemdecl:3'>🔗</a></div><code class='itemdeclcode'><span class='keyword'>friend</span> <span class='keyword'>bool</span> <span class='keyword'>operator</span><span class='operator'>=</span><span class='operator'>=</span><span class='parenthesis'>(</span><span class='keyword'>const</span> path<span class='operator'>&amp;</span> lhs, <span class='keyword'>const</span> path<span class='operator'>&amp;</span> rhs<span class='parenthesis'>)</span> <span class='keyword'>noexcept</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.nonmember-3'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.nonmember-3'>3</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12820'>#</a></div><div id='fs.path.nonmember-3.sentence-1' class='sentence'><span class='textit'>Returns:</span> <span class='texttt'><span class='operator'>!</span><span class='parenthesis'>(</span>lhs <span class='anglebracket'>&lt;</span> rhs<span class='parenthesis'>)</span> <span class='operator'>&amp;</span><span class='operator'>&amp;</span> <span class='operator'>!</span><span class='parenthesis'>(</span>rhs <span class='anglebracket'>&lt;</span> lhs<span class='parenthesis'>)</span></span><a class='hidden_link' href='#fs.path.nonmember-3.sentence-1'>.</a></div><span class='indexparent'><a class='index' id=':path_equality'></a></span></div></div><div class='para' id='fs.path.nonmember-4'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.nonmember-4'>4</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12824'>#</a></div><div id='fs.path.nonmember-4.note-1' class='note'>[<span style='white-space:nowrap'> </span><a class='note_link' href='#fs.path.nonmember-4.note-1'><span class='textit'>Note</span></a><div class='noteBody'><span class='textit'>:</span> <div id='fs.path.nonmember-4.sentence-1' class='sentence'>Path equality and path equivalence have different semantics<a class='hidden_link' href='#fs.path.nonmember-4.sentence-1'>.</a></div> <div id='fs.path.nonmember-4.sentence-2' class='sentence'><ul class='itemize'><li id='fs.path.nonmember-4.1'><div class='marginalizedparent' style='left:-10em'><a class='marginalized' href='#fs.path.nonmember-4.1'>(4.1)</a></div><div id='fs.path.nonmember-4.1.sentence-1' class='sentence'>Equality is determined by the <span class='texttt'>path</span> non-member <span class='texttt'><span class='keyword'>operator</span><span class='operator'>=</span><span class='operator'>=</span></span>,
which considers the two paths' lexical representations only<a class='hidden_link' href='#fs.path.nonmember-4.1.sentence-1'>.</a></div> <div id='fs.path.nonmember-4.1.example-1' class='example'>[<span style='white-space:nowrap'> </span><a class='example_link' href='#fs.path.nonmember-4.1.example-1'><span class='textit'>Example</span></a><div class='exampleBody'><span class='textit'>:</span> <div id='fs.path.nonmember-4.1.sentence-2' class='sentence'><span class='texttt'>path<span class='parenthesis'>(</span><span class='literal'>"foo"</span><span class='parenthesis'>)</span> <span class='operator'>=</span><span class='operator'>=</span> <span class='literal'>"bar"</span></span> is never <span class='texttt'><span class='literal'>true</span></span><a class='hidden_link' href='#fs.path.nonmember-4.1.sentence-2'>.</a></div> —<span style='white-space:nowrap'> </span><i>end example</i></div><span style='white-space:nowrap'> </span>]</div> </li><li id='fs.path.nonmember-4.2'><div class='marginalizedparent' style='left:-10em'><a class='marginalized' href='#fs.path.nonmember-4.2'>(4.2)</a></div><div id='fs.path.nonmember-4.2.sentence-1' class='sentence'>Equivalence is determined by the <span class='texttt'>equivalent<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span> non-member function, which
determines if two paths resolve (<a href='#fs.class.path'>[fs.class.path]</a>) to the same file system entity<a class='hidden_link' href='#fs.path.nonmember-4.2.sentence-1'>.</a></div> <div id='fs.path.nonmember-4.2.example-2' class='example'>[<span style='white-space:nowrap'> </span><a class='example_link' href='#fs.path.nonmember-4.2.example-2'><span class='textit'>Example</span></a><div class='exampleBody'><span class='textit'>:</span> <div id='fs.path.nonmember-4.2.sentence-2' class='sentence'><span class='texttt'>equivalent<span class='parenthesis'>(</span><span class='literal'>"foo"</span>, <span class='literal'>"bar"</span><span class='parenthesis'>)</span></span> will be <span class='texttt'><span class='literal'>true</span></span> when both paths resolve to the same file<a class='hidden_link' href='#fs.path.nonmember-4.2.sentence-2'>.</a></div> —<span style='white-space:nowrap'> </span><i>end example</i></div><span style='white-space:nowrap'> </span>]</div> </li></ul>
Programmers wishing to determine if two paths are “the same” must decide if
  “the same” means “the same representation” or “resolve to the same actual
  file”, and choose the appropriate function accordingly<a class='hidden_link' href='#fs.path.nonmember-4.sentence-2'>.</a></div> —<span style='white-space:nowrap'> </span><i>end note</i></div><span style='white-space:nowrap'> </span>]</div> </div></div><span class='indexparent'><a class='index' id='lib:operator!=,path'></a></span><span class='indexparent'><a class='index' id='lib:path,operator!='></a></span><div class='itemdecl' id='fs.path.nonmember-itemdecl:4'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.nonmember-itemdecl:4'>🔗</a></div><code class='itemdeclcode'><span class='keyword'>friend</span> <span class='keyword'>bool</span> <span class='keyword'>operator</span><span class='operator'>!</span><span class='operator'>=</span><span class='parenthesis'>(</span><span class='keyword'>const</span> path<span class='operator'>&amp;</span> lhs, <span class='keyword'>const</span> path<span class='operator'>&amp;</span> rhs<span class='parenthesis'>)</span> <span class='keyword'>noexcept</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.nonmember-5'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.nonmember-5'>5</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12847'>#</a></div><div id='fs.path.nonmember-5.sentence-1' class='sentence'><span class='textit'>Returns:</span> <span class='texttt'><span class='operator'>!</span><span class='parenthesis'>(</span>lhs <span class='operator'>=</span><span class='operator'>=</span> rhs<span class='parenthesis'>)</span></span><a class='hidden_link' href='#fs.path.nonmember-5.sentence-1'>.</a></div></div></div><span class='indexparent'><a class='index' id='lib:operator<,path'></a></span><span class='indexparent'><a class='index' id='lib:path,operator<'></a></span><div class='itemdecl' id='fs.path.nonmember-itemdecl:5'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.nonmember-itemdecl:5'>🔗</a></div><code class='itemdeclcode'><span class='keyword'>friend</span> <span class='keyword'>bool</span> <span class='keyword'>operator</span><span class='anglebracket'>&lt;</span> <span class='parenthesis'>(</span><span class='keyword'>const</span> path<span class='operator'>&amp;</span> lhs, <span class='keyword'>const</span> path<span class='operator'>&amp;</span> rhs<span class='parenthesis'>)</span> <span class='keyword'>noexcept</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.nonmember-6'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.nonmember-6'>6</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12857'>#</a></div><div id='fs.path.nonmember-6.sentence-1' class='sentence'><span class='textit'>Returns:</span> <span class='texttt'>lhs<span class='operator'>.</span>compare<span class='parenthesis'>(</span>rhs<span class='parenthesis'>)</span> <span class='anglebracket'>&lt;</span> <span class='literal'>0</span></span><a class='hidden_link' href='#fs.path.nonmember-6.sentence-1'>.</a></div></div></div><span class='indexparent'><a class='index' id='lib:operator<=,path'></a></span><span class='indexparent'><a class='index' id='lib:path,operator<='></a></span><div class='itemdecl' id='fs.path.nonmember-itemdecl:6'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.nonmember-itemdecl:6'>🔗</a></div><code class='itemdeclcode'><span class='keyword'>friend</span> <span class='keyword'>bool</span> <span class='keyword'>operator</span><span class='anglebracket'>&lt;</span><span class='operator'>=</span><span class='parenthesis'>(</span><span class='keyword'>const</span> path<span class='operator'>&amp;</span> lhs, <span class='keyword'>const</span> path<span class='operator'>&amp;</span> rhs<span class='parenthesis'>)</span> <span class='keyword'>noexcept</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.nonmember-7'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.nonmember-7'>7</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12867'>#</a></div><div id='fs.path.nonmember-7.sentence-1' class='sentence'><span class='textit'>Returns:</span> <span class='texttt'><span class='operator'>!</span><span class='parenthesis'>(</span>rhs <span class='anglebracket'>&lt;</span> lhs<span class='parenthesis'>)</span></span><a class='hidden_link' href='#fs.path.nonmember-7.sentence-1'>.</a></div></div></div><span class='indexparent'><a class='index' id='lib:operator>,path'></a></span><span class='indexparent'><a class='index' id='lib:path,operator>'></a></span><div class='itemdecl' id='fs.path.nonmember-itemdecl:7'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.nonmember-itemdecl:7'>🔗</a></div><code class='itemdeclcode'><span class='keyword'>friend</span> <span class='keyword'>bool</span> <span class='keyword'>operator</span><span class='anglebracket'>&gt;</span> <span class='parenthesis'>(</span><span class='keyword'>const</span> path<span class='operator'>&amp;</span> lhs, <span class='keyword'>const</span> path<span class='operator'>&amp;</span> rhs<span class='parenthesis'>)</span> <span class='keyword'>noexcept</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.nonmember-8'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.nonmember-8'>8</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12877'>#</a></div><div id='fs.path.nonmember-8.sentence-1' class='sentence'><span class='textit'>Returns:</span> <span class='texttt'>rhs <span class='anglebracket'>&lt;</span> lhs</span><a class='hidden_link' href='#fs.path.nonmember-8.sentence-1'>.</a></div></div></div><span class='indexparent'><a class='index' id='lib:operator>=,path'></a></span><span class='indexparent'><a class='index' id='lib:path,operator>='></a></span><div class='itemdecl' id='fs.path.nonmember-itemdecl:8'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.nonmember-itemdecl:8'>🔗</a></div><code class='itemdeclcode'><span class='keyword'>friend</span> <span class='keyword'>bool</span> <span class='keyword'>operator</span><span class='anglebracket'>&gt;</span><span class='operator'>=</span><span class='parenthesis'>(</span><span class='keyword'>const</span> path<span class='operator'>&amp;</span> lhs, <span class='keyword'>const</span> path<span class='operator'>&amp;</span> rhs<span class='parenthesis'>)</span> <span class='keyword'>noexcept</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.nonmember-9'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.nonmember-9'>9</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12887'>#</a></div><div id='fs.path.nonmember-9.sentence-1' class='sentence'><span class='textit'>Returns:</span> <span class='texttt'><span class='operator'>!</span><span class='parenthesis'>(</span>lhs <span class='anglebracket'>&lt;</span> rhs<span class='parenthesis'>)</span></span><a class='hidden_link' href='#fs.path.nonmember-9.sentence-1'>.</a></div></div></div><span class='indexparent'><a class='index' id='lib:operator/,path'></a></span><span class='indexparent'><a class='index' id='lib:path,operator/'></a></span><div class='itemdecl' id='fs.path.nonmember-itemdecl:9'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.path.nonmember-itemdecl:9'>🔗</a></div><code class='itemdeclcode'><span class='keyword'>friend</span> path <span class='keyword'>operator</span><span class='operator'>/</span> <span class='parenthesis'>(</span><span class='keyword'>const</span> path<span class='operator'>&amp;</span> lhs, <span class='keyword'>const</span> path<span class='operator'>&amp;</span> rhs<span class='parenthesis'>)</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.path.nonmember-10'><div class='marginalizedparent'><a class='marginalized' href='#fs.path.nonmember-10'>10</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L12897'>#</a></div><div id='fs.path.nonmember-10.sentence-1' class='sentence'><span class='textit'>Effects:</span> Equivalent to: <span class='texttt'><span class='keyword'>return</span> path<span class='parenthesis'>(</span>lhs<span class='parenthesis'>)</span> <span class='operator'>/</span><span class='operator'>=</span> rhs;</span></div></div></div></div></div></body></html>