| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- <title>Reference</title>
- <link rel="stylesheet" href="../boostbook.css" type="text/css">
- <meta name="generator" content="DocBook XSL Stylesheets V1.68.1">
- <link rel="start" href="../index.html" title="The Boost C++ Libraries">
- <link rel="up" href="../any.html" title="Chapter 1. Boost.Any">
- <link rel="prev" href="s02.html" title="Examples">
- <link rel="next" href="../bad_any_cast.html" title="Class bad_any_cast">
- </head>
- <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
- <table cellpadding="2" width="100%">
- <td valign="top"><img alt="boost.png (6897 bytes)" width="277" height="86" src="../../../boost.png"></td>
- <td align="center"><a href="../../../index.htm">Home</a></td>
- <td align="center"><a href="../../../libs/libraries.htm">Libraries</a></td>
- <td align="center"><a href="../../../people/people.htm">People</a></td>
- <td align="center"><a href="../../../more/faq.htm">FAQ</a></td>
- <td align="center"><a href="../../../more/index.htm">More</a></td>
- </table>
- <hr>
- <div class="spirit-nav">
- <a accesskey="p" href="s02.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../any.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../bad_any_cast.html"><img src="../images/next.png" alt="Next"></a>
- </div>
- <div class="section" lang="en">
- <div class="titlepage"><div><div><h3 class="title">
- <a name="any.reference"></a>Reference</h3></div></div></div>
- <div class="toc"><dl>
- <dt><span class="section"><a href="reference.html#any.ValueType"><span class="emphasis"><em>ValueType</em></span> requirements</a></span></dt>
- <dt><span class="section"><a href="reference.html#header.boost.any.hpp">Header <boost/any.hpp></a></span></dt>
- </dl></div>
- <div class="section" lang="en">
- <div class="titlepage"><div><div><h4 class="title">
- <a name="any.ValueType"></a><span class="emphasis"><em>ValueType</em></span> requirements</h4></div></div></div>
- <p>Values are strongly informational objects for which
- identity is not significant, i.e. the focus is principally on
- their state content and any behavior organized around
- that. Another distinguishing feature of values is their
- granularity: normally fine-grained objects representing simple
- concepts in the system such as quantities.</p>
- <p>As the emphasis of a value lies in its state not its
- identity, values can be copied and typically assigned one to
- another, requiring the explicit or implicit definition of a
- public copy constructor and public assignment operator. Values
- typically live within other scopes, i.e. within objects or
- blocks, rather than on the heap. Values are therefore normally
- passed around and manipulated directly as variables or through
- references, but not as pointers that emphasize identity and
- indirection.</p>
- <p>The specific requirements on value types to be used in an
- <code class="computeroutput"><a href="../boost/any.html" title="Class any">any</a></code>
- are:</p>
- <div class="itemizedlist"><ul type="disc" compact>
- <li>A <span class="emphasis"><em>ValueType</em></span> is
- <span class="emphasis"><em>CopyConstructible</em></span> [20.1.3].</li>
- <li>A <span class="emphasis"><em>ValueType</em></span> is
- optionally <span class="emphasis"><em>Assignable</em></span> [23.1]. The strong
- exception-safety guarantee is required for all forms of
- assignment.</li>
- <li>The destructor for a
- <span class="emphasis"><em>ValueType</em></span> upholds the no-throw
- exception-safety guarantee.</li>
- </ul></div>
- </div>
- <div class="section" lang="en">
- <div class="titlepage"><div><div><h4 class="title">
- <a name="header.boost.any.hpp"></a>Header <<a href="../../../boost/any.hpp" target="_top">boost/any.hpp</a>></h4></div></div></div>
- <pre class="synopsis"><span class="bold"><strong>namespace</strong></span> boost {
- <span class="bold"><strong>class</strong></span> <a href="../bad_any_cast.html" title="Class bad_any_cast">bad_any_cast</a>;
- <span class="bold"><strong>class</strong></span> <a href="../boost/any.html" title="Class any">any</a>;
- <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> ValueType> <span class="type">ValueType</span> <a href="../any_cast.html" title="Function any_cast">any_cast</a>(<span class="bold"><strong>const</strong></span> <a href="../boost/any.html" title="Class any">any</a> &);
- <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> ValueType> <span class="type"><span class="bold"><strong>const</strong></span> ValueType *</span> <a href="../any_cast.html" title="Function any_cast">any_cast</a>(<span class="bold"><strong>const</strong></span> <a href="../boost/any.html" title="Class any">any</a> *);
- <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> ValueType> <span class="type">ValueType *</span> <a href="../any_cast.html" title="Function any_cast">any_cast</a>(<a href="../boost/any.html" title="Class any">any</a> *);
- }</pre>
- </div>
- </div>
- <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
- <td align="left"></td>
- <td align="right"><small>Copyright © 2001 Kevlin Henney</small></td>
- </tr></table>
- <hr>
- <div class="spirit-nav">
- <a accesskey="p" href="s02.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../any.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../bad_any_cast.html"><img src="../images/next.png" alt="Next"></a>
- </div>
- </body>
- </html>
|