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 is_proto_expr</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.extends_hpp" title="Header <boost/proto/extends.hpp>"> 10<link rel="prev" href="unexpr.html" title="Struct template unexpr"> 11<link rel="next" href="extends.html" title="Struct template extends"> 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="unexpr.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../proto/reference.html#header.boost.proto.extends_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="extends.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a> 25</div> 26<div class="refentry"> 27<a name="boost.proto.is_proto_expr"></a><div class="titlepage"></div> 28<div class="refnamediv"> 29<h2><span class="refentrytitle">Struct is_proto_expr</span></h2> 30<p>boost::proto::is_proto_expr — Empty type to be used as a dummy template parameter of POD expression wrappers. It allows 31 argument-dependent lookup to find Proto's operator overloads.</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: <<a class="link" href="../../proto/reference.html#header.boost.proto.extends_hpp" title="Header <boost/proto/extends.hpp>">boost/proto/extends.hpp</a>> 35 36</span> 37<span class="keyword">struct</span> <a class="link" href="is_proto_expr.html" title="Struct is_proto_expr">is_proto_expr</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.12.5.4"></a><h2>Description</h2> 41<p> 42 <code class="computeroutput">proto::is_proto_expr</code> allows argument-dependent lookup to find Proto's operator overloads. For example: 43 </p> 44<p> 45 </p> 46<pre class="programlisting"> <span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Dummy</span> <span class="special">=</span> <a class="link" href="is_proto_expr.html" title="Struct is_proto_expr">proto::is_proto_expr</a><span class="special">></span> 47 <span class="keyword">struct</span> <span class="identifier">my_terminal</span> 48 <span class="special">{</span> 49 <a class="link" href="../../BOOST_PROTO_BASIC_EXTENDS.html" title="Macro BOOST_PROTO_BASIC_EXTENDS">BOOST_PROTO_BASIC_EXTENDS</a><span class="special">(</span> 50 <span class="keyword">typename</span> <a class="link" href="terminal.html" title="Struct template terminal">proto::terminal</a><span class="special"><</span><span class="identifier">T</span><span class="special">></span><span class="special">::</span><span class="identifier">type</span> 51 <span class="special">,</span> <span class="identifier">my_terminal</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> 52 <span class="special">,</span> <a class="link" href="default_domain.html" title="Struct default_domain">proto::default_domain</a> 53 <span class="special">)</span> 54 <span class="special">}</span><span class="special">;</span> 55 56 <span class="comment">// ...</span> 57 <span class="identifier">my_terminal</span><span class="special"><</span><span class="keyword">int</span><span class="special">></span> <span class="identifier">_1</span><span class="special">,</span> <span class="identifier">_2</span><span class="special">;</span> 58 <span class="identifier">_1</span> <span class="special">+</span> <span class="identifier">_2</span><span class="special">;</span> <span class="comment">// OK, uses proto::operator+</span></pre> 59<p> 60 </p> 61<p> 62 Without the second <code class="computeroutput">Dummy</code> template parameter, Proto's operator overloads 63 would not be considered by name lookup. 64 </p> 65</div> 66</div> 67<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 68<td align="left"></td> 69<td align="right"><div class="copyright-footer">Copyright © 2008 Eric Niebler<p> 70 Distributed under the Boost Software License, Version 1.0. (See accompanying 71 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>) 72 </p> 73</div></td> 74</tr></table> 75<hr> 76<div class="spirit-nav"> 77<a accesskey="p" href="unexpr.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../proto/reference.html#header.boost.proto.extends_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="extends.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a> 78</div> 79</body> 80</html> 81