文件系统:路径构造函数的字符串类型是什么

What is the type of string_type for filesystem::path constructor?

本文关键字:字符串 类型 是什么 构造函数 路径 文件系统      更新时间:2024-09-21

在cppreference的std::filesystem文档中,它显示了采用字符串type&。我正在寻找一个只接受普通(const(char*字符指针的构造函数。它在任何地方都没有说明string_type是什么类型。我想知道它在向它传递const char*时是否会隐式地构造std::string。这里有问题的构造函数是数字4。

path( string_type&& source, format fmt = auto_format );

如上所述,通常在Windows上为std::wstring,在其他地方为std::string

传递const char *(或不同的字符串类型(应该调用不同的构造函数:(5(

template< class Source >
path( const Source& source, format fmt = auto_format );