std::filesystem::path::empty 来自cppreference.com < cpp | filesystem | path C++ 语言 标准库头文件 自立与有宿主实现 具名要求 语言支持库 概念库 (C++20) 诊断库 工具库 字符串库 容器库 迭代器库 范围库 (C++20) 算法库 数值库 本地化库 输入/输出库 文件系统库 (C++17) 正则表达式库 (C++11) 原子操作库 (C++11) 线程支持库 (C++11) 技术规范 文件系统库 类 filesystem::path filesystem::filesystem_error filesystem::directory_entry filesystem::directory_iterator filesystem::recursive_directory_iterator filesystem::file_status filesystem::space_info filesystem::file_type filesystem::perms filesystem::perm_options filesystem::copy_options filesystem::directory_options filesystem::file_time_type 函数 filesystem::absolute filesystem::canonicalfilesystem::weakly_canonical filesystem::relativefilesystem::proximate filesystem::copy filesystem::copy_file filesystem::copy_symlink filesystem::create_directoryfilesystem::create_directories filesystem::create_hard_link filesystem::create_symlinkfilesystem::create_directory_symlink filesystem::current_path filesystem::exists filesystem::equivalent filesystem::file_size filesystem::hard_link_count filesystem::last_write_time filesystem::permissions filesystem::read_symlink filesystem::removefilesystem::remove_all filesystem::rename filesystem::resize_file filesystem::space filesystem::statusfilesystem::symlink_status filesystem::temp_directory_path 文件类型 filesystem::is_block_file filesystem::is_character_file filesystem::is_directory filesystem::is_empty filesystem::status_known filesystem::is_fifo filesystem::is_other filesystem::is_regular_file filesystem::is_socket filesystem::is_symlink std::filesystem::path 常量 path::native_formatpath::generic_formatpath::auto_format 成员函数 path::path path::~path path::operator= path::assign path::appendpath::operator /= path::concatpath::operator += path::clear path::make_preferred path::remove_filename path::replace_filename path::replace_extension path::swap path::compare path::beginpath::end path::c_strpath::nativepath::operator string_type path::stringpath::u8stringpath::u16stringpath::u32stringpath::wstring path::generic_stringpath::generic_u8stringpath::generic_u16stringpath::generic_u32stringpath::generic_wstring path::lexically_normalpath::lexically_relativepath::lexically_proximate 路径分解 path::root_name path::root_directory path::root_path path::relative_path path::parent_path path::filename path::stem path::extension path::empty path::has_root_pathpath::has_root_namepath::has_root_directorypath::has_relative_pathpath::has_parent_pathpath::has_filenamepath::has_stempath::has_extension path::is_absolutepath::is_relative 非成员函数 swap(path) hash_value operator==operator!=operator<operator<=operator>operator>=operator<=>(C++20 前)(C++20 前)(C++20 前)(C++20 前)(C++20 前)(C++20) operator/ operator<<operator>> u8path bool empty() const noexcept; (C++17 起) (C++20 前) [[nodiscard]] bool empty() const noexcept; (C++20 起) 检查通用格式的路径是否为空。 参数 (无) 返回值 若路径为空则为 true ,否则为 false 。 注意 可以通过调用 clear 和默认构造 path 获得空路径。若对应组分不存在于路径中,则路径分解函数(如 extension )亦可以返回空路径。 空路径被分类为相对路径。 参阅 (构造函数) 构造一个 path (公开成员函数)