[fs.path.assign] # 31 Input/output library [[input.output]](./#input.output) ## 31.12 File systems [[filesystems]](filesystems#fs.path.assign) ### 31.12.6 Class path [[fs.class.path]](fs.class.path#fs.path.assign) #### 31.12.6.5 Members [[fs.path.member]](fs.path.member#fs.path.assign) #### 31.12.6.5.2 Assignments [fs.path.assign] [🔗](#lib:operator=,path) `path& operator=(const path& p); ` [1](#1) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L14260) *Effects*: If *this and p are the same object, has no effect[.](#1.sentence-1) Otherwise, sets both respective pathnames of *this to the respective pathnames of p[.](#1.sentence-2) [2](#2) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L14268) *Returns*: *this[.](#2.sentence-1) [🔗](#lib:operator=,path_) `path& operator=(path&& p) noexcept; ` [3](#3) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L14279) *Effects*: If *this and p are the same object, has no effect[.](#3.sentence-1) Otherwise, sets both respective pathnames of *this to the respective pathnames of p[.](#3.sentence-2) p is left in a valid but unspecified state[.](#3.sentence-3) [*Note [1](#note-1)*: A valid implementation is swap(p)[.](#3.sentence-4) — *end note*] [4](#4) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L14290) *Returns*: *this[.](#4.sentence-1) [🔗](#lib:operator=,path__) `path& operator=(string_type&& source); path& assign(string_type&& source); ` [5](#5) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L14303) *Effects*: Sets the pathname in the detected-format of source to the original value of source[.](#5.sentence-1) source is left in a valid but unspecified state[.](#5.sentence-2) [6](#6) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L14309) *Returns*: *this[.](#6.sentence-1) [🔗](#lib:operator=,path___) `template path& operator=(const Source& source); template path& assign(const Source& source); template path& assign(InputIterator first, InputIterator last); ` [7](#7) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L14326) *Effects*: Let s be the effective range of source ([[fs.path.req]](fs.path.req "31.12.6.4 Requirements")) or the range [first, last), with the encoding converted if required ([[fs.path.cvt]](fs.path.cvt "31.12.6.3 Conversions"))[.](#7.sentence-1) Finds the detected-format of s ([[fs.path.fmt.cvt]](fs.path.fmt.cvt "31.12.6.3.1 Argument format conversions")) and sets the pathname in that format to s[.](#7.sentence-2) [8](#8) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L14333) *Returns*: *this[.](#8.sentence-1)