xtd 0.2.0
Loading...
Searching...
No Matches
assert_.cpp

Shows how to use assert_ macro.

#include <xtd/xtd>
using namespace xtd;
int main() {
// Uncomment following line to remove assert dialog
//diagnostics::debug::show_assert_dialog(false);
auto index = 0;
console::write_line("Start application");
assert_(index > 0);
console::write_line("End application");
}
// This code produces the following output :
//
// > If user clicks assert dialog 'Abort' button:
// Start application
//
// > If user clicks assert dialog 'Retry' button:
// Start application
// > Break the debugger on file assert_.cpp line 11.
// > If user choose continue running after break.
// End application
//
// > If user clicks assert dialog 'Ignore' button:
// Start application
// End application
#define assert_(...)
Checks for a condition; if the condition is false, displays a message box that shows the call stack.
Definition assert.h:25
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10