Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/doc/html/visit_each.html @ 25

Last change on this file since 25 was 12, checked in by landauf, 17 years ago

added boost

File size: 5.2 KB
Line 
1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
4<title>Function template visit_each</title>
5<link rel="stylesheet" href="boostbook.css" type="text/css">
6<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
7<link rel="start" href="index.html" title="The Boost C++ Libraries">
8<link rel="up" href="signals/reference.html#id2574365" title="Header &lt;boost/visit_each.hpp&gt;">
9<link rel="prev" href="scoped_connection.html" title="Class scoped_connection">
10<link rel="next" href="last_value.html" title="Class template last_value">
11</head>
12<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13<table cellpadding="2" width="100%">
14<td valign="top"><img alt="boost.png (6897 bytes)" width="277" height="86" src="../../boost.png"></td>
15<td align="center"><a href="../../index.htm">Home</a></td>
16<td align="center"><a href="../../libs/libraries.htm">Libraries</a></td>
17<td align="center"><a href="../../people/people.htm">People</a></td>
18<td align="center"><a href="../../more/faq.htm">FAQ</a></td>
19<td align="center"><a href="../../more/index.htm">More</a></td>
20</table>
21<hr>
22<div class="spirit-nav">
23<a accesskey="p" href="scoped_connection.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="signals/reference.html#id2574365"><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="last_value.html"><img src="images/next.png" alt="Next"></a>
24</div>
25<div class="refentry" lang="en">
26<a name="visit_each"></a><div class="titlepage"></div>
27<div class="refnamediv">
28<h2><span class="refentrytitle">Function template visit_each</span></h2>
29<p>boost::visit_each &#8212; Allow limited exploration of class members.</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">
33<span class="bold"><strong>template</strong></span>&lt;<span class="bold"><strong>typename</strong></span> Visitor, <span class="bold"><strong>typename</strong></span> T&gt; 
34  <span class="type"><span class="bold"><strong>void</strong></span></span> visit_each(<span class="bold"><strong>const</strong></span> Visitor&amp; visitor, <span class="bold"><strong>const</strong></span> T&amp; t, <span class="bold"><strong>int</strong></span> );</pre></div>
35<div class="refsect1" lang="en">
36<a name="id2738194"></a><h2>Description</h2>
37<p>The <code class="computeroutput"><a href="visit_each.html" title="Function template visit_each">visit_each</a></code> mechanism
38        allows a visitor to be applied to every subobject in a given
39        object. It is used by the Signals library to discover
40        <code class="computeroutput"><a href="trackable.html" title="Class trackable">signals::trackable</a></code> objects within a
41        function object, but other uses may surface if used
42        universally (e.g., conservative garbage collection). To fit
43        within the <code class="computeroutput"><a href="visit_each.html" title="Function template visit_each">visit_each</a></code> framework,
44        a <code class="computeroutput"><a href="visit_each.html" title="Function template visit_each">visit_each</a></code> overload must be
45        supplied for each object type. </p>
46<p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Effects</span></b>:
47
48    <code class="computeroutput">visitor(t)</code>, and for
49      every subobject <code class="computeroutput">x</code> of
50      <code class="computeroutput">t</code>:
51        <div class="itemizedlist"><ul type="disc">
52<li><p>If <code class="computeroutput">x</code> is a reference, <code class="computeroutput">visit_each(visitor, <a href="reference_wrapper.html#id2366489">ref</a>(x), 0)</code></p></li>
53<li><p>Otherwise, <code class="computeroutput">visit_each(visitor, x, 0)</code></p></li>
54</ul></div><br><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Notes</span></b>:
55
56    The third parameter is
57      <code class="computeroutput">long</code> for the fallback version
58      of <a href="visit_each.html" title="Function template visit_each">visit_each</a> and the argument
59      supplied to this third paramter must always be 0. The third
60      parameter is an artifact of the widespread lack of proper
61      function template ordering, and will be removed in the future.<p>Library authors will be expected to add additional
62      overloads that specialize the T argument for their classes, so
63      that subobjects can be visited.</p><p>Calls to visit_each are required to be unqualified, to
64      enable argument-dependent lookup.</p></p>
65</div>
66</div>
67<table width="100%"><tr>
68<td align="left"></td>
69<td align="right"><small>Copyright © 2001-2004 Douglas Gregor</small></td>
70</tr></table>
71<hr>
72<div class="spirit-nav">
73<a accesskey="p" href="scoped_connection.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="signals/reference.html#id2574365"><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="last_value.html"><img src="images/next.png" alt="Next"></a>
74</div>
75</body>
76</html>
Note: See TracBrowser for help on using the repository browser.