std::experimental::filesystem::path::operator=

  1. Replaces the contents of *this with a copy of the contents of p.

# Declarations

path& operator=( const path& p );

(filesystem TS)

path& operator=( path&& p );

(filesystem TS)

template< class Source >
path& operator=( const Source& source );

(filesystem TS)

# Parameters

# Return value

*this

# Example

#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