<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[boost metafunction nur instanzieren, wenn eine bestimmte kondition wahr ist?]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich habe eine metafunktion, die ich NUR instanzieren möchte, wenn eine bestimmte Kondition wahr ist. Wie geht das?</p>
<p>Danke</p>
<pre><code class="language-cpp">class CEmpty
{
};

template&lt;class Arg&gt; class CMetaFunction
{
    //...
    typedef typename Arg::test type;
}

//CMetaFunction&lt;int&gt; soll wirklich nur dann instanziert werden, wenn bCondition_t::value==true
typedef mpl::if_&lt;bCondition_t, CMetaFunction&lt;int&gt;,CEmpty&gt;::type test;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/200274/boost-metafunction-nur-instanzieren-wenn-eine-bestimmte-kondition-wahr-ist</link><generator>RSS for Node</generator><lastBuildDate>Sun, 04 Oct 2026 18:50:52 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/200274.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 12 Dec 2007 19:54:43 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to boost metafunction nur instanzieren, wenn eine bestimmte kondition wahr ist? on Wed, 12 Dec 2007 19:54:43 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich habe eine metafunktion, die ich NUR instanzieren möchte, wenn eine bestimmte Kondition wahr ist. Wie geht das?</p>
<p>Danke</p>
<pre><code class="language-cpp">class CEmpty
{
};

template&lt;class Arg&gt; class CMetaFunction
{
    //...
    typedef typename Arg::test type;
}

//CMetaFunction&lt;int&gt; soll wirklich nur dann instanziert werden, wenn bCondition_t::value==true
typedef mpl::if_&lt;bCondition_t, CMetaFunction&lt;int&gt;,CEmpty&gt;::type test;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1419627</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1419627</guid><dc:creator><![CDATA[boostaaa]]></dc:creator><pubDate>Wed, 12 Dec 2007 19:54:43 GMT</pubDate></item></channel></rss>