gpt4 book ai didi

c++ - 什么是 boost system error_code number 2

转载 作者:太空宇宙 更新时间:2023-11-03 10:43:13 27 4
gpt4 key购买 nike

我想弄清楚 boost 系统错误代码 2 是什么。在一个程序中,他们打印出 boost 错误代码。但是,我不确定如何查找此错误代码。

如有任何帮助,我们将不胜感激。

最佳答案

不在我的脑海中:ENOENT/FileNotFound

请参阅 http://www.boost.org/doc/libs/1_58_0/libs/system/doc/reference.html#Header-error_code 中的错误代码

Live On Coliru

#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/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com