• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2<html>
3<head>
4<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5<title>Struct deduce_domain</title>
6<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
7<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
8<link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
9<link rel="up" href="../../proto/reference.html#header.boost.proto.domain_hpp" title="Header &lt;boost/proto/domain.hpp&gt;">
10<link rel="prev" href="basic_default_domain.html" title="Struct basic_default_domain">
11<link rel="next" href="is_domain.html" title="Struct template is_domain">
12</head>
13<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
14<table cellpadding="2" width="100%"><tr>
15<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
16<td align="center"><a href="../../../../index.html">Home</a></td>
17<td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
18<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
19<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
20<td align="center"><a href="../../../../more/index.htm">More</a></td>
21</tr></table>
22<hr>
23<div class="spirit-nav">
24<a accesskey="p" href="basic_default_domain.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../proto/reference.html#header.boost.proto.domain_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="is_domain.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
25</div>
26<div class="refentry">
27<a name="boost.proto.deduce_domain"></a><div class="titlepage"></div>
28<div class="refnamediv">
29<h2><span class="refentrytitle">Struct deduce_domain</span></h2>
30<p>boost::proto::deduce_domain — A pseudo-domain for use in functions and metafunctions that require a domain parameter.
31          It indicates that the domain of the parent node should be inferred from the domains of the child nodes.</p>
32</div>
33<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
34<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="../../proto/reference.html#header.boost.proto.domain_hpp" title="Header &lt;boost/proto/domain.hpp&gt;">boost/proto/domain.hpp</a>&gt;
35
36</span>
37<span class="keyword">struct</span> <a class="link" href="deduce_domain.html" title="Struct deduce_domain">deduce_domain</a> <span class="special">{</span>
38<span class="special">}</span><span class="special">;</span></pre></div>
39<div class="refsect1">
40<a name="id-1.3.33.5.9.7.4"></a><h2>Description</h2>
41<p>
42            When <code class="computeroutput">proto::deduce_domain</code> is used as a domain — either
43            explicitly or implicitly by
44            <code class="computeroutput"><a class="link" href="make_expr.html" title="Function make_expr">proto::make_expr</a>()</code>,
45            <code class="computeroutput"><a class="link" href="unpack_expr.html" title="Function unpack_expr">proto::unpack_expr</a>()</code>,
46            or Proto's operator overloads — Proto will use the domains of the child expressions to
47            compute the domain of the parent. It is done in such a way that (A) expressions in domains
48            that share a common super-domain are interoperable, and (B) expressions that are in
49            the default domain (or a sub-domain thereof) are interoperable with <span class="emphasis"><em>all</em></span>
50            expressions. The rules are as follows:
51            </p>
52<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
53<li class="listitem">
54                A sub-domain is <span class="emphasis"><em>stronger</em></span> than its super-domain.
55              </li>
56<li class="listitem">
57<code class="computeroutput"><a class="link" href="default_domain.html" title="Struct default_domain">proto::default_domain</a></code>,
58                <code class="computeroutput"><a class="link" href="basic_default_domain.html" title="Struct basic_default_domain">proto::basic_default_domain</a></code>
59                and all their sub-domains are <span class="emphasis"><em>weaker</em></span> than all other domains.
60              </li>
61<li class="listitem">
62<code class="computeroutput"><a class="link" href="basic_default_domain.html" title="Struct basic_default_domain">proto::basic_default_domain</a></code>
63                is weaker than
64                <code class="computeroutput"><a class="link" href="default_domain.html" title="Struct default_domain">proto::default_domain</a></code>.
65              </li>
66<li class="listitem">
67                For each child, define a set of domains <span class="emphasis"><em>S<sub>N</sub></em></span>
68                that includes the child's domain and all its super-domains.
69              </li>
70<li class="listitem">
71                Define a set <span class="emphasis"><em>I<sub>S</sub></em></span> that is the intersection of
72                all the individual sets <span class="emphasis"><em>S<sub>N</sub></em></span> that don't contain
73                <code class="computeroutput"><a class="link" href="default_domain.html" title="Struct default_domain">proto::default_domain</a></code> or
74                <code class="computeroutput"><a class="link" href="basic_default_domain.html" title="Struct basic_default_domain">proto::basic_default_domain</a></code>.
75              </li>
76<li class="listitem">
77                Define a set <span class="emphasis"><em>I<sub>W</sub></em></span> that is the intersection of
78                all the individual sets <span class="emphasis"><em>S<sub>N</sub></em></span> that contain
79                <code class="computeroutput"><a class="link" href="default_domain.html" title="Struct default_domain">proto::default_domain</a></code> or
80                <code class="computeroutput"><a class="link" href="basic_default_domain.html" title="Struct basic_default_domain">proto::basic_default_domain</a></code>.
81              </li>
82<li class="listitem">
83                Define a set <span class="emphasis"><em>P</em></span> that is the union of
84                <span class="emphasis"><em>I<sub>S</sub></em></span> and
85                <span class="emphasis"><em>I<sub>W</sub></em></span>.
86              </li>
87<li class="listitem">
88                The common domain is the strongest domain in set <span class="emphasis"><em>P</em></span>, with the
89                following caveats.
90              </li>
91<li class="listitem">
92                Let <span class="emphasis"><em>U</em></span> be the union of all sets
93                <span class="emphasis"><em>S<sub>N</sub></em></span>. If the result is
94                <code class="computeroutput"><a class="link" href="default_domain.html" title="Struct default_domain">proto::default_domain</a></code> or
95                <code class="computeroutput"><a class="link" href="basic_default_domain.html" title="Struct basic_default_domain">proto::basic_default_domain</a></code>
96                and <span class="emphasis"><em>U</em></span> contains an element that is <span class="emphasis"><em>not </em></span><code class="computeroutput"><a class="link" href="default_domain.html" title="Struct default_domain">proto::default_domain</a></code> or
97                <code class="computeroutput"><a class="link" href="basic_default_domain.html" title="Struct basic_default_domain">proto::basic_default_domain</a></code>,
98                it is an error.
99              </li>
100</ul></div>
101<p>
102          </p>
103<p>
104            Note: the above description sounds like it would be expensive to compute at compile time.
105            In fact, it can all be done using C++ function overloading.
106          </p>
107</div>
108</div>
109<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
110<td align="left"></td>
111<td align="right"><div class="copyright-footer">Copyright © 2008 Eric Niebler<p>
112        Distributed under the Boost Software License, Version 1.0. (See accompanying
113        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>)
114      </p>
115</div></td>
116</tr></table>
117<hr>
118<div class="spirit-nav">
119<a accesskey="p" href="basic_default_domain.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../proto/reference.html#header.boost.proto.domain_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="is_domain.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
120</div>
121</body>
122</html>
123