It is constructor exception.
DeclarationFollowing is the declaration for std::exception::exception.
exception() throw(); exception (const exception& e) throw();C++11
exception() noexcept; exception (const exception& e) noexcept;Parameters
e − It is an another exception object.
Return Valuenone
ExceptionsNo-throw guarantee − no members throw exceptions.
ExampleIn below example for std::exception::exception.
#include <iostream> #include <exception> struct ooops : std::exception { const char* what() const noexcept {return "Exception test!\n";} }; int main () { ooops e; std::exception* p = &e; try { throw e; } catch (std::exception& ex) { std::cout << ex.what(); } try { throw *p; } catch (std::exception& ex) { std::cout << ex.what(); } return 0; }
The sample output should be like this −
Exception test! std::exception
exception.htm
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4