std::experimental::filesystem::path:: operator=
From cppreference.net
<
cpp
|
experimental
|
fs
|
path
|
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
で置き換えます(move semanticsを使用する可能性あり):
p
は有効だが未指定の状態になります。
目次 |
パラメータ
| p | - | 割り当てるパス |
| source | - | std::basic_string 、ヌル終端文字列/ワイド文字列へのポインタ、またはヌル終端文字/ワイド文字シーケンスを指す入力イテレータ。文字型は char 、 char16_t 、 char32_t 、 wchar_t のいずれかでなければならない |
戻り値
* this
例外
1)
(なし)
2)
noexcept
指定子:
noexcept
3)
(なし)
例
このコードを実行
#include <experimental/filesystem> namespace fs = std::experimental::filesystem; int main() { fs::path p = "C:/users/abcdef/AppData/Local"; p = p / "Temp"; // ムーブ代入 const wchar_t* wstr = L"D:/猫.txt"; p = wstr; // ソースからの代入 }
関連項目
|
内容を割り当てる
(公開メンバ関数) |
|
path
を構築する
(公開メンバ関数) |