【发布时间】:2019-11-18 01:51:24
【问题描述】:
在以下两行中,第一行给了我编译时错误,第二行很好:
std::remove( boost::filesystem::path( mypath / "file.log" ).c_str() );
std::remove( boost::filesystem::path( mypath / "file.log" ).string().c_str() );
std::remove 签名是:int remove( const char* fname );
这是错误信息:
“没有重载函数“std::remove”的实例与参数列表匹配”
但boost::filesystem::path::c_str() 和std::string::c_str() 都返回const char*。
我使用的编译器是 Visual C++ 2013。
【问题讨论】:
标签: c++ visual-c++ boost path boost-filesystem