std::experimental::filesystem::directory_iterator:: directory_iterator
From cppreference.net
<
cpp
|
experimental
|
fs
|
directory iterator
|
directory_iterator
(
)
;
|
(1) | (文件系统 TS) |
|
explicit
directory_iterator
(
const
path
&
p
)
;
|
(2) | (文件系统 TS) |
|
directory_iterator
(
const
path
&
p, error_code
&
ec
)
;
|
(3) | (文件系统 TS) |
|
directory_iterator
(
const
directory_iterator
&
)
=
default
;
|
(4) | (文件系统 TS) |
|
directory_iterator
(
directory_iterator
&&
)
=
default
;
|
(5) | (文件系统 TS) |
构造一个新的目录迭代器。
1)
构造结束迭代器。
2)
构造一个目录迭代器,指向由
p
标识的目录中的首个目录条目。若
p
指向不存在的文件或非目录,则返回结束迭代器。
参数
| 本节内容尚不完整 |
异常
1)
noexcept
规范:
noexcept
2)
filesystem_error
若发生错误。异常对象以
p
作为参数构造。
3)
noexcept
规范:
noexcept
注释
要遍历当前目录,应将迭代器构造为 directory_iterator ( "." ) 而非 directory_iterator ( "" ) 。