Imported Upstream version 1.71.0
[platform/upstream/boost.git] / libs / algorithm / doc / html / boost / algorithm / clamp_idm45056135722912.html
1 <html>
2 <head>
3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>Function template clamp</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="The Boost Algorithm Library">
8 <link rel="up" href="../../header/boost/algorithm/clamp_hpp.html" title="Header &lt;boost/algorithm/clamp.hpp&gt;">
9 <link rel="prev" href="clamp_idm45056135730736.html" title="Function template clamp">
10 <link rel="next" href="clamp_ra_idm45056135710784.html" title="Function template clamp_range">
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="clamp_idm45056135730736.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../header/boost/algorithm/clamp_hpp.html"><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="clamp_ra_idm45056135710784.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
24 </div>
25 <div class="refentry">
26 <a name="boost.algorithm.clamp_idm45056135722912"></a><div class="titlepage"></div>
27 <div class="refnamediv">
28 <h2><span class="refentrytitle">Function template clamp</span></h2>
29 <p>boost::algorithm::clamp</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="../../header/boost/algorithm/clamp_hpp.html" title="Header &lt;boost/algorithm/clamp.hpp&gt;">boost/algorithm/clamp.hpp</a>&gt;
33
34 </span>
35 <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span> 
36   <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">T</span> <span class="keyword">const</span>  <span class="special">&amp;</span> 
37   <span class="identifier">clamp</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span> <span class="special">&amp;</span> val<span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">mpl</span><span class="special">::</span><span class="identifier">identity</span><span class="special">&lt;</span> <span class="identifier">T</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">type</span> <span class="keyword">const</span> <span class="special">&amp;</span> lo<span class="special">,</span> 
38         <span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">mpl</span><span class="special">::</span><span class="identifier">identity</span><span class="special">&lt;</span> <span class="identifier">T</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">type</span> <span class="keyword">const</span> <span class="special">&amp;</span> hi<span class="special">)</span><span class="special">;</span></pre></div>
39 <div class="refsect1">
40 <a name="idm45150197690560"></a><h2>Description</h2>
41 <p>
42
43 </p>
44 <div class="variablelist"><table border="0" class="variablelist compact">
45 <colgroup>
46 <col align="left" valign="top">
47 <col>
48 </colgroup>
49 <tbody>
50 <tr>
51 <td><p><span class="term">Parameters:</span></p></td>
52 <td><div class="variablelist"><table border="0" class="variablelist compact">
53 <colgroup>
54 <col align="left" valign="top">
55 <col>
56 </colgroup>
57 <tbody>
58 <tr>
59 <td><p><span class="term"><code class="computeroutput">hi</code></span></p></td>
60 <td><p>The upper bound of the range to be clamped to </p></td>
61 </tr>
62 <tr>
63 <td><p><span class="term"><code class="computeroutput">lo</code></span></p></td>
64 <td><p>The lower bound of the range to be clamped to </p></td>
65 </tr>
66 <tr>
67 <td><p><span class="term"><code class="computeroutput">val</code></span></p></td>
68 <td><p>The value to be clamped </p></td>
69 </tr>
70 </tbody>
71 </table></div></td>
72 </tr>
73 <tr>
74 <td><p><span class="term">Returns:</span></p></td>
75 <td><p>the value "val" brought into the range [ lo, hi ]. If the value is less than lo, return lo. If the value is greater than "hi", return hi. Otherwise, return the original value.</p></td>
76 </tr>
77 </tbody>
78 </table></div>
79 </div>
80 </div>
81 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
82 <td align="left"></td>
83 <td align="right"><div class="copyright-footer">Copyright &#169; 2010-2012 Marshall Clow<p>
84         Distributed under the Boost Software License, Version 1.0. (See accompanying
85         file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
86       </p>
87 </div></td>
88 </tr></table>
89 <hr>
90 <div class="spirit-nav">
91 <a accesskey="p" href="clamp_idm45056135730736.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../header/boost/algorithm/clamp_hpp.html"><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="clamp_ra_idm45056135710784.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
92 </div>
93 </body>
94 </html>