std::filesy...system_error(3)
π std::filesy...system_error(3) π
Straight from the C++ Standard Libary manual, bestie β yes, that's the manual name up top, spelling preserved and everything π«Ά.
π NAME π
std::filesystem::filesystem_error::filesystem_error - std::filesystem::filesystem_error::filesystem_error
π Synopsis π
Overload (1) β since C++17:
filesystem_error( const std::string& what_arg, std::error_code ec );
Overload (2) β since C++17:
filesystem_error( const std::string& what_arg, const std::filesystem::path& p1, std::error_code ec );
Overload (3) β since C++17:
filesystem_error( const std::string& what_arg, const std::filesystem::path& p1, const std::filesystem::path& p2, std::error_code ec );
Overload (4) β since C++17:
filesystem_error( const filesystem_error& other ) noexcept;
Constructs a new filesystem_error object. Periodt. β¨
- 1-3) The error code is set to
ec, and optionally, the paths that were involved in the operation that resulted in the error are set top1andp2.what()after construction returns a string that containswhat_arg(assuming that it does not contain an embedded null character). If either or both path arguments are not provided, a null path is used instead. - 4) Copy constructor. Initialize the contents with those of
other. If*thisandotherboth have dynamic typestd::filesystem_error::filesystem_errorthenstd::strcmp(what(), other.what()) == 0.
πΈ Parameters πΈ
what_argβ explanatory string.ecβ error code for the specific operating system dependent error.p1,p2β paths involved in the operation raising system error.otherβ anotherfilesystem_errorobject to copy.
π§ Notes π§
Because copying std::filesystem::filesystem_error is not permitted to throw exceptions, the explanatory string is typically stored internally in a separately-allocated reference-counted storage. ngl, that's also why there is no constructor taking std::string&&: it would have to copy the content anyway.
Typical implementations also store path objects referenced by path1() and path2() in the reference-counted storage.
π Example π
This section is incomplete.
Reason: no example.
π Category: π
* Todo no example
okay bye bestie π β source/version http://cppreference.com, dated 2024.06.10, page tag std::filesy...system_error(3). That's the actual footer sign-off, no cap π«Άπ.
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms