我想弄清楚 boost 系统错误代码 2 是什么。在一个程序中,他们打印出 boost 错误代码。但是,我不确定如何查找此错误代码。
如有任何帮助,我们将不胜感激。
最佳答案
不在我的脑海中:ENOENT/FileNotFound
请参阅 http://www.boost.org/doc/libs/1_58_0/libs/system/doc/reference.html#Header-error_code 中的错误代码
#include <boost/system/error_code.hpp>
#include <iostream>
int main()
{
boost::system::error_code ec;
ec.assign(2, boost::system::system_category());
std::cout << ec.message() << "\n";
ec.assign(boost::system::errc::no_such_file_or_directory, boost::system::system_category());
std::cout << ec.message() << "\n";
}
打印
No such file or directory
No such file or directory
关于c++ - 什么是 boost system error_code number 2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29782429/