| 361 | namespace my_ns1 { |
| 362 | namespace my_ns2 { |
| 363 | struct my_exception : public std::exception { |
| 364 | private: |
| 365 | std::string msg; |
| 366 | |
| 367 | public: |
| 368 | my_exception(const std::string& s) : msg(s) {} |
| 369 | const char* what() const noexcept override; |
| 370 | }; |
| 371 | const char* my_exception::what() const noexcept { return msg.c_str(); } |
| 372 | } // namespace my_ns2 |
| 373 | } // namespace my_ns1 |