blob: 5739645a3cdead25544e23911849dfdf00a8aa50 [file] [log] [blame]
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Struct template concept_interface</title>
<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../../boost_typeerasure/reference.html#header.boost.type_erasure.concept_interface_hpp" title="Header &lt;boost/type_erasure/concept_interface.hpp&gt;">
<link rel="prev" href="check_match.html" title="Function check_match">
<link rel="next" href="concept_of.html" title="Struct template concept_of">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
<td align="center"><a href="../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="check_match.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_typeerasure/reference.html#header.boost.type_erasure.concept_interface_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="concept_of.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.type_erasure.concept_interface"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Struct template concept_interface</span></h2>
<p>boost::type_erasure::concept_interface</p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<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="../../boost_typeerasure/reference.html#header.boost.type_erasure.concept_interface_hpp" title="Header &lt;boost/type_erasure/concept_interface.hpp&gt;">boost/type_erasure/concept_interface.hpp</a>&gt;
</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Concept<span class="special">,</span> <span class="keyword">typename</span> Base<span class="special">,</span> <span class="keyword">typename</span> ID<span class="special">,</span> <span class="keyword">typename</span> Enable <span class="special">=</span> <span class="keyword">void</span><span class="special">&gt;</span>
<span class="keyword">struct</span> <a class="link" href="concept_interface.html" title="Struct template concept_interface">concept_interface</a> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">Base</span> <span class="special">{</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idp473753904"></a><h2>Description</h2>
<p>The <a class="link" href="concept_interface.html" title="Struct template concept_interface">concept_interface</a> class can be specialized to add behavior to an any. An any inherits from all the relevant specializations of <a class="link" href="concept_interface.html" title="Struct template concept_interface">concept_interface</a>.</p>
<p><a class="link" href="concept_interface.html" title="Struct template concept_interface">concept_interface</a> can be specialized for either primitive or composite concepts. If a concept <code class="computeroutput">C1</code> contains another concept <code class="computeroutput">C2</code>, then the library guarantees that the specialization of <a class="link" href="concept_interface.html" title="Struct template concept_interface">concept_interface</a> for <code class="computeroutput">C2</code> is a base class of the specialization for <code class="computeroutput">C1</code>. This means that <code class="computeroutput">C1</code> can safely override members of <code class="computeroutput">C2</code>.</p>
<p><a class="link" href="concept_interface.html" title="Struct template concept_interface">concept_interface</a> may only be specialized for user-defined concepts. The library owns the specializations of its own built in concepts.</p>
<p>
The metafunctions <a class="link" href="derived.html" title="Struct template derived">derived</a>, <a class="link" href="rebind_any.html" title="Struct template rebind_any">rebind_any</a>, and <a class="link" href="as_param.html" title="Struct template as_param">as_param</a> (which can be applied to <code class="computeroutput">Base</code>) are useful for determining the argument and return types of functions defined in <a class="link" href="concept_interface.html" title="Struct template concept_interface">concept_interface</a>.</p>
<p>For dispatching the function use <a class="link" href="call_idp304107712.html" title="Function call">call</a>. </p>
<div class="refsect2">
<a name="idp473769344"></a><h3>Template Parameters</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="keyword">typename</span> Concept</pre>
<p>The concept that we're specializing <code class="computeroutput"><a class="link" href="concept_interface.html" title="Struct template concept_interface">concept_interface</a></code> for. One of its placeholders should be <code class="computeroutput">ID</code>. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">typename</span> Base</pre>
<p>The base of this class. Specializations of <code class="computeroutput"><a class="link" href="concept_interface.html" title="Struct template concept_interface">concept_interface</a></code> must inherit publicly from this type. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">typename</span> ID</pre>
<p>The placeholder representing this type. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">typename</span> Enable <span class="special">=</span> <span class="keyword">void</span></pre>
<p>A dummy parameter that can be used for SFINAE.</p>
</li>
</ol></div>
</div>
</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"><div class="copyright-footer">Copyright &#169; 2011-2013 Steven Watanabe<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
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>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="check_match.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_typeerasure/reference.html#header.boost.type_erasure.concept_interface_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="concept_of.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>