Boost logo

Boost :

Subject: Re: [boost] [Stacktrace] Second review begins today 17th Mar ends 26th Mar
From: Antony Polukhin (antoshkka_at_[hidden])
Date: 2017-03-18 14:24:19


2017-03-18 16:18 GMT+03:00 Peter Dimov via Boost <boost_at_[hidden]>:
>> You can find the documentation at
>> http://apolukhin.github.io/stacktrace/index.html and the github repo
>> at https://github.com/apolukhin/stacktrace.
>
>
> I wonder if basic_stacktrace, currently
>
> template <class Allocator>
> class basic_stacktrace {
> boost::container::vector<frame, Allocator> impl_;
> /*...*/
> };
>
> would be better of as
>
> template < class Container = std::vector<frame> >
> class basic_stacktrace {
> static_assert( std::is_same<typename Container::value_type,
> frame>::value,
> "The value_type of the Container parameter must be stacktrace::frame"
> );
>
> Container impl_;
>
> /*...*/
> };
>
> This still supports the current functionality of replacing the allocator,
> but it also allows
>
> template<size_t N> using fixed_stacktrace =
> basic_stacktrace<std::array<frame, N>>;
>
> which gets us the previous iteration of the library. Fixed storage does have
> its uses, and while it's possible to use an in-place allocator to get it,
> this is much easier.

This won't work, because std::array has no push_back/pop_back methods.

Is boost::container::vector bothers you? I've used that container
because it could be used in shred memory, so that people could store
stacktrace in shared memory. Now it does not look like a good idea, so
I'll probably change it to std::vector.

-- 
Best regards,
Antony Polukhin

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