18 lines
317 B
Plaintext
18 lines
317 B
Plaintext
|
|
# -*- mode: snippet -*-
|
||
|
|
# name: exception
|
||
|
|
# key: exception
|
||
|
|
# condition: t
|
||
|
|
# --
|
||
|
|
class $0Exception : public std::exception {
|
||
|
|
private:
|
||
|
|
std::string m_message;
|
||
|
|
public:
|
||
|
|
|
||
|
|
$0Exception(const char* message) :
|
||
|
|
m_message(message) {}
|
||
|
|
|
||
|
|
const char* what() const noexcept {
|
||
|
|
return m_message.c_str();
|
||
|
|
}
|
||
|
|
};
|