std::experi...::operator=(3)
π std::experi...::operator=(3) π
okay so this is the std::experi...::operator=(3) page from the C++ Standard Libary manual, and it's literally all about the assignment operator for std::experimental::filesystem::path. bestie, it's giving overload central and we're gonna get through every single one together π«Ά
πΈ NAME πΈ
std::experimental::filesystem::path::operator= β std::experimental::filesystem::path::operator=
β¨ Synopsis β¨
path& operator=( const path& p ); (1) (filesystem TS)
path& operator=( path&& p ); (2) (filesystem TS)
template< class Source > (3) (filesystem TS)
path& operator=( const Source& source );
- Replaces the contents of
*thiswith a copy of the contents ofp. - Replaces the contents of
*thiswithp, possibly using move semantics:pis left in a valid, but unspecified state π - Replaces the contents of
*thiswith a newpathvalue constructed fromsourceas if by overload (4) of thepathconstructor. Equivalent toassign(source).
π Parameters π
pβ a path to assign- a
std::basic_string, pointer to a null-terminated character/wide character
- a
sourceβ string, or an input iterator that points to a null-terminated character/wide character sequence. The character type must be one ofchar,char16_t,char32_t,wchar_t
π Return value π
*this
π Exceptions π
(none)- noexcept specification:
noexcept (none)
π¦ Example π¦
// Run this code
#include <experimental/filesystem>
namespace fs = std::experimental::filesystem;
int main()
{
fs::path p = "C:/users/abcdef/AppData/Local";
p = p / "Temp"; // move assignment
const wchar_t* wstr = L"D:/η«.txt";
p = wstr; // assignment from a source
}
π See also π
assignβ assigns contents (public member function)constructorβ constructs a path (public member function)
π Categories π
Noindexed pagesunconditionally noexcept
π§ Hidden categories π§
Pages with unreviewed unconditional noexcept templatePages with unreviewed noexcept template
okay bye bestie π source: http://cppreference.com, version/date: 2024.06.10, page: std::experi...::operator=(3). periodt β¨
π¦ 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