<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.3"/> <title>libstdc++: std::exception Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> $(document).ready(initResizable); $(window).load(resizeHeight); </script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">libstdc++ </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.3 --> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> $(document).ready(function(){initNavTree('a00657.html','');}); </script> <div id="doc-content"> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> | <a href="a02848.html">List of all members</a> </div> <div class="headertitle"> <div class="title">std::exception Class Reference<div class="ingroups"><a class="el" href="a01630.html">Exceptions</a></div></div> </div> </div><!--header--> <div class="contents"> <div class="dynheader"> Inheritance diagram for std::exception:</div> <div class="dyncontent"> <div class="center"><img src="a02849.png" border="0" usemap="#std_1_1exception_inherit__map" alt="Inheritance graph"/></div> <map name="std_1_1exception_inherit__map" id="std_1_1exception_inherit__map"> <area shape="rect" id="node3" href="a00045.html" title="Thown by exception safety machinery." alt="" coords="152,5,307,30"/><area shape="rect" id="node5" href="a00064.html" title="Exception thrown by __cxa_guard_acquire.6.7[stmt.dcl]/4: If control re-enters the declaration (recurs..." alt="" coords="160,54,299,93"/><area shape="rect" id="node7" href="a00577.html" title="Exception possibly thrown by new.bad_alloc (or classes derived from it) is used to report allocation ..." alt="" coords="180,117,279,142"/><area shape="rect" id="node9" href="a00578.html" title="Thrown during incorrect typecasting.If you attempt an invalid dynamic_cast expression, an instance of this class (or something derived from this class) is thrown." alt="" coords="182,166,277,191"/><area shape="rect" id="node11" href="a00579.html" title="std::bad_exception" alt="" coords="167,215,292,241"/><area shape="rect" id="node13" href="a00580.html" title="Exception class thrown when class template function's operator() is called with an empty target..." alt="" coords="159,265,300,290"/><area shape="rect" id="node15" href="a00581.html" title="Thrown when a NULL pointer in a typeid expression is used." alt="" coords="177,314,282,339"/><area shape="rect" id="node17" href="a00582.html" title="Exception possibly thrown by shared_ptr." alt="" coords="168,363,291,389"/><area shape="rect" id="node19" href="a00732.html" title="These are thrown to indicate problems with io.27.4.2.1.1 Class ios_base::failure." alt="" coords="162,413,297,438"/><area shape="rect" id="node21" href="a00804.html" title="One of two subclasses of exception." alt="" coords="178,462,281,487"/><area shape="rect" id="node41" href="a00907.html" title="One of two subclasses of exception." alt="" coords="170,685,289,710"/><area shape="rect" id="node23" href="a00196.html" title="Base class for exceptions." alt="" coords="355,301,503,339"/><area shape="rect" id="node31" href="a00651.html" title="std::domain_error" alt="" coords="370,363,489,389"/><area shape="rect" id="node33" href="a00670.html" title="Exception type thrown by futures." alt="" coords="375,413,483,438"/><area shape="rect" id="node35" href="a00730.html" title="std::invalid_argument" alt="" coords="360,462,499,487"/><area shape="rect" id="node37" href="a00796.html" title="std::length_error" alt="" coords="374,511,485,537"/><area shape="rect" id="node39" href="a00865.html" title="std::out_of_range" alt="" coords="371,561,488,586"/><area shape="rect" id="node25" href="a00343.html" title="An entry cannot be inserted into a container object for logical reasons (not, e.g., if memory is unabvailable, in which case the allocator_type's exception will be thrown)." alt="" coords="565,245,691,283"/><area shape="rect" id="node27" href="a00344.html" title="A join cannot be performed logical reasons (i.e., the ranges of the two container objects being joine..." alt="" coords="553,307,703,333"/><area shape="rect" id="node29" href="a00362.html" title="A container cannot be resized." alt="" coords="563,357,693,395"/><area shape="rect" id="node43" href="a00867.html" title="std::overflow_error" alt="" coords="368,610,491,635"/><area shape="rect" id="node45" href="a00886.html" title="std::range_error" alt="" coords="375,659,484,685"/><area shape="rect" id="node47" href="a00896.html" title="A regular expression exception class.The regular expression library throws objects of this class on e..." alt="" coords="375,709,483,734"/><area shape="rect" id="node49" href="a00915.html" title="Thrown to indicate error code of underlying system." alt="" coords="372,758,487,783"/><area shape="rect" id="node51" href="a00941.html" title="std::underflow_error" alt="" coords="364,807,495,833"/></map> <center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr class="memitem:a27d45706e1848c30dd4b3defc688e5cb"><td class="memItemLeft" align="right" valign="top">virtual const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="a00657.html#a27d45706e1848c30dd4b3defc688e5cb">what</a> () const _GLIBCXX_USE_NOEXCEPT</td></tr> <tr class="separator:a27d45706e1848c30dd4b3defc688e5cb"><td class="memSeparator" colspan="2"> </td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><p>Base class for all library exceptions. </p> <p>This is the base class for all exceptions thrown by the standard library, and by certain language expressions. You are free to derive your own exception classes, or use a different hierarchy, or to throw non-class data (e.g., fundamental types). </p> <p>Definition at line <a class="el" href="a01166_source.html#l00062">62</a> of file <a class="el" href="a01166_source.html">exception</a>.</p> </div><h2 class="groupheader">Member Function Documentation</h2> <a class="anchor" id="a27d45706e1848c30dd4b3defc688e5cb"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">virtual const char* std::exception::what </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns a C-style character string describing the general cause of the current error. </p> <p>Reimplemented in <a class="el" href="a00732.html#a8d1ec8205dbb2c43207f9efbce1cc47d">std::ios_base::failure</a>, <a class="el" href="a00581.html#afab564631ed539e8880f51d6ed0bbd2e">std::bad_typeid</a>, <a class="el" href="a00578.html#a7b9f49affedc6eaf717b5729e51a4ee9">std::bad_cast</a>, <a class="el" href="a00907.html#afe157b9d771e03a76881ce352fda7453">std::runtime_error</a>, <a class="el" href="a00670.html#a95833ed17fb6f056709e29abdc50f50c">std::future_error</a>, <a class="el" href="a00579.html#a60d49323883dc12820f71a777fe4bce7">std::bad_exception</a>, <a class="el" href="a00804.html#aa28a91a0ce2f92539f449e498c9e2f24">std::logic_error</a>, <a class="el" href="a00577.html#a6e36015d13822361895a275c6b4d1720">std::bad_alloc</a>, and <a class="el" href="a00582.html#adfea1fffacfb8c9c39f374e16ec7315c">std::bad_weak_ptr</a>.</p> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li><a class="el" href="a01166_source.html">exception</a></li> </ul> </div><!-- contents --> </div><!-- doc-content --> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="navelem"><a class="el" href="a01604.html">std</a></li><li class="navelem"><a class="el" href="a00657.html">exception</a></li> <li class="footer">Generated by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.3 </li> </ul> </div> </body> </html>