?? structassertion__traits.html
字號:
<html><head><title>CppUnit - The Unit Testing Library</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body bgcolor="#ffffff"> <table width="100%"> <tr> <td width="40%" align="left" valign="center"> <a href="http://sourceforge.net/projects/cppunit"> CppUnit project page </a> </td> <td> <a href="FAQ">FAQ</a> </td> <td width="40%" align="right" valign="center"> <a href="http://cppunit.sourceforge.net">CppUnit home page</a> </td> </tr></table><hr><!-- Generated by Doxygen 1.3.7 --><div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="namespacemembers.html">Namespace Members</a> | <a class="qindex" href="functions.html">Class Members</a> | <a class="qindex" href="globals.html">File Members</a> | <a class="qindex" href="pages.html">Related Pages</a></div><h1>assertion_traits< T > Struct Template Reference</h1>Traits used by <a class="el" href="group___assertions.html#ga3">CPPUNIT_ASSERT_EQUAL()</a>. <a href="#_details">More...</a><p><code>#include <<a class="el" href="_test_assert_8h-source.html">TestAssert.h</a>></code><p><a href="structassertion__traits-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0><tr><td></td></tr><tr><td colspan=2><br><h2>Static Public Member Functions</h2></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="structassertion__traits.html#e0">equal</a> (const T &x, const T &y)</td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>std::string </td><td class="memItemRight" valign=bottom><a class="el" href="structassertion__traits.html#e1">toString</a> (const T &x)</td></tr></table><hr><a name="_details"></a><h2>Detailed Description</h2><h3>template<class T><br> struct assertion_traits< T ></h3>Traits used by <a class="el" href="group___assertions.html#ga3">CPPUNIT_ASSERT_EQUAL()</a>. <p>Here is an example of specialization of that traits:<p><pre><div class="fragment"> <span class="keyword">template</span><> <span class="keyword">struct </span><a class="code" href="structassertion__traits.html">assertion_traits</a><std::string> <span class="comment">// specialization for the std::string type</span> { <span class="keyword">static</span> <span class="keywordtype">bool</span> equal( <span class="keyword">const</span> std::string& x, <span class="keyword">const</span> std::string& y ) { <span class="keywordflow">return</span> x == y; } <span class="keyword">static</span> std::string toString( <span class="keyword">const</span> std::string& x ) { std::string text = <span class="charliteral">'"'</span> + x + <span class="charliteral">'"'</span>; <span class="comment">// adds quote around the string to see whitespace</span> OStringStream ost; ost << text; <span class="keywordflow">return</span> ost.str(); } };</div></pre><p><hr><h2>Member Function Documentation</h2><a class="anchor" name="e0" doxytag="assertion_traits::equal" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" colspan="4">template<class T> </td> </tr> <tr> <td class="md" nowrap valign="top"> bool <a class="el" href="structassertion__traits.html">assertion_traits</a>< T >::equal </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const T & </td> <td class="mdname" nowrap> <em>x</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td></td> <td class="md" nowrap>const T & </td> <td class="mdname" nowrap> <em>y</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"><code> [inline, static]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p> </td> </tr></table><a class="anchor" name="e1" doxytag="assertion_traits::toString" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" colspan="4">template<class T> </td> </tr> <tr> <td class="md" nowrap valign="top"> std::string <a class="el" href="structassertion__traits.html">assertion_traits</a>< T >::toString </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const T & </td> <td class="mdname1" valign="top" nowrap> <em>x</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap><code> [inline, static]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p> </td> </tr></table><hr>The documentation for this struct was generated from the following file:<ul><li><a class="el" href="_test_assert_8h-source.html">TestAssert.h</a></ul><hr><table width="100%"> <tr> <td width="10%" align="left" valign="center"> <a href="http://sourceforge.net"> <img src="http://sourceforge.net/sflogo.php?group_id=11795" width="88" height="31" border="0" alt="SourceForge Logo"></a> </td> <td width="20%" align="left" valign="center"> hosts this site. </td> <td> </td> <td align="right" valign="center"> Send comments to:<br> <a href="mailto:cppunit-devel@lists.sourceforge.net">CppUnit Developers</a> </td> </tr></table></body> </html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -