]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/math/doc/html/math_toolkit/fp_facets/rationale.html
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / math / doc / html / math_toolkit / fp_facets / rationale.html
1 <html>
2 <head>
3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>Design Rationale</title>
5 <link rel="stylesheet" href="../../math.css" type="text/css">
6 <meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
7 <link rel="home" href="../../index.html" title="Math Toolkit 2.5.1">
8 <link rel="up" href="../fp_facets.html" title="Facets for Floating-Point Infinities and NaNs">
9 <link rel="prev" href="portability.html" title="Portability">
10 <link rel="next" href="../next_float.html" title="Floating-Point Representation Distance (ULP), and Finding Adjacent Floating-Point Values">
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="portability.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../fp_facets.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="../next_float.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
24 </div>
25 <div class="section">
26 <div class="titlepage"><div><div><h3 class="title">
27 <a name="math_toolkit.fp_facets.rationale"></a><a class="link" href="rationale.html" title="Design Rationale">Design Rationale</a>
28 </h3></div></div></div>
29 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
30 <li class="listitem">
31 The flags are implemented as a const data member of the facet. Facets
32 are reference counted, and locales can share facets. Therefore changing
33 the flags of a facet would have effects that are hard to predict. An
34 alternative design would be to implement the flags using <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">xalloc</span></code> and <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">iword</span></code>.
35 Then one could safely modify the flags, and one could define manipulators
36 that do so. However, for that to work with dynamically linked libraries,
37 a <code class="computeroutput"><span class="special">.</span><span class="identifier">cpp</span></code>
38 file would have to be added to the library. It was judged be more desirable
39 to have a header-only library, than to have mutable flags and manipulators.
40 </li>
41 <li class="listitem">
42 The facet <code class="computeroutput"><span class="identifier">nonfinite_num_put</span></code>
43 throws an exception when the <code class="computeroutput"><span class="identifier">trap_infinity</span></code>
44 or <code class="computeroutput"><span class="identifier">trap_nan</span></code> flag is set
45 and an attempt is made to format infinity or NaN. It would be better
46 if the facet set the <code class="computeroutput"><span class="identifier">fail</span> <span class="identifier">bit</span></code> of the stream. However, facets
47 derived from <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">num_put</span></code> do not have access to the stream
48 state.
49 </li>
50 </ul></div>
51 </div>
52 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
53 <td align="left"></td>
54 <td align="right"><div class="copyright-footer">Copyright &#169; 2006-2010, 2012-2014 Nikhar Agrawal,
55 Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert
56 Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan R&#229;de, Gautam Sewani,
57 Benjamin Sobotta, Thijs van den Berg, Daryle Walker and Xiaogang Zhang<p>
58 Distributed under the Boost Software License, Version 1.0. (See accompanying
59 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>)
60 </p>
61 </div></td>
62 </tr></table>
63 <hr>
64 <div class="spirit-nav">
65 <a accesskey="p" href="portability.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../fp_facets.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="../next_float.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
66 </div>
67 </body>
68 </html>