<!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::logic_error 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('a00804.html','');}); </script> <div id="doc-content"> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> | <a href="a03066.html">List of all members</a> </div> <div class="headertitle"> <div class="title">std::logic_error 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::logic_error:</div> <div class="dyncontent"> <div class="center"><img src="a03067.png" border="0" usemap="#std_1_1logic__error_inherit__map" alt="Inheritance graph"/></div> <map name="std_1_1logic__error_inherit__map" id="std_1_1logic__error_inherit__map"> <area shape="rect" id="node5" href="a00196.html" title="Base class for exceptions." alt="" coords="305,61,453,99"/><area shape="rect" id="node13" href="a00651.html" title="std::domain_error" alt="" coords="319,123,438,149"/><area shape="rect" id="node15" href="a00670.html" title="Exception type thrown by futures." alt="" coords="325,173,433,198"/><area shape="rect" id="node17" href="a00730.html" title="std::invalid_argument" alt="" coords="309,222,448,247"/><area shape="rect" id="node19" href="a00796.html" title="std::length_error" alt="" coords="323,271,434,297"/><area shape="rect" id="node21" href="a00865.html" title="std::out_of_range" alt="" coords="320,321,437,346"/><area shape="rect" id="node2" href="a00657.html" title="Base class for all library exceptions." alt="" coords="6,198,103,223"/><area shape="rect" id="node7" 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="514,5,641,43"/><area shape="rect" id="node9" href="a00344.html" title="A join cannot be performed logical reasons (i.e., the ranges of the two container objects being joine..." alt="" coords="502,67,653,93"/><area shape="rect" id="node11" href="a00362.html" title="A container cannot be resized." alt="" coords="512,117,643,155"/></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:a7c773ba34519a81a952feb8600a5b04f"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00804.html#a7c773ba34519a81a952feb8600a5b04f">logic_error</a> (const <a class="el" href="a00434.html">string</a> &__arg)</td></tr> <tr class="separator:a7c773ba34519a81a952feb8600a5b04f"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:aa28a91a0ce2f92539f449e498c9e2f24"><td class="memItemLeft" align="right" valign="top">virtual const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="a00804.html#aa28a91a0ce2f92539f449e498c9e2f24">what</a> () const _GLIBCXX_USE_NOEXCEPT</td></tr> <tr class="separator:aa28a91a0ce2f92539f449e498c9e2f24"><td class="memSeparator" colspan="2"> </td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><p>One of two subclasses of exception. </p> <p>Logic errors represent problems in the internal logic of a program; in theory, these are preventable, and even detectable before the program runs (e.g., violations of class invariants). </p> <p>Definition at line <a class="el" href="a01486_source.html#l00056">56</a> of file <a class="el" href="a01486_source.html">stdexcept</a>.</p> </div><h2 class="groupheader">Constructor & Destructor Documentation</h2> <a class="anchor" id="a7c773ba34519a81a952feb8600a5b04f"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">std::logic_error::logic_error </td> <td>(</td> <td class="paramtype">const <a class="el" href="a00434.html">string</a> & </td> <td class="paramname"><em>__arg</em></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">explicit</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Takes a character string describing the error. </p> </div> </div> <h2 class="groupheader">Member Function Documentation</h2> <a class="anchor" id="aa28a91a0ce2f92539f449e498c9e2f24"></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::logic_error::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 (the same string passed to the ctor). </p> <p>Reimplemented from <a class="el" href="a00657.html#a27d45706e1848c30dd4b3defc688e5cb">std::exception</a>.</p> <p>Reimplemented in <a class="el" href="a00670.html#a95833ed17fb6f056709e29abdc50f50c">std::future_error</a>.</p> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li><a class="el" href="a01486_source.html">stdexcept</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="a00804.html">logic_error</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>