3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>Struct data_type</title>
5 <link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
6 <meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
7 <link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
8 <link rel="up" href="../../proto/reference.html#header.boost.proto.transform.env_hpp" title="Header <boost/proto/transform/env.hpp>">
9 <link rel="prev" href="is_env.html" title="Struct template is_env">
10 <link rel="next" href="data.html" title="Global data">
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>
22 <div class="spirit-nav">
23 <a accesskey="p" href="is_env.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../proto/reference.html#header.boost.proto.transform.env_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="data.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
25 <div class="refentry">
26 <a name="boost.proto.data_type"></a><div class="titlepage"></div>
27 <div class="refnamediv">
28 <h2><span class="refentrytitle">Struct data_type</span></h2>
29 <p>boost::proto::data_type —
30 The type of <code class="computeroutput"><a class="link" href="data.html" title="Global data">proto::data</a></code>, a key for use when creating
31 a transform environment that associates a piece of data with this type.
34 <h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
35 <div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: <<a class="link" href="../../proto/reference.html#header.boost.proto.transform.env_hpp" title="Header <boost/proto/transform/env.hpp>">boost/proto/transform/env.hpp</a>>
38 <span class="keyword">struct</span> <a class="link" href="data_type.html" title="Struct data_type">data_type</a> <span class="special">{</span>
40 <span class="comment">// <a class="link" href="data_type.html#idp206882624-bb">public member functions</a></span>
41 <span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> Value<span class="special">></span> <a class="link" href="env.html" title="Struct template env">env</a><span class="special"><</span><span class="identifier">data_type</span><span class="special">,</span> <em class="replaceable"><code><span class="identifier">see</span><span class="special">-</span><span class="identifier">below</span></code></em><span class="special">></span> <a class="link" href="data_type.html#idp206883744-bb"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span><span class="identifier">Value</span> <span class="special">&</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
42 <span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> Value<span class="special">></span>
43 <a class="link" href="env.html" title="Struct template env">env</a><span class="special"><</span><span class="identifier">data_type</span><span class="special">,</span> <em class="replaceable"><code><span class="identifier">see</span><span class="special">-</span><span class="identifier">below</span></code></em><span class="special">></span> <a class="link" href="data_type.html#idp206887824-bb"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span><span class="identifier">Value</span> <span class="keyword">const</span> <span class="special">&</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
44 <span class="special">}</span><span class="special">;</span></pre></div>
45 <div class="refsect1">
46 <a name="idp388796400"></a><h2>Description</h2>
48 The <code class="computeroutput">proto::data_type</code> type, along with the <code class="computeroutput"><a class="link" href="data.html" title="Global data">proto::data</a></code>
49 global, are declared using the <code class="computeroutput"><a class="link" href="../../BOOST_PROTO_DEFINE_ENV_VAR.html" title="Macro BOOST_PROTO_DEFINE_ENV_VAR">BOOST_PROTO_DEFINE_ENV_VAR</a>()</code> macro.
51 <div class="refsect2">
52 <a name="idp388800752"></a><h3>
53 <a name="idp206882624-bb"></a><code class="computeroutput">data_type</code> public member functions</h3>
54 <div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
55 <pre class="literallayout"><a name="idp206883184-bb"></a><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> Value<span class="special">></span>
56 <a class="link" href="env.html" title="Struct template env">env</a><span class="special"><</span><span class="identifier">data_type</span><span class="special">,</span> <em class="replaceable"><code><span class="identifier">see</span><span class="special">-</span><span class="identifier">below</span></code></em><span class="special">></span> <a name="idp206883744-bb"></a><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span><span class="identifier">Value</span> <span class="special">&</span> value<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
57 <span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> Value<span class="special">></span>
58 <a class="link" href="env.html" title="Struct template env">env</a><span class="special"><</span><span class="identifier">data_type</span><span class="special">,</span> <em class="replaceable"><code><span class="identifier">see</span><span class="special">-</span><span class="identifier">below</span></code></em><span class="special">></span> <a name="idp206887824-bb"></a><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span><span class="identifier">Value</span> <span class="keyword">const</span> <span class="special">&</span> value<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
60 If <code class="computeroutput">Value</code> is a specialization <code class="computeroutput">boost::reference_wrapper<T></code>,
61 this function returns <code class="computeroutput"><a class="link" href="env.html" title="Struct template env">env</a><data_type, T &>(value.get())</code>.
64 Else, if the type <code class="computeroutput">Value</code> is non-copyable (i.e., a function, an array, abstract, or an ostream),
65 this function returns <code class="computeroutput"><a class="link" href="env.html" title="Struct template env">env</a><data_type, Value <em class="replaceable"><code>cv</code></em> &>(value)</code>,
66 where <code class="computeroutput"><em class="replaceable"><code>cv</code></em></code> is <code class="computeroutput">const</code> for the second overload, and empty
70 Otherwise, this function returns <code class="computeroutput"><a class="link" href="env.html" title="Struct template env">env</a><data_type, Value>(value)</code>.
76 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
77 <td align="left"></td>
78 <td align="right"><div class="copyright-footer">Copyright © 2008 Eric Niebler<p>
79 Distributed under the Boost Software License, Version 1.0. (See accompanying
80 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>)
85 <div class="spirit-nav">
86 <a accesskey="p" href="is_env.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../proto/reference.html#header.boost.proto.transform.env_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="data.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>