Boost logo

Boost Users :

From: Bernard (bpwlodarski_at_[hidden])
Date: 2023-10-30 03:39:45


boost_1_81_0
Microsoft Visual Studio Community 2022 (64-bit) - Preview
Version 17.8.0 Preview 5.0

<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Virus-free.www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Sun, Oct 29, 2023 at 11:17 PM Emil Dotchevski
<emildotchevski_at_[hidden]> wrote:
>
> Can't repro on godbolt/gcc: https://godbolt.org/z/rWddT5xce.
>
> I know you're using MSVC but please provide compiler version and Boost version.
>
> On Sun, Oct 29, 2023 at 7:29 AM Bernard via Boost-users <boost-users_at_[hidden]> wrote:
>>
>> greetings kind regards
>> may i please inquire how not to obtain "std::exception::what: Unknown exception" from diagnosic_inforumation() . my meaning is to inquire how to obtain as per example on boost web page https://www.boost.org/doc/libs/1_83_0/libs/exception/doc/tutorial_diagnostic_information.html
>> output : "std::exception::what: example_io error"
>> id est where did "example_io error" come from as neither boost::exception nor std:::exception accept constructor string arguments .
>>
>> please my code below .
>> thank you kindly
>>
>> #include "stl" // #includes all stl #include files
>> #include "boost\exception\all.hpp"
>> using namespace std;
>>
>> struct ceXception : virtual boost::exception, virtual std::exception
>> {
>> using this_type = ceXception;
>> ceXception() {}
>> auto what() { cerr << __FUNCSIG__ << endl; return string("return from " + string(__FUNCSIG__)); }
>> template<typename charType>
>> friend
>> std::basic_ostream<charType>& operator<<(std::basic_ostream<charType>& _ostream, const this_type&) { cerr << "to cerr from " << __FUNCSIG__ << endl; _ostream << "to ostream from " << __FUNCSIG__ << endl; return _ostream; }
>> };
>>
>> void foo()
>> {
>> try { BOOST_THROW_EXCEPTION(ceXception()); }
>> catch (ceXception& e)
>> {
>> cerr << boost::diagnostic_information(e);
>> }
>> }
>>
>> int main()
>> {
>> foo();
>> return 0;
>> }
>> _______________________________________________
>> Boost-users mailing list
>> Boost-users_at_[hidden]
>> https://lists.boost.org/mailman/listinfo.cgi/boost-users


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net