Boost logo

Boost :

Subject: Re: [boost] [Stacktrace] Second review begins today 17th Mar ends 26th Mar
From: Peter Dimov (lists_at_[hidden])
Date: 2017-03-18 10:40:23


Antony Polukhin wrote:
> <windows.h> is a lesser evil. The huge problem is a COM header with a lot
> of things in global namespace and a bunch of unportable vendor specific
> extensions. One pain of death, I'm not going to rewrite all the COM
> macro-spaghetti code (but I'm open to pull requests). The only good
> solution to avoid global namespace polution - is not to use the library in
> header only mode on MSVC.

The suggestion is not to rewrite the COM code. It's to not include it unless
needed.

template <class E>
void throw_with_trace(const E& e) {
    throw boost::enable_error_info(e)
        << traced(boost::stacktrace::stacktrace());
}

Here no COM or <windows.h> code is needed, but there's no way to avoid their
inclusion.

> > 2. There should exist a documented way to construct a stacktrace from an
> > array of void const*. This is currently possible via from_dump, but it's
> > not guaranteed to work; the format of the dump is technically an
> > implementation detail of the library and may change.
>
> Where that could be useful?

It's useful if one wants to capture the stack trace manually in order to
avoid a dependency on stacktrace at the capture point.
boost::throw_exception, for instance, could be made to do so.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk