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
dsu on tree (http://codeforces.com/contest/208/problem/E)
BinomialPoisson
C++ Solar eclipse program(Shoushi integrated) 1568 - 1644 also check Lunar eclipse for Xing Yunlu
Exempel 2
is_num_palindrom
cast operator
Volume of Sphere with Powf
ad
rstring
StrSubCpyFind