xtd - Reference Guide  0.1.2
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
Loading...
Searching...
No Matches
assert_error.h
Go to the documentation of this file.
1
4#pragma once
5#include <stdexcept>
6#include <xtd/ustring.h>
7
9namespace xtd {
11 namespace tunit {
18 class assert_error : public std::exception {
19 public:
22 explicit assert_error(const xtd::ustring& message) : message_(message) {}
23
26 explicit assert_error(const char* message) : message_(message) {}
27
29 assert_error(const assert_error&) = default;
30 assert_error& operator=(const assert_error&) = default;
32
35 const char* what() const noexcept {return message_.c_str();}
36
37 private:
38 xtd::ustring message_;
39 };
40 }
41}
Exception thow when an assertion failed.
Definition assert_error.h:18
const char * what() const noexcept
Returns a string that represents the current assert_error.
Definition assert_error.h:35
assert_error(const xtd::ustring &message)
Create a new instance of assert_error class.
Definition assert_error.h:22
assert_error(const char *message)
Create a new instance of assert_error class.
Definition assert_error.h:26
Represents text as a sequence of UTF-8 code units.
Definition ustring.h:48
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition system_report.h:17
Contains xtd::ustring class.