Imported Upstream version 1.71.0
[platform/upstream/boost.git] / libs / contract / doc / html / boost / contract / call_if__idm45123870948032.html
1 <html>
2 <head>
3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>Struct template call_if_statement&lt;false, Then, internal_type&gt;</title>
5 <link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
6 <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7 <link rel="home" href="../../index.html" title="Chapter&#160;1.&#160;Boost.Contract 1.0.0">
8 <link rel="up" href="../../reference.html#header.boost.contract.call_if_hpp" title="Header &lt;boost/contract/call_if.hpp&gt;">
9 <link rel="prev" href="call_if_statement.html" title="Struct template call_if_statement">
10 <link rel="next" href="call_if__idm45123870909024.html" title="Struct template call_if_statement&lt;true, Then, internal_type&gt;">
11 </head>
12 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13 <table cellpadding="2" width="100%"><tr>
14 <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
15 <td align="center"><a href="../../../../../../index.html">Home</a></td>
16 <td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
17 <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
18 <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
19 <td align="center"><a href="../../../../../../more/index.htm">More</a></td>
20 </tr></table>
21 <hr>
22 <div class="spirit-nav">
23 <a accesskey="p" href="call_if_statement.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../reference.html#header.boost.contract.call_if_hpp"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="call_if__idm45123870909024.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
24 </div>
25 <div class="refentry">
26 <a name="boost.contract.call_if__idm45123870948032"></a><div class="titlepage"></div>
27 <div class="refnamediv">
28 <h2><span class="refentrytitle">Struct template call_if_statement&lt;false, Then, internal_type&gt;</span></h2>
29 <p>boost::contract::call_if_statement&lt;false, Then, internal_type&gt; &#8212; Template specialization to handle static predicates that are <code class="computeroutput">false</code>. </p>
30 </div>
31 <h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
32 <div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../reference.html#header.boost.contract.call_if_hpp" title="Header &lt;boost/contract/call_if.hpp&gt;">boost/contract/call_if.hpp</a>&gt;
33
34 </span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Then<span class="special">&gt;</span> 
35 <span class="keyword">struct</span> <a class="link" href="call_if__idm45123870948032.html" title="Struct template call_if_statement&lt;false, Then, internal_type&gt;">call_if_statement</a><span class="special">&lt;</span><span class="keyword">false</span><span class="special">,</span> <span class="identifier">Then</span><span class="special">,</span> <span class="identifier">internal_type</span><span class="special">&gt;</span> <span class="special">{</span>
36   <span class="comment">// <a class="link" href="call_if__idm45123870948032.html#boost.contract.call_if__idm45123870948032construct-copy-destruct">construct/copy/destruct</a></span>
37   <span class="keyword">explicit</span> <a class="link" href="call_if__idm45123870948032.html#idm45123870913056-bb"><span class="identifier">call_if_statement</span></a><span class="special">(</span><span class="identifier">Then</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
38
39   <span class="comment">// <a class="link" href="call_if__idm45123870948032.html#idm45123870939664-bb">public member functions</a></span>
40   <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Else<span class="special">&gt;</span> <span class="identifier">result_of</span><span class="special">&lt;</span> <span class="identifier">Else</span><span class="special">(</span><span class="special">)</span><span class="special">&gt;</span><span class="special">::</span><span class="identifier">type</span> <a class="link" href="call_if__idm45123870948032.html#idm45123870939104-bb"><span class="identifier">else_</span></a><span class="special">(</span><span class="identifier">Else</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
41   <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">bool</span> ElseIfPred<span class="special">,</span> <span class="keyword">typename</span> ElseIfThen<span class="special">&gt;</span> 
42     <a class="link" href="call_if_statement.html" title="Struct template call_if_statement">call_if_statement</a><span class="special">&lt;</span> <span class="identifier">ElseIfPred</span><span class="special">,</span> <span class="identifier">ElseIfThen</span> <span class="special">&gt;</span> <a class="link" href="call_if__idm45123870948032.html#idm45123870930448-bb"><span class="identifier">else_if_c</span></a><span class="special">(</span><span class="identifier">ElseIfThen</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
43   <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> ElseIfPred<span class="special">,</span> <span class="keyword">typename</span> ElseIfThen<span class="special">&gt;</span> 
44     <a class="link" href="call_if_statement.html" title="Struct template call_if_statement">call_if_statement</a><span class="special">&lt;</span> <span class="identifier">ElseIfPred</span><span class="special">::</span><span class="identifier">value</span><span class="special">,</span> <span class="identifier">ElseIfThen</span> <span class="special">&gt;</span> 
45     <a class="link" href="call_if__idm45123870948032.html#idm45123870921696-bb"><span class="identifier">else_if</span></a><span class="special">(</span><span class="identifier">ElseIfThen</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
46 <span class="special">}</span><span class="special">;</span></pre></div>
47 <div class="refsect1">
48 <a name="idm45751731622032"></a><h2>Description</h2>
49 <p>This template specialization handles all else-branch functor template calls (whether they return void or not). Usually this class template is instantiated only via the return value of  <code class="computeroutput"><a class="link" href="call_if.html" title="Function template call_if">boost::contract::call_if</a></code> and <code class="computeroutput"><a class="link" href="call_if_c.html" title="Function template call_if_c">boost::contract::call_if_c</a></code>.</p>
50 <p><span class="bold"><strong>See Also:</strong></span></p>
51 <p> <a class="link" href="../../boost_contract/extras.html#boost_contract.extras.assertion_requirements__templates_" title="Assertion Requirements (Templates)">
52         Assertion Requirements</a></p>
53 <p>
54 </p>
55 <p>
56
57 </p>
58 <div class="refsect2">
59 <a name="idm45751731616544"></a><h3>Template Parameters</h3>
60 <div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
61 <pre class="literallayout"><span class="keyword">typename</span> Then</pre>
62 <p>Type of functor template to call when the static predicate is <code class="computeroutput">true</code> (never the case for this template specialization). </p>
63 </li></ol></div>
64 </div>
65 <div class="refsect2">
66 <a name="idm45751731612672"></a><h3>
67 <a name="boost.contract.call_if__idm45123870948032construct-copy-destruct"></a><code class="computeroutput">call_if_statement</code> 
68         public
69        construct/copy/destruct</h3>
70 <div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
71 <pre class="literallayout"><span class="keyword">explicit</span> <a name="idm45123870913056-bb"></a><span class="identifier">call_if_statement</span><span class="special">(</span><span class="identifier">Then</span> <span class="keyword">const</span> <span class="special">&amp;</span> f<span class="special">)</span><span class="special">;</span></pre>Construct this object with the then-branch functor template. <p>
72 </p>
73 <div class="variablelist"><table border="0" class="variablelist compact">
74 <colgroup>
75 <col align="left" valign="top">
76 <col>
77 </colgroup>
78 <tbody><tr>
79 <td><p><span class="term">Parameters:</span></p></td>
80 <td><div class="variablelist"><table border="0" class="variablelist compact">
81 <colgroup>
82 <col align="left" valign="top">
83 <col>
84 </colgroup>
85 <tbody><tr>
86 <td><p><span class="term"><code class="computeroutput">f</code></span></p></td>
87 <td><p>Then-branch nullary functor template. The functor template call <code class="computeroutput">f()</code> is never compiled and executed for this template specialization (because the if-statement static predicate is <code class="computeroutput">false</code>). The return type of <code class="computeroutput">f()</code> must be the same as (or implicitly convertible to) the return type of all other functor template calls specified for this call-if object. </p></td>
88 </tr></tbody>
89 </table></div></td>
90 </tr></tbody>
91 </table></div>
92 </li></ol></div>
93 </div>
94 <div class="refsect2">
95 <a name="idm45751731598176"></a><h3>
96 <a name="idm45123870939664-bb"></a><code class="computeroutput">call_if_statement</code> public member functions</h3>
97 <div class="orderedlist"><ol class="orderedlist" type="1">
98 <li class="listitem">
99 <pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Else<span class="special">&gt;</span> <span class="identifier">result_of</span><span class="special">&lt;</span> <span class="identifier">Else</span><span class="special">(</span><span class="special">)</span><span class="special">&gt;</span><span class="special">::</span><span class="identifier">type</span> <a name="idm45123870939104-bb"></a><span class="identifier">else_</span><span class="special">(</span><span class="identifier">Else</span> f<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Specify the else-branch functor template. <div class="note"><table border="0" summary="Note">
100 <tr>
101 <td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../../../doc/src/images/note.png"></td>
102 <th align="left">Note</th>
103 </tr>
104 <tr><td align="left" valign="top"><p>The <code class="computeroutput">result_of&lt;Else()&gt;::type</code> expression should be evaluated only when the static predicate is already checked to be <code class="computeroutput">false</code> (because <code class="computeroutput">Else()</code> is required to compile only in that case). Thus, this result-of expression is evaluated lazily only in instantiations of this template specialization.</p></td></tr>
105 </table></div>
106 <p>
107
108
109 </p>
110 <div class="variablelist"><table border="0" class="variablelist compact">
111 <colgroup>
112 <col align="left" valign="top">
113 <col>
114 </colgroup>
115 <tbody>
116 <tr>
117 <td><p><span class="term">Parameters:</span></p></td>
118 <td><div class="variablelist"><table border="0" class="variablelist compact">
119 <colgroup>
120 <col align="left" valign="top">
121 <col>
122 </colgroup>
123 <tbody><tr>
124 <td><p><span class="term"><code class="computeroutput">f</code></span></p></td>
125 <td><p>Else-branch nullary functor template. The functor template call <code class="computeroutput">f()</code> is actually compiled and executed for this template specialization (because the if-statement static predicate is <code class="computeroutput">false</code>). The return type of <code class="computeroutput">f()</code> must be the same as (or implicitly convertible to) the return type of all other functor template calls specified for this call-if object.</p></td>
126 </tr></tbody>
127 </table></div></td>
128 </tr>
129 <tr>
130 <td><p><span class="term">Returns:</span></p></td>
131 <td><p>A copy of the value returned by the call to the else-branch functor template <code class="computeroutput">f()</code>. </p></td>
132 </tr>
133 </tbody>
134 </table></div>
135 </li>
136 <li class="listitem">
137 <pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">bool</span> ElseIfPred<span class="special">,</span> <span class="keyword">typename</span> ElseIfThen<span class="special">&gt;</span> 
138   <a class="link" href="call_if_statement.html" title="Struct template call_if_statement">call_if_statement</a><span class="special">&lt;</span> <span class="identifier">ElseIfPred</span><span class="special">,</span> <span class="identifier">ElseIfThen</span> <span class="special">&gt;</span> <a name="idm45123870930448-bb"></a><span class="identifier">else_if_c</span><span class="special">(</span><span class="identifier">ElseIfThen</span> f<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Specify an else-if-branch functor template (using a static boolean predicate). <p>
139
140
141 </p>
142 <div class="variablelist"><table border="0" class="variablelist compact">
143 <colgroup>
144 <col align="left" valign="top">
145 <col>
146 </colgroup>
147 <tbody>
148 <tr>
149 <td><p><span class="term">Parameters:</span></p></td>
150 <td><div class="variablelist"><table border="0" class="variablelist compact">
151 <colgroup>
152 <col align="left" valign="top">
153 <col>
154 </colgroup>
155 <tbody><tr>
156 <td><p><span class="term"><code class="computeroutput">f</code></span></p></td>
157 <td><p>Else-if-branch nullary functor template. The functor template call <code class="computeroutput">f()</code> is actually compiled and executed if and only if <code class="computeroutput">ElseIfPred</code> is <code class="computeroutput">true</code> (because the if-statement static predicate is already <code class="computeroutput">false</code> for this template specialization). The return type of <code class="computeroutput">f()</code> must be the same as (or implicitly convertible to) the return type of all other functor template calls specified for this call-if object.</p></td>
158 </tr></tbody>
159 </table></div></td>
160 </tr>
161 <tr>
162 <td><p><span class="term">Template Parameters:</span></p></td>
163 <td><div class="variablelist"><table border="0" class="variablelist compact">
164 <colgroup>
165 <col align="left" valign="top">
166 <col>
167 </colgroup>
168 <tbody><tr>
169 <td><p><span class="term"><code class="computeroutput">ElseIfPred</code></span></p></td>
170 <td><p>Static boolean predicate selecting which functor template call to compile and execute.</p></td>
171 </tr></tbody>
172 </table></div></td>
173 </tr>
174 <tr>
175 <td><p><span class="term">Returns:</span></p></td>
176 <td><p>A call-if statement so the else statement and additional else-if statements can be specified if needed. Eventually, this will be the return value of the functor template call being compiled and executed. </p></td>
177 </tr>
178 </tbody>
179 </table></div>
180 </li>
181 <li class="listitem">
182 <pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> ElseIfPred<span class="special">,</span> <span class="keyword">typename</span> ElseIfThen<span class="special">&gt;</span> 
183   <a class="link" href="call_if_statement.html" title="Struct template call_if_statement">call_if_statement</a><span class="special">&lt;</span> <span class="identifier">ElseIfPred</span><span class="special">::</span><span class="identifier">value</span><span class="special">,</span> <span class="identifier">ElseIfThen</span> <span class="special">&gt;</span> 
184   <a name="idm45123870921696-bb"></a><span class="identifier">else_if</span><span class="special">(</span><span class="identifier">ElseIfThen</span> f<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Specify an else-if-branch functor template (using a nullary boolen meta-function). <p>
185
186
187 </p>
188 <div class="variablelist"><table border="0" class="variablelist compact">
189 <colgroup>
190 <col align="left" valign="top">
191 <col>
192 </colgroup>
193 <tbody>
194 <tr>
195 <td><p><span class="term">Parameters:</span></p></td>
196 <td><div class="variablelist"><table border="0" class="variablelist compact">
197 <colgroup>
198 <col align="left" valign="top">
199 <col>
200 </colgroup>
201 <tbody><tr>
202 <td><p><span class="term"><code class="computeroutput">f</code></span></p></td>
203 <td><p>Else-if-branch nullary functor template. The functor template call <code class="computeroutput">f()</code> is actually compiled and executed if and only if <code class="computeroutput">ElseIfPred::value</code> is <code class="computeroutput">true</code> (because the if-statement static predicate is already <code class="computeroutput">false</code> for this template specialization). The return type of <code class="computeroutput">f()</code> must be the same as (or implicitly convertible to) the return type of all other functor template calls specified for this call-if object.</p></td>
204 </tr></tbody>
205 </table></div></td>
206 </tr>
207 <tr>
208 <td><p><span class="term">Template Parameters:</span></p></td>
209 <td><div class="variablelist"><table border="0" class="variablelist compact">
210 <colgroup>
211 <col align="left" valign="top">
212 <col>
213 </colgroup>
214 <tbody><tr>
215 <td><p><span class="term"><code class="computeroutput">ElseIfPred</code></span></p></td>
216 <td><p>Nullary boolean meta-function selecting which functor template call to compile and execute.</p></td>
217 </tr></tbody>
218 </table></div></td>
219 </tr>
220 <tr>
221 <td><p><span class="term">Returns:</span></p></td>
222 <td><p>A call-if statement so the else statement and additional else-if statements can be specified if needed. Eventually, this will be the return value of the functor template call being compiled and executed. </p></td>
223 </tr>
224 </tbody>
225 </table></div>
226 </li>
227 </ol></div>
228 </div>
229 </div>
230 </div>
231 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
232 <td align="left"></td>
233 <td align="right"><div class="copyright-footer">Copyright &#169; 2008-2018 Lorenzo Caminiti<p>
234         Distributed under the Boost Software License, Version 1.0 (see accompanying
235         file LICENSE_1_0.txt or a copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
236       </p>
237 </div></td>
238 </tr></table>
239 <hr>
240 <div class="spirit-nav">
241 <a accesskey="p" href="call_if_statement.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../reference.html#header.boost.contract.call_if_hpp"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="call_if__idm45123870909024.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
242 </div>
243 </body>
244 </html>