<!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::sub_match< _BiIter > Class Template 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('a00914.html','');}); </script> <div id="doc-content"> <div class="header"> <div class="summary"> <a href="#pub-types">Public Types</a> | <a href="#pub-methods">Public Member Functions</a> | <a href="#pub-attribs">Public Attributes</a> | <a href="a03239.html">List of all members</a> </div> <div class="headertitle"> <div class="title">std::sub_match< _BiIter > Class Template Reference<div class="ingroups"><a class="el" href="a01656.html">Regular Expressions</a></div></div> </div> </div><!--header--> <div class="contents"> <div class="dynheader"> Inheritance diagram for std::sub_match< _BiIter >:</div> <div class="dyncontent"> <div class="center"><img src="a03240.png" border="0" usemap="#std_1_1sub__match_3_01___bi_iter_01_4_inherit__map" alt="Inheritance graph"/></div> <map name="std_1_1sub__match_3_01___bi_iter_01_4_inherit__map" id="std_1_1sub__match_3_01___bi_iter_01_4_inherit__map"> <area shape="rect" id="node7" href="a00914.html" title="std::sub_match\< _Bi\l_iter \>" alt="" coords="18,273,149,311"/><area shape="rect" id="node2" href="a00460.html" title="std::pair\< _BiIter,\l _BiIter \>" alt="" coords="27,94,140,133"/><area shape="rect" id="node4" href="a00460.html" title="Struct holding two objects of arbitrary type." alt="" coords="17,6,151,31"/></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-types"></a> Public Types</h2></td></tr> <tr class="memitem:a23d71568f74ae6beb1819ff9d9975279"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a23d71568f74ae6beb1819ff9d9975279"></a> typedef iterator_traits<br class="typebreak"/> < _BiIter >::difference_type </td><td class="memItemRight" valign="bottom"><b>difference_type</b></td></tr> <tr class="separator:a23d71568f74ae6beb1819ff9d9975279"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a323660e5704618c07b0d1d38f3f9ff02"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a323660e5704618c07b0d1d38f3f9ff02"></a> typedef _BiIter </td><td class="memItemRight" valign="bottom"><b>first_type</b></td></tr> <tr class="separator:a323660e5704618c07b0d1d38f3f9ff02"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a58ff33d1fb8d9a4d31a1cb60f2de17dd"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a58ff33d1fb8d9a4d31a1cb60f2de17dd"></a> typedef _BiIter </td><td class="memItemRight" valign="bottom"><b>iterator</b></td></tr> <tr class="separator:a58ff33d1fb8d9a4d31a1cb60f2de17dd"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a6d205c1eab800cb27d82060d11d531a3"><td class="memItemLeft" align="right" valign="top">typedef _BiIter </td><td class="memItemRight" valign="bottom"><a class="el" href="a00460.html#a6d205c1eab800cb27d82060d11d531a3">second_type</a></td></tr> <tr class="separator:a6d205c1eab800cb27d82060d11d531a3"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a0c88c8e870e61270b0d66d9cf4c3b5dc"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0c88c8e870e61270b0d66d9cf4c3b5dc"></a> typedef <a class="el" href="a00434.html">std::basic_string</a><br class="typebreak"/> < value_type > </td><td class="memItemRight" valign="bottom"><b>string_type</b></td></tr> <tr class="separator:a0c88c8e870e61270b0d66d9cf4c3b5dc"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a347cefb21853cc29d45a500b9edab4a0"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a347cefb21853cc29d45a500b9edab4a0"></a> typedef iterator_traits<br class="typebreak"/> < _BiIter >::value_type </td><td class="memItemRight" valign="bottom"><b>value_type</b></td></tr> <tr class="separator:a347cefb21853cc29d45a500b9edab4a0"><td class="memSeparator" colspan="2"> </td></tr> </table><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:a6df0d57626fcbb60ecb93af770613dae"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00914.html#a6df0d57626fcbb60ecb93af770613dae">compare</a> (const <a class="el" href="a00914.html">sub_match</a> &__s) const </td></tr> <tr class="separator:a6df0d57626fcbb60ecb93af770613dae"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:adb0557e6068182cb136e524f1fe016a1"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00914.html#adb0557e6068182cb136e524f1fe016a1">compare</a> (const <a class="el" href="a00434.html">string_type</a> &__s) const </td></tr> <tr class="separator:adb0557e6068182cb136e524f1fe016a1"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ab22cf4efb0e5c925cc965ac364569133"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00914.html#ab22cf4efb0e5c925cc965ac364569133">compare</a> (const value_type *__s) const </td></tr> <tr class="separator:ab22cf4efb0e5c925cc965ac364569133"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a74f61cff4cba887613e5428260f882ed"><td class="memItemLeft" align="right" valign="top">difference_type </td><td class="memItemRight" valign="bottom"><a class="el" href="a00914.html#a74f61cff4cba887613e5428260f882ed">length</a> () const </td></tr> <tr class="separator:a74f61cff4cba887613e5428260f882ed"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:aa1419d9c0b0e55127b50126a9a31645f"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00914.html#aa1419d9c0b0e55127b50126a9a31645f">operator string_type</a> () const </td></tr> <tr class="separator:aa1419d9c0b0e55127b50126a9a31645f"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ad8c99d45b2d8f0066d06284bdb5dfcbd"><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00434.html">string_type</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00914.html#ad8c99d45b2d8f0066d06284bdb5dfcbd">str</a> () const </td></tr> <tr class="separator:ad8c99d45b2d8f0066d06284bdb5dfcbd"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a12021cc196f0e58f5acde4f1398e10fa"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a12021cc196f0e58f5acde4f1398e10fa"></a> void </td><td class="memItemRight" valign="bottom"><b>swap</b> (<a class="el" href="a00460.html">pair</a> &__p) noexcept(noexcept(swap(<a class="el" href="a00460.html#a198b03cffc037835dc1dc01c926ce251">first</a>, __p.first))&&noexcept(swap(<a class="el" href="a00460.html#a91179413226db12e66346d3673b7835f">second</a>, __p.second)))</td></tr> <tr class="separator:a12021cc196f0e58f5acde4f1398e10fa"><td class="memSeparator" colspan="2"> </td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a> Public Attributes</h2></td></tr> <tr class="memitem:a198b03cffc037835dc1dc01c926ce251"><td class="memItemLeft" align="right" valign="top">_BiIter </td><td class="memItemRight" valign="bottom"><a class="el" href="a00460.html#a198b03cffc037835dc1dc01c926ce251">first</a></td></tr> <tr class="separator:a198b03cffc037835dc1dc01c926ce251"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a418744263c498aabc55254401b181157"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a418744263c498aabc55254401b181157"></a> bool </td><td class="memItemRight" valign="bottom"><b>matched</b></td></tr> <tr class="separator:a418744263c498aabc55254401b181157"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a91179413226db12e66346d3673b7835f"><td class="memItemLeft" align="right" valign="top">_BiIter </td><td class="memItemRight" valign="bottom"><a class="el" href="a00460.html#a91179413226db12e66346d3673b7835f">second</a></td></tr> <tr class="separator:a91179413226db12e66346d3673b7835f"><td class="memSeparator" colspan="2"> </td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><h3>template<typename _BiIter><br/> class std::sub_match< _BiIter ></h3> <p>A sequence of characters matched by a particular marked sub-expression.</p> <p>An object of this class is essentially a pair of iterators marking a matched subexpression within a regular expression pattern match. Such objects can be converted to and compared with <a class="el" href="a00434.html" title="Managing sequences of characters and character-like objects.">std::basic_string</a> objects of a similar base character type as the pattern matched by the regular expression.</p> <p>The iterators that make up the pair are the usual half-open interval referencing the actual original pattern matched. </p> <p>Definition at line <a class="el" href="a01410_source.html#l00760">760</a> of file <a class="el" href="a01410_source.html">regex.h</a>.</p> </div><h2 class="groupheader">Member Typedef Documentation</h2> <a class="anchor" id="a6d205c1eab800cb27d82060d11d531a3"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">typedef _BiIter <a class="el" href="a00460.html">std::pair</a>< _BiIter , _BiIter >::<a class="el" href="a00460.html#a6d205c1eab800cb27d82060d11d531a3">second_type</a></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inherited</span></span> </td> </tr> </table> </div><div class="memdoc"> <p><code>first_type</code> is the first bound type </p> <p>Definition at line <a class="el" href="a01505_source.html#l00091">91</a> of file <a class="el" href="a01505_source.html">stl_pair.h</a>.</p> </div> </div> <h2 class="groupheader">Member Function Documentation</h2> <a class="anchor" id="a6df0d57626fcbb60ecb93af770613dae"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<typename _BiIter> </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">int <a class="el" href="a00914.html">std::sub_match</a>< _BiIter >::compare </td> <td>(</td> <td class="paramtype">const <a class="el" href="a00914.html">sub_match</a>< _BiIter > & </td> <td class="paramname"><em>__s</em></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Compares this and another matched sequence. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">__s</td><td>Another matched sequence to compare to this one.</td></tr> </table> </dd> </dl> <dl class="retval"><dt>Return values</dt><dd> <table class="retval"> <tr><td class="paramname"><0</td><td>this matched sequence will collate before <code>__s</code>. </td></tr> <tr><td class="paramname">=0</td><td>this matched sequence is equivalent to <code>__s</code>. </td></tr> <tr><td class="paramname"><0</td><td>this matched sequence will collate after <code>__s</code>. </td></tr> </table> </dd> </dl> <p>Definition at line <a class="el" href="a01410_source.html#l00821">821</a> of file <a class="el" href="a01410_source.html">regex.h</a>.</p> <p>Referenced by <a class="el" href="a01410_source.html#l00885">std::operator!=()</a>, <a class="el" href="a01410_source.html#l00897">std::operator<()</a>, <a class="el" href="a01410_source.html#l00909">std::operator<=()</a>, <a class="el" href="a01410_source.html#l00873">std::operator==()</a>, <a class="el" href="a01410_source.html#l00933">std::operator>()</a>, and <a class="el" href="a01410_source.html#l00921">std::operator>=()</a>.</p> </div> </div> <a class="anchor" id="adb0557e6068182cb136e524f1fe016a1"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<typename _BiIter> </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">int <a class="el" href="a00914.html">std::sub_match</a>< _BiIter >::compare </td> <td>(</td> <td class="paramtype">const <a class="el" href="a00434.html">string_type</a> & </td> <td class="paramname"><em>__s</em></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Compares this <a class="el" href="a00914.html">sub_match</a> to a string. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">__s</td><td>A string to compare to this <a class="el" href="a00914.html">sub_match</a>.</td></tr> </table> </dd> </dl> <dl class="retval"><dt>Return values</dt><dd> <table class="retval"> <tr><td class="paramname"><0</td><td>this matched sequence will collate before <code>__s</code>. </td></tr> <tr><td class="paramname">=0</td><td>this matched sequence is equivalent to <code>__s</code>. </td></tr> <tr><td class="paramname"><0</td><td>this matched sequence will collate after <code>__s</code>. </td></tr> </table> </dd> </dl> <p>Definition at line <a class="el" href="a01410_source.html#l00834">834</a> of file <a class="el" href="a01410_source.html">regex.h</a>.</p> </div> </div> <a class="anchor" id="ab22cf4efb0e5c925cc965ac364569133"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<typename _BiIter> </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">int <a class="el" href="a00914.html">std::sub_match</a>< _BiIter >::compare </td> <td>(</td> <td class="paramtype">const value_type * </td> <td class="paramname"><em>__s</em></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Compares this <a class="el" href="a00914.html">sub_match</a> to a C-style string. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">__s</td><td>A C-style string to compare to this <a class="el" href="a00914.html">sub_match</a>.</td></tr> </table> </dd> </dl> <dl class="retval"><dt>Return values</dt><dd> <table class="retval"> <tr><td class="paramname"><0</td><td>this matched sequence will collate before <code>__s</code>. </td></tr> <tr><td class="paramname">=0</td><td>this matched sequence is equivalent to <code>__s</code>. </td></tr> <tr><td class="paramname"><0</td><td>this matched sequence will collate after <code>__s</code>. </td></tr> </table> </dd> </dl> <p>Definition at line <a class="el" href="a01410_source.html#l00847">847</a> of file <a class="el" href="a01410_source.html">regex.h</a>.</p> </div> </div> <a class="anchor" id="a74f61cff4cba887613e5428260f882ed"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<typename _BiIter> </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">difference_type <a class="el" href="a00914.html">std::sub_match</a>< _BiIter >::length </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">inline</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Gets the length of the matching sequence. </p> <p>Definition at line <a class="el" href="a01410_source.html#l00778">778</a> of file <a class="el" href="a01410_source.html">regex.h</a>.</p> </div> </div> <a class="anchor" id="aa1419d9c0b0e55127b50126a9a31645f"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<typename _BiIter> </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname"><a class="el" href="a00914.html">std::sub_match</a>< _BiIter >::operator <a class="el" href="a00434.html">string_type</a> </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">inline</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Gets the matching sequence as a string. </p> <dl class="section return"><dt>Returns</dt><dd>the matching sequence as a string.</dd></dl> <p>This is the implicit conversion operator. It is identical to the <a class="el" href="a00914.html#ad8c99d45b2d8f0066d06284bdb5dfcbd" title="Gets the matching sequence as a string.">str()</a> member function except that it will want to pop up in unexpected places and cause a great deal of confusion and cursing from the unwary. </p> <p>Definition at line <a class="el" href="a01410_source.html#l00791">791</a> of file <a class="el" href="a01410_source.html">regex.h</a>.</p> </div> </div> <a class="anchor" id="ad8c99d45b2d8f0066d06284bdb5dfcbd"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<typename _BiIter> </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname"><a class="el" href="a00434.html">string_type</a> <a class="el" href="a00914.html">std::sub_match</a>< _BiIter >::str </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">inline</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Gets the matching sequence as a string. </p> <dl class="section return"><dt>Returns</dt><dd>the matching sequence as a string. </dd></dl> <p>Definition at line <a class="el" href="a01410_source.html#l00804">804</a> of file <a class="el" href="a01410_source.html">regex.h</a>.</p> <p>Referenced by <a class="el" href="a01410_source.html#l00821">std::sub_match< _Bi_iter >::compare()</a>, and <a class="el" href="a01410_source.html#l01423">std::operator<<()</a>.</p> </div> </div> <h2 class="groupheader">Member Data Documentation</h2> <a class="anchor" id="a198b03cffc037835dc1dc01c926ce251"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">_BiIter <a class="el" href="a00460.html">std::pair</a>< _BiIter , _BiIter >::first</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inherited</span></span> </td> </tr> </table> </div><div class="memdoc"> <p><code>second_type</code> is the second bound type </p> <p>Definition at line <a class="el" href="a01505_source.html#l00093">93</a> of file <a class="el" href="a01505_source.html">stl_pair.h</a>.</p> <p>Referenced by <a class="el" href="a01410_source.html#l00778">std::sub_match< _Bi_iter >::length()</a>, <a class="el" href="a01410_source.html#l00791">std::sub_match< _Bi_iter >::operator string_type()</a>, and <a class="el" href="a01410_source.html#l00804">std::sub_match< _Bi_iter >::str()</a>.</p> </div> </div> <a class="anchor" id="a91179413226db12e66346d3673b7835f"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">_BiIter <a class="el" href="a00460.html">std::pair</a>< _BiIter , _BiIter >::second</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inherited</span></span> </td> </tr> </table> </div><div class="memdoc"> <p><code>first</code> is a copy of the first object </p> <p>Definition at line <a class="el" href="a01505_source.html#l00094">94</a> of file <a class="el" href="a01505_source.html">stl_pair.h</a>.</p> <p>Referenced by <a class="el" href="a01410_source.html#l00778">std::sub_match< _Bi_iter >::length()</a>, <a class="el" href="a01410_source.html#l00791">std::sub_match< _Bi_iter >::operator string_type()</a>, and <a class="el" href="a01410_source.html#l00804">std::sub_match< _Bi_iter >::str()</a>.</p> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li><a class="el" href="a01410_source.html">regex.h</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="a00914.html">sub_match</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>