std::filesy...::operator=(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

okay so bestie, today’s manual page is std::filesy...::operator=(3), straight out of the C++ Standard Libary, and it’s giving β€œtiny page, assignment operator energy.” let’s get into it. πŸ’–

πŸŽ€ NAME πŸŽ€

  • std::filesystem::filesystem_error::operator= β€” that’s the page name, and the NAME line then repeats the exact same string: std::filesystem::filesystem_error::operator=.

✨ Synopsis ✨

here’s the signature exactly as shown:

filesystem_error& operator=( const filesystem_error& other )
(since C++17)
noexcept;

so what does it do? it assigns the contents with those of other. and if *this and other both have dynamic type std::filesystem::filesystem_error, then std::strcmp(what(), other.what()) == 0 after assignment. no cap, that’s the behavior. πŸ¦‹

🌸 Parameters 🌸

  • other β€” another filesystem_error object to assign with.

πŸ’… Return value πŸ’…

  • *this β€” yep, it returns *this. iconic.

πŸ”₯ Notes πŸ”₯

ngl, here’s the implementation tea the page gives us: typical implementations store path objects referenced by path1() and path2() in a reference-counted storage. as a result, *this and other usually share their path objects after assignment. so yeah, they usually share their path objects after the assignment. πŸ’€

πŸ“ Example πŸ“

this section is incomplete, and the reason is literally no example:

This section is incomplete Reason: no example

πŸ‘‘ Category πŸ‘‘

  • Todo no example

okay bye bestie πŸ’– source/version: http://cppreference.com; date: 2024.06.10; page: std::filesy...::operator=(3). mwah.

πŸ“¦ where this page comes from