| 1 | <?xml version="1.0" encoding="utf-8" ?> |
|---|
| 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|---|
| 3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
|---|
| 4 | <!-- Copyright Aleksey Gurtovoy 2006. Distributed under the Boost --> |
|---|
| 5 | <!-- Software License, Version 1.0. (See accompanying --> |
|---|
| 6 | <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) --> |
|---|
| 7 | <head> |
|---|
| 8 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
|---|
| 9 | <meta name="generator" content="Docutils 0.3.6: http://docutils.sourceforge.net/" /> |
|---|
| 10 | <title>The MPL Reference Manual: greater</title> |
|---|
| 11 | <link rel="stylesheet" href="../style.css" type="text/css" /> |
|---|
| 12 | </head> |
|---|
| 13 | <body class="docframe refmanual"> |
|---|
| 14 | <table class="header"><tr class="header"><td class="header-group navigation-bar"><span class="navigation-group"><a href="./less-equal.html" class="navigation-link">Prev</a> <a href="./greater-equal.html" class="navigation-link">Next</a></span><span class="navigation-group-separator"> | </span><span class="navigation-group"><a href="./less-equal.html" class="navigation-link">Back</a> <a href="./greater-equal.html" class="navigation-link">Along</a></span><span class="navigation-group-separator"> | </span><span class="navigation-group"><a href="./comparisons.html" class="navigation-link">Up</a> <a href="../refmanual.html" class="navigation-link">Home</a></span><span class="navigation-group-separator"> | </span><span class="navigation-group"><a href="./refmanual_toc.html" class="navigation-link">Full TOC</a></span></td> |
|---|
| 15 | <td class="header-group page-location"><a href="../refmanual.html" class="navigation-link">Front Page</a> / <a href="./metafunctions.html" class="navigation-link">Metafunctions</a> / <a href="./comparisons.html" class="navigation-link">Comparisons</a> / <a href="./greater.html" class="navigation-link">greater</a></td> |
|---|
| 16 | </tr></table><div class="header-separator"></div> |
|---|
| 17 | <div class="section" id="greater"> |
|---|
| 18 | <h1><a class="toc-backref" href="./comparisons.html#id471" name="greater">greater</a></h1> |
|---|
| 19 | <div class="section" id="greater-synopsis"> |
|---|
| 20 | <h3><a class="subsection-title" href="#synopsis" name="synopsis">Synopsis</a></h3> |
|---|
| 21 | <pre class="literal-block"> |
|---|
| 22 | template< |
|---|
| 23 | typename T1 |
|---|
| 24 | , typename T2 |
|---|
| 25 | > |
|---|
| 26 | struct <a href="./greater.html" class="identifier">greater</a> |
|---|
| 27 | { |
|---|
| 28 | typedef <em>unspecified</em> type; |
|---|
| 29 | }; |
|---|
| 30 | </pre> |
|---|
| 31 | </div> |
|---|
| 32 | <div class="section" id="greater-description"> |
|---|
| 33 | <h3><a class="subsection-title" href="#description" name="description">Description</a></h3> |
|---|
| 34 | <p>Returns a true-valued <a class="reference" href="./integral-constant.html">Integral Constant</a> if <tt class="literal"><span class="pre">T1</span></tt> is greater than <tt class="literal"><span class="pre">T2</span></tt>.</p> |
|---|
| 35 | </div> |
|---|
| 36 | <div class="section" id="greater-header"> |
|---|
| 37 | <h3><a class="subsection-title" href="#header" name="header">Header</a></h3> |
|---|
| 38 | <pre class="literal-block"> |
|---|
| 39 | #include <<a href="../../../../boost/mpl/greater.hpp" class="header">boost/mpl/greater.hpp</a>> |
|---|
| 40 | #include <<a href="../../../../boost/mpl/comparison.hpp" class="header">boost/mpl/comparison.hpp</a>> |
|---|
| 41 | </pre> |
|---|
| 42 | </div> |
|---|
| 43 | <div class="section" id="greater-model-of"> |
|---|
| 44 | <h3><a class="subsection-title" href="#model-of" name="model-of">Model of</a></h3> |
|---|
| 45 | <p><a class="reference" href="./numeric-metafunction.html">Numeric Metafunction</a></p> |
|---|
| 46 | </div> |
|---|
| 47 | <div class="section" id="greater-parameters"> |
|---|
| 48 | <h3><a class="subsection-title" href="#parameters" name="parameters">Parameters</a></h3> |
|---|
| 49 | <table border="1" class="table"> |
|---|
| 50 | <colgroup> |
|---|
| 51 | <col width="17%" /> |
|---|
| 52 | <col width="30%" /> |
|---|
| 53 | <col width="53%" /> |
|---|
| 54 | </colgroup> |
|---|
| 55 | <thead valign="bottom"> |
|---|
| 56 | <tr><th>Parameter</th> |
|---|
| 57 | <th>Requirement</th> |
|---|
| 58 | <th>Description</th> |
|---|
| 59 | </tr> |
|---|
| 60 | </thead> |
|---|
| 61 | <tbody valign="top"> |
|---|
| 62 | <tr><td><tt class="literal"><span class="pre">T1</span></tt>, <tt class="literal"><span class="pre">T2</span></tt></td> |
|---|
| 63 | <td><a class="reference" href="./integral-constant.html">Integral Constant</a></td> |
|---|
| 64 | <td>Operation's arguments.</td> |
|---|
| 65 | </tr> |
|---|
| 66 | </tbody> |
|---|
| 67 | </table> |
|---|
| 68 | <p>[<em>Note:</em> The requirements listed in this specification |
|---|
| 69 | are the ones imposed by the default implementation. See <a class="reference" href="./numeric-metafunction.html">Numeric Metafunction</a> concept |
|---|
| 70 | for the details on how to provide an implementation for a user-defined numeric type |
|---|
| 71 | that does not satisfy the <a class="reference" href="./integral-constant.html">Integral Constant</a> requirements. — <em>end note</em>]</p> |
|---|
| 72 | </div> |
|---|
| 73 | <div class="section" id="greater-expression-semantics"> |
|---|
| 74 | <h3><a class="subsection-title" href="#expression-semantics" name="expression-semantics">Expression semantics</a></h3> |
|---|
| 75 | <p>For any <a class="reference" href="./integral-constant.html">Integral Constant</a>s <tt class="literal"><span class="pre">c1</span></tt> and <tt class="literal"><span class="pre">c2</span></tt>:</p> |
|---|
| 76 | <pre class="literal-block"> |
|---|
| 77 | typedef <a href="./greater.html" class="identifier">greater</a><c1,c2>::type r; |
|---|
| 78 | </pre> |
|---|
| 79 | <table class="field-list" frame="void" rules="none"> |
|---|
| 80 | <col class="field-name" /> |
|---|
| 81 | <col class="field-body" /> |
|---|
| 82 | <tbody valign="top"> |
|---|
| 83 | <tr class="field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference" href="./integral-constant.html">Integral Constant</a>.</td> |
|---|
| 84 | </tr> |
|---|
| 85 | <tr class="field"><th class="field-name">Semantics:</th><td class="field-body"><p class="first">Equivalent to</p> |
|---|
| 86 | <pre class="last literal-block"> |
|---|
| 87 | typedef <a href="./bool.html" class="identifier">bool_</a>< (c1::value < c2::value) > r; |
|---|
| 88 | </pre> |
|---|
| 89 | </td> |
|---|
| 90 | </tr> |
|---|
| 91 | </tbody> |
|---|
| 92 | </table> |
|---|
| 93 | <!-- .......................................................................... --> |
|---|
| 94 | <pre class="literal-block"> |
|---|
| 95 | typedef <a href="./greater.html" class="identifier">greater</a><c1,c2> r; |
|---|
| 96 | </pre> |
|---|
| 97 | <table class="field-list" frame="void" rules="none"> |
|---|
| 98 | <col class="field-name" /> |
|---|
| 99 | <col class="field-body" /> |
|---|
| 100 | <tbody valign="top"> |
|---|
| 101 | <tr class="field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference" href="./integral-constant.html">Integral Constant</a>.</td> |
|---|
| 102 | </tr> |
|---|
| 103 | <tr class="field"><th class="field-name">Semantics:</th><td class="field-body"><p class="first">Equivalent to</p> |
|---|
| 104 | <pre class="last literal-block"> |
|---|
| 105 | struct r : <a href="./greater.html" class="identifier">greater</a><c1,c2>::type {}; |
|---|
| 106 | </pre> |
|---|
| 107 | </td> |
|---|
| 108 | </tr> |
|---|
| 109 | </tbody> |
|---|
| 110 | </table> |
|---|
| 111 | </div> |
|---|
| 112 | <div class="section" id="greater-complexity"> |
|---|
| 113 | <h3><a class="subsection-title" href="#complexity" name="complexity">Complexity</a></h3> |
|---|
| 114 | <p>Amortized constant time.</p> |
|---|
| 115 | </div> |
|---|
| 116 | <div class="section" id="greater-example"> |
|---|
| 117 | <h3><a class="subsection-title" href="#example" name="example">Example</a></h3> |
|---|
| 118 | <pre class="literal-block"> |
|---|
| 119 | <a href="./assert.html" class="identifier">BOOST_MPL_ASSERT</a>(( <a href="./greater.html" class="identifier">greater</a>< <a href="./int.html" class="identifier">int_</a><10>, <a href="./int.html" class="identifier">int_</a><0> > )); |
|---|
| 120 | <a href="./assert-not.html" class="identifier">BOOST_MPL_ASSERT_NOT</a>(( <a href="./greater.html" class="identifier">greater</a>< <a href="./long.html" class="identifier">long_</a><0>, <a href="./int.html" class="identifier">int_</a><10> > )); |
|---|
| 121 | <a href="./assert-not.html" class="identifier">BOOST_MPL_ASSERT_NOT</a>(( <a href="./greater.html" class="identifier">greater</a>< <a href="./long.html" class="identifier">long_</a><10>, <a href="./int.html" class="identifier">int_</a><10> > )); |
|---|
| 122 | </pre> |
|---|
| 123 | </div> |
|---|
| 124 | <div class="section" id="greater-see-also"> |
|---|
| 125 | <h3><a class="subsection-title" href="#see-also" name="see-also">See also</a></h3> |
|---|
| 126 | <p><a class="reference" href="./comparisons.html">Comparisons</a>, <a class="reference" href="./numeric-metafunction.html">Numeric Metafunction</a>, <a class="refentry reference" href="./numeric-cast.html"><tt class="refentry literal"><span class="pre">numeric_cast</span></tt></a>, <a class="refentry reference" href="./greater-equal.html"><tt class="refentry literal"><span class="pre">greater_equal</span></tt></a>, <a class="refentry reference" href="./less.html"><tt class="refentry literal"><span class="pre">less</span></tt></a>, <a class="refentry reference" href="./equal-to.html"><tt class="refentry literal"><span class="pre">equal_to</span></tt></a></p> |
|---|
| 127 | <!-- modtime: November 10, 2004 04:40:49 +0000 --> |
|---|
| 128 | <!-- Metafunctions/Comparisons//greater_equal |40 --> |
|---|
| 129 | </div> |
|---|
| 130 | </div> |
|---|
| 131 | |
|---|
| 132 | <div class="footer-separator"></div> |
|---|
| 133 | <table class="footer"><tr class="footer"><td class="header-group navigation-bar"><span class="navigation-group"><a href="./less-equal.html" class="navigation-link">Prev</a> <a href="./greater-equal.html" class="navigation-link">Next</a></span><span class="navigation-group-separator"> | </span><span class="navigation-group"><a href="./less-equal.html" class="navigation-link">Back</a> <a href="./greater-equal.html" class="navigation-link">Along</a></span><span class="navigation-group-separator"> | </span><span class="navigation-group"><a href="./comparisons.html" class="navigation-link">Up</a> <a href="../refmanual.html" class="navigation-link">Home</a></span><span class="navigation-group-separator"> | </span><span class="navigation-group"><a href="./refmanual_toc.html" class="navigation-link">Full TOC</a></span></td> |
|---|
| 134 | </tr></table></body> |
|---|
| 135 | </html> |
|---|