<!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"/> <title>libstdc++: std::logic_error Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript"> $(document).ready(initResizable); </script> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <!-- Generated by Doxygen 1.7.4 --> <div id="top"> <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> </div> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> initNavTree('a00585.html',''); </script> <div id="doc-content"> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> </div> <div class="headertitle"> <div class="title">std::logic_error Class Reference<div class="ingroups"><a class="el" href="a01164.html">Exceptions</a></div></div> </div> </div> <div class="contents"> <!-- doxytag: class="std::logic_error" --><!-- doxytag: inherits="std::exception" --> <p>One of two subclasses of exception. <a href="a00585.html#details">More...</a></p> <div class="dynheader"> Inheritance diagram for std::logic_error:</div> <div class="dyncontent"> <div class="center"><img src="a02209.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="a00460.html" title="std::domain_error" alt="" coords="315,5,432,35"/><area shape="rect" id="node7" href="a00482.html" title="Exception type thrown by futures." alt="" coords="320,59,427,88"/><area shape="rect" id="node9" href="a00527.html" title="std::invalid_argument" alt="" coords="304,112,443,141"/><area shape="rect" id="node11" href="a00576.html" title="std::length_error" alt="" coords="319,165,428,195"/><area shape="rect" id="node13" href="a00646.html" title="std::out_of_range" alt="" coords="315,219,432,248"/><area shape="rect" id="node2" href="a00466.html" title="Base class for all library exceptions." alt="" coords="7,112,103,141"/></map> <center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div> <p><a href="a02210.html">List of all members.</a></p> <h2><a name="pub-methods"></a> Public Member Functions</h2> <ul> <li><a class="el" href="a00585.html#a7c773ba34519a81a952feb8600a5b04f">logic_error</a> (const <a class="el" href="a00253.html">string</a> &__arg) <li>virtual const char * <a class="el" href="a00585.html#aa221900caacc438f186b0d70d918737c">what</a> () const throw () </ul> <hr/><a name="details" id="details"></a><h2>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="a01041_source.html#l00056">56</a> of file <a class="el" href="a01041_source.html">stdexcept</a>.</p> </div><hr/><h2>Constructor & Destructor Documentation</h2> <a class="anchor" id="a7c773ba34519a81a952feb8600a5b04f"></a><!-- doxytag: member="std::logic_error::logic_error" ref="a7c773ba34519a81a952feb8600a5b04f" args="(const string &__arg)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">std::logic_error::logic_error </td> <td>(</td> <td class="paramtype">const <a class="el" href="a00253.html">string</a> & </td> <td class="paramname"><em>__arg</em></td><td>)</td> <td><code> [explicit]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Takes a character string describing the error. </p> </div> </div> <hr/><h2>Member Function Documentation</h2> <a class="anchor" id="aa221900caacc438f186b0d70d918737c"></a><!-- doxytag: member="std::logic_error::what" ref="aa221900caacc438f186b0d70d918737c" args="() const " --> <div class="memitem"> <div class="memproto"> <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 throw ()<code> [virtual]</code></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="a00466.html#af24d0d59881ce88808f4c772f4669370">std::exception</a>.</p> <p>Reimplemented in <a class="el" href="a00482.html#ad0b815fb754af64a4d3744db1d1e360b">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="a01041_source.html">stdexcept</a></li> </ul> </div> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="a01137.html">std</a> </li> <li class="navelem"><a class="el" href="a00585.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.7.4 </li> </ul> </div> </body> </html>