命名空间
变体
操作

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

来自 cppreference.cn
< cpp‎ | experimental‎ | fs‎ | path
 
 
实验性
技术规范
文件系统库 (filesystem TS)
库基础 (library fundamentals TS)
库基础 2 (library fundamentals TS v2)
库基础 3 (library fundamentals TS v3)
并行性扩展 (parallelism TS)
并行性扩展 2 (parallelism TS v2)
并发性扩展 (concurrency TS)
并发性扩展 2 (concurrency TS v2)
概念 (concepts TS)
范围 (ranges TS)
反射 (reflection TS)
数学特殊函数 (special functions TR)
实验性非TS
模式匹配
线性代数
std::execution
契约
2D图形
 
 
 
path& operator=( const path& p );
(1) (filesystem TS)
path& operator=( path&& p );
(2) (filesystem TS)
template< class Source >
path& operator=( const Source& source );
(3) (filesystem TS)
1)*this 的内容替换为 p 内容的副本。
2)*this 的内容替换为 p,可能使用移动语义:p 处于有效的但不明确的状态。
3)*this 的内容替换为从 source 构造的新路径值,如同通过 path 构造函数 的重载 (4)。等效于 assign(source)

目录

[edit] 参数

p - 要赋值的路径
source - std::basic_string,指向空终止字符/宽字符字符串的指针,或指向空终止字符/宽字符序列的输入迭代器。字符类型必须是 charchar16_tchar32_twchar_t 之一

[edit] 返回值

*this

[edit] 异常

1) (无)
2)
noexcept 规范:  
noexcept
  
3) (无)

[edit] 示例

#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
}

[edit] 参见

赋值内容
(public member function) [edit]
构造一个 path
(public member function) [edit]