Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
BOOST_ENABLE_ASSERT_HANDLER defined
#include <iostream> #include <string> #define BOOST_ENABLE_ASSERT_HANDLER #include <boost/shared_ptr.hpp> #include <exception> namespace boost { void assertion_failed(char const * expr, char const * function, char const * file, long line) { std::cout << expr << std::endl; // the offending expression std::cout << function << std::endl; // calling function std::cout << file << std::endl; // file which contains the assertion std::cout << line << std::endl; // line number where assert failed std::cout << "an assertion has failed" << std::endl; // line number where assert failed throw std::exception(); } } struct Person{ std::string _age; }; int main() { boost::shared_ptr<Person> aMyPtr; try{ aMyPtr->_age; } catch(std::exception& e) { std::cout << "the access to a null smart pointer generates an exception" << std::endl; } }
run
|
edit
|
history
|
help
0
Set Insert Operation
test
stack
Peg Grammar AST Parser Computer Language Interpreter
Get all anagrams from given words
reverseKNode
Longest Consecutive Subsequence
Date n Time Macros
BubDoubArray2
mutable constexpr