How to use boost::error_info correctly?

后端 未结 3 956
一整个雨季
一整个雨季 2021-01-04 10:26

I\'m trying to following the examples on this page:

http://www.boost.org/doc/libs/1_40_0/libs/exception/doc/motivation.html

The minute I try the following li

3条回答
  •  心在旅途
    2021-01-04 11:07

    try:

    #include 
    #include 
    
    throw file_read_error() << boost::errinfo_errno(errno);
    

    even better:

    BOOST_THROW_EXCEPTION(file_read_error() << errinfo_errno(errno));
    

    Your HRESULTErrorInfo example seems correct.

提交回复
热议问题