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 template concept_interface</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="../../boost_typeerasure/reference.html#header.boost.type_erasure.concept_interface_hpp" title="Header <boost/type_erasure/concept_interface.hpp>"> 10<link rel="prev" href="check_match.html" title="Function check_match"> 11<link rel="next" href="concept_of.html" title="Struct template concept_of"> 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="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> 25</div> 26<div class="refentry"> 27<a name="boost.type_erasure.concept_interface"></a><div class="titlepage"></div> 28<div class="refnamediv"> 29<h2><span class="refentrytitle">Struct template concept_interface</span></h2> 30<p>boost::type_erasure::concept_interface</p> 31</div> 32<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2> 33<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="../../boost_typeerasure/reference.html#header.boost.type_erasure.concept_interface_hpp" title="Header <boost/type_erasure/concept_interface.hpp>">boost/type_erasure/concept_interface.hpp</a>> 34 35</span><span class="keyword">template</span><span class="special"><</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">></span> 36<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> 37<span class="special">}</span><span class="special">;</span></pre></div> 38<div class="refsect1"> 39<a name="id-1.3.41.13.10.3.4"></a><h2>Description</h2> 40<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 <a class="link" href="any.html" title="Class template any">any</a>. An <a class="link" href="any.html" title="Class template any">any</a> inherits from all the relevant specializations of <a class="link" href="concept_interface.html" title="Struct template concept_interface">concept_interface</a>.</p> 41<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> 42<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> 43<p> 44The 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> 45<p>For dispatching the function use <a class="link" href="call.html" title="Function call">call</a>. </p> 46<div class="refsect2"> 47<a name="id-1.3.41.13.10.3.4.7"></a><h3>Template Parameters</h3> 48<div class="orderedlist"><ol class="orderedlist" type="1"> 49<li class="listitem"> 50<pre class="literallayout"><span class="keyword">typename</span> Concept</pre> 51<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> 52</li> 53<li class="listitem"> 54<pre class="literallayout"><span class="keyword">typename</span> Base</pre> 55<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> 56</li> 57<li class="listitem"> 58<pre class="literallayout"><span class="keyword">typename</span> ID</pre> 59<p>The placeholder representing this type. </p> 60</li> 61<li class="listitem"> 62<pre class="literallayout"><span class="keyword">typename</span> Enable <span class="special">=</span> <span class="keyword">void</span></pre> 63<p>A dummy parameter that can be used for SFINAE.</p> 64</li> 65</ol></div> 66</div> 67</div> 68</div> 69<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 70<td align="left"></td> 71<td align="right"><div class="copyright-footer">Copyright © 2011-2013 Steven Watanabe<p> 72 Distributed under the Boost Software License, Version 1.0. (See accompanying 73 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>) 74 </p> 75</div></td> 76</tr></table> 77<hr> 78<div class="spirit-nav"> 79<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> 80</div> 81</body> 82</html> 83