• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4<title>Function template float_mem_cast</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="Boost.Sort">
8<link rel="up" href="../../../boost_sort_c___reference.html#header.boost.sort.spreadsort.float_sort_hpp" title="Header &lt;boost/sort/spreadsort/float_sort.hpp&gt;">
9<link rel="prev" href="../../../boost_sort_c___reference.html" title="Boost.Sort C++ Reference">
10<link rel="next" href="float_so_idm45878545215024.html" title="Function template float_sort">
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="../../../boost_sort_c___reference.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../boost_sort_c___reference.html#header.boost.sort.spreadsort.float_sort_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="float_so_idm45878545215024.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
24</div>
25<div class="refentry">
26<a name="boost.sort.spreadsort.float_mem_cast"></a><div class="titlepage"></div>
27<div class="refnamediv">
28<h2><span class="refentrytitle">Function template float_mem_cast</span></h2>
29<p>boost::sort::spreadsort::float_mem_cast — Casts a float to the specified integer type. </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="../../../boost_sort_c___reference.html#header.boost.sort.spreadsort.float_sort_hpp" title="Header &lt;boost/sort/spreadsort/float_sort.hpp&gt;">boost/sort/spreadsort/float_sort.hpp</a>&gt;
33
34</span>
35<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Data_type<span class="special">,</span> <span class="keyword">typename</span> Cast_type<span class="special">&gt;</span>
36  <span class="identifier">Cast_type</span> <span class="identifier">float_mem_cast</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">Data_type</span> <span class="special">&amp;</span> data<span class="special">)</span><span class="special">;</span></pre></div>
37<div class="refsect1">
38<a name="idm45477845723120"></a><h2>Description</h2>
39<p>
40</p>
41<p><b>Example: </b></p>
42<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">rightshift</span> <span class="special">{</span>
43  <span class="keyword">int</span> <span class="keyword">operator</span><span class="special">(</span><span class="special">)</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">DATA_TYPE</span> <span class="special">&amp;</span><span class="identifier">x</span><span class="special">,</span> <span class="keyword">const</span> <span class="keyword">unsigned</span> <span class="identifier">offset</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">{</span>
44    <span class="keyword">return</span> <span class="identifier">float_mem_cast</span><span class="special">&lt;</span><span class="identifier">KEY_TYPE</span><span class="special">,</span> <span class="identifier">CAST_TYPE</span><span class="special">&gt;</span><span class="special">(</span><span class="identifier">x</span><span class="special">.</span><span class="identifier">key</span><span class="special">)</span> <span class="special">&gt;&gt;</span> <span class="identifier">offset</span><span class="special">;</span>
45  <span class="special">}</span>
46<span class="special">}</span><span class="special">;</span>
47</pre>
48<p> </p>
49<p>
50</p>
51<div class="variablelist"><table border="0" class="variablelist compact">
52<colgroup>
53<col align="left" valign="top">
54<col>
55</colgroup>
56<tbody><tr>
57<td><p><span class="term">Template Parameters:</span></p></td>
58<td><div class="variablelist"><table border="0" class="variablelist compact">
59<colgroup>
60<col align="left" valign="top">
61<col>
62</colgroup>
63<tbody>
64<tr>
65<td><p><span class="term"><code class="computeroutput">Cast_type</code></span></p></td>
66<td><p>Integer type (same size) to which to cast.</p></td>
67</tr>
68<tr>
69<td><p><span class="term"><code class="computeroutput">Data_type</code></span></p></td>
70<td><p>Floating-point IEEE 754/IEC559 type. </p></td>
71</tr>
72</tbody>
73</table></div></td>
74</tr></tbody>
75</table></div>
76</div>
77</div>
78<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
79<td align="left"></td>
80<td align="right"><div class="copyright-footer">Copyright © 2014-2017 Steven
81      Ross, Francisco Tapia, Orson Peters<p>
82        Distributed under the <a href="http://boost.org/LICENSE_1_0.txt" target="_top">Boost
83        Software License, Version 1.0</a>.
84      </p>
85</div></td>
86</tr></table>
87<hr>
88<div class="spirit-nav">
89<a accesskey="p" href="../../../boost_sort_c___reference.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../boost_sort_c___reference.html#header.boost.sort.spreadsort.float_sort_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="float_so_idm45878545215024.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
90</div>
91</body>
92</html>
93