current_path功能

设置或检索当前工作目录。

重要说明重要事项

此 API 不能在 Windows 运行时执行的应用程序。

template<class Path>
   inline Path current_path();
template<class Path>
   inline void current_path(const Path& Pval);

参数

  • Pval
    Path 对象。Path 可以是 basic_path 或从 basic_path派生类型。

备注

第一个函数返回当前工作目录。

第二个函数设置当前工作目录切换到 Pval。

要求

标头: 文件系统

命名空间: std::tr2::sys

请参见

参考

<filesystem>

其他资源

标头文件