std::filesystem::path::assign

path& assign( string_type&& source );
(1) (C++17 起)
template< class Source >
path& assign( const Source& source );
(2) (C++17 起)
template< class InputIt >
path& assign( InputIt first, InputIt last );
(3) (C++17 起)

以从给定字符序列构造的新路径替换 path 对象的内容。

1) 以受检测格式字符串 source 所标识的路径名赋值,字符串留在合法但未指定的状态。
2) 以受检测格式的字符范围 source 所标识的路径名赋值。
3) 以受检测格式字符范围 [first, last) 所标识的路径名赋值。

参数

source - 所用的字符范围,表示为 std::basic_stringstd::basic_string_view 、指向空终止字符/宽字符串的指针,或是一个指向空终止字符/宽字符序列的输入迭代器
first, last - 所用的字符范围
类型要求
-
InputIt 必须满足 InputIterator 的要求。
-
InputIt 的 value_type 必须是编码字符类型( charwchar_tchar16_tchar32_t )之一

返回值

*this

参阅

赋值另一个路径
(公开成员函数)

版本历史

  • (当前 | 先前) 2017年5月1日 (一) 04:40Fruderica讨论 | 贡献. . (1,412字节) (+1,412). . (以“{{cpp/filesystem/path/title|assign}} {{cpp/filesystem/path/navbar}} {{dcl begin}} {{dcl | num=1 | since=c++17 | 1= path& assign( string_type&& source ); }} {{dcl | n...”为内容创建页面)