| Technical Specification | ||||
| Filesystem library(filesystem TS) | ||||
| Library fundamentals(library fundamentals TS) | ||||
| Library fundamentals 2(library fundamentals TS v2) | ||||
| Library fundamentals 3(library fundamentals TS v3) | ||||
| Extensions for parallelism(parallelism TS) | ||||
| Extensions for parallelism 2(parallelism TS v2) | ||||
| Extensions for concurrency(concurrency TS) | ||||
| Extensions for concurrency 2(concurrency TS v2) | ||||
| Concepts(concepts TS) | ||||
| Ranges(ranges TS) | ||||
| Reflection(reflection TS) | ||||
| Mathematical special functions(special functions TR) | ||||
| Experimental Non-TS | ||||
| Pattern Matching | ||||
| Linear Algebra | ||||
| std::execution | ||||
| Contracts | ||||
| 2D Graphics |
| Classes | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Functions | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| File types | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Member functions | ||||
| Path decomposition | ||||
| Non-member functions | ||||
path& operator+=(const path& p); | (1) | (filesystem TS) |
path& operator+=(const string_type& str); | (2) | (filesystem TS) |
path& operator+=(const value_type* ptr); | (3) | (filesystem TS) |
path& operator+=( value_type x); | (4) | (filesystem TS) |
template<class Source> path& operator+=(const Source& source); | (5) | (filesystem TS) |
template<class CharT> path& operator+=( CharT x); | (6) | (filesystem TS) |
template<class Source> path& concat(const Source& source); | (7) | (filesystem TS) |
template<class InputIt> path& concat( InputIterator first, InputIterator last); | (8) | (filesystem TS) |
Concatenates the current path and the argument.
Contents |
| p | - | path to append |
| str | - | string to append |
| ptr | - | pointer to the beginning of a null-terminated string to append |
| x | - | single character to append |
| source | - | std::basic_string, null-terminated multicharacter string, or an input iterator pointing to a null-terminated multicharacter sequence, which represents a path name (either in portable or in native format) |
| first, last | - | pair ofLegacyInputIterators that specify a multicharacter sequence that represents a path name |
| Type requirements | ||
-InputIt must meet the requirements ofLegacyInputIterator. | ||
-The value type ofInputIt must be one of the encoded character types (char,wchar_t,char16_t andchar32_t). | ||
-CharT must be one of the encoded character types (char,wchar_t,char16_t andchar32_t). | ||
*this
May throwfilesystem_error on underlying OS API errors orstd::bad_alloc if memory allocation fails.
Unlike withappend() oroperator/=, additional directory separators are never introduced.
#include <experimental/filesystem>#include <iostream>namespace fs= std::experimental::filesystem; int main(){ fs::path p1;// empty path p1+="var";// does not insert a separatorstd::cout<<"\"\" +\"var\" == "<< p1<<'\n'; p1+="lib";// does not insert a separatorstd::cout<<"\"\" +\"var\" +\"lib\" == "<< p1<<'\n';}
Output:
"" + "var" == "var""" + "var" + "lib" == "varlib"
| appends elements to the path (public member function)[edit] | |
| concatenates two paths with a directory separator (function)[edit] |