aboutsummaryrefslogtreecommitdiffstats
path: root/util/generic/bt_exception.h
blob: c4e770e021e64bff8eef0b4aaa342b2e2f8a9af5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#pragma once 
 
#include <utility>
#include "yexception.h" 
 
#include <util/system/backtrace.h> 
 
template <class T> 
class TWithBackTrace: public T { 
public: 
    template <typename... Args> 
    inline TWithBackTrace(Args&&... args) 
        : T(std::forward<Args>(args)...)
    { 
        BT_.Capture(); 
    } 
 
    const TBackTrace* BackTrace() const noexcept override {
        return &BT_; 
    } 
 
private: 
    TBackTrace BT_; 
};