2017-03-20 23:52 GMT+03:00 Peter Dimov via Boost
Antony Polukhin wrote:
In the C++ standard there is no requirement that pointer to frame is a pointer to function. C++ Standard does not mention frames at all and many OS return frames as just a void*, not void(*)().
That's true but you've stated that you don't want to support manually captured frames. So what the OS returns should be irrelevant in principle - it's an implementation detail that the library hides from the user.
You do support frames constructed from function pointers, such as the one returned from ::signal, so this is what the constructor should take.
The only reason to take void* would be to support passing the return value of dlsym to the constructor without a reinterpret_cast.
I'll add a `template <class T> frame(T* addr)`
This will do if you also constrain it to is_function<T>.
Good points! Agreed. -- Best regards, Antony Polukhin