<?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[Wusstet ihr, dass das funktioniert?]]></title><description><![CDATA[<p>Hallo,</p>
<p>etwas echt Lustiges was ich zufällig herausgefunden habe:</p>
<pre><code>template&lt;typename T&gt;
struct CheckTmp
{
	static constexpr bool Value = false;
};
template&lt;template&lt;typename...&gt; class Template, typename... ArgsT&gt;
struct CheckTmp&lt;Template&lt;ArgsT...&gt;&gt;
{
	static constexpr bool Value = true;
};

template&lt;typename T&gt;
struct Foo
{
};

template&lt;typename... T&gt;
struct Bar
{
};

int main()
{
	static_assert(!CheckTmp&lt;int&gt;::Value, &quot;not working&quot;);
	static_assert(CheckTmp&lt;Foo&lt;void&gt;&gt;::Value, &quot;not working&quot;);
	static_assert(CheckTmp&lt;Bar&lt;char, double&gt;&gt;::Value, &quot;not working&quot;);
	static_assert(CheckTmp&lt;Bar&lt;&gt;&gt;::Value, &quot;not working&quot;);
}
</code></pre>
<p><a href="http://ideone.com/CMOTXt" rel="nofollow">http://ideone.com/CMOTXt</a></p>
<p>Leider nicht perfekt, da Integrale, Zeiger, Referenzen und Templates als Template-Parameter nicht unterstützt werden, aber camper und Arcoth haben da schon eine Lösung. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
<p>Gruss</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/331360/wusstet-ihr-dass-das-funktioniert</link><generator>RSS for Node</generator><lastBuildDate>Fri, 01 May 2026 16:47:39 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/331360.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 24 Feb 2015 10:15:56 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Wusstet ihr, dass das funktioniert? on Tue, 24 Feb 2015 10:15:56 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>etwas echt Lustiges was ich zufällig herausgefunden habe:</p>
<pre><code>template&lt;typename T&gt;
struct CheckTmp
{
	static constexpr bool Value = false;
};
template&lt;template&lt;typename...&gt; class Template, typename... ArgsT&gt;
struct CheckTmp&lt;Template&lt;ArgsT...&gt;&gt;
{
	static constexpr bool Value = true;
};

template&lt;typename T&gt;
struct Foo
{
};

template&lt;typename... T&gt;
struct Bar
{
};

int main()
{
	static_assert(!CheckTmp&lt;int&gt;::Value, &quot;not working&quot;);
	static_assert(CheckTmp&lt;Foo&lt;void&gt;&gt;::Value, &quot;not working&quot;);
	static_assert(CheckTmp&lt;Bar&lt;char, double&gt;&gt;::Value, &quot;not working&quot;);
	static_assert(CheckTmp&lt;Bar&lt;&gt;&gt;::Value, &quot;not working&quot;);
}
</code></pre>
<p><a href="http://ideone.com/CMOTXt" rel="nofollow">http://ideone.com/CMOTXt</a></p>
<p>Leider nicht perfekt, da Integrale, Zeiger, Referenzen und Templates als Template-Parameter nicht unterstützt werden, aber camper und Arcoth haben da schon eine Lösung. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
<p>Gruss</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2444125</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2444125</guid><dc:creator><![CDATA[Fytch]]></dc:creator><pubDate>Tue, 24 Feb 2015 10:15:56 GMT</pubDate></item><item><title><![CDATA[Reply to Wusstet ihr, dass das funktioniert? on Tue, 24 Feb 2015 12:54:54 GMT]]></title><description><![CDATA[<p>Jo, dass das Funktioniert wissen wir alle. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /> Ist durchaus nützlich wenn man e.g. testen will ob ein Typ eine Spezialisierung eines <strong>konkreten</strong> Templates ist.</p>
<blockquote>
<p>Leider nicht perfekt, da Integrale, Zeiger, Referenzen und Templates als Template-Parameter nicht unterstützt werden, aber camper und Arcoth haben da schon eine Lösung.</p>
</blockquote>
<p>Nein, haben sie nicht. Siehe <a href="http://stackoverflow.com/questions/25893828/c-variadic-template-template-argument-that-matches-any-kind-of-parameters" rel="nofollow">http://stackoverflow.com/questions/25893828/c-variadic-template-template-argument-that-matches-any-kind-of-parameters</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2444152</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2444152</guid><dc:creator><![CDATA[Columbo]]></dc:creator><pubDate>Tue, 24 Feb 2015 12:54:54 GMT</pubDate></item><item><title><![CDATA[Reply to Wusstet ihr, dass das funktioniert? on Tue, 24 Feb 2015 14:29:52 GMT]]></title><description><![CDATA[<p>Arcoth schrieb:</p>
<blockquote>
<p>Jo, dass das Funktioniert wissen wir alle. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /> Ist durchaus nützlich wenn man e.g. testen will ob ein Typ eine Spezialisierung eines <strong>konkreten</strong> Templates ist.</p>
</blockquote>
<p>&quot;Gewöhnliche&quot; partielle Spezialisierungen waren mir schon bekannt, nicht jedoch dass auch das Template, anhand welchem der Typ instanziiert wurde, auf diese Weise unabhängig gemacht werden kann.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2444170</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2444170</guid><dc:creator><![CDATA[Fytch]]></dc:creator><pubDate>Tue, 24 Feb 2015 14:29:52 GMT</pubDate></item></channel></rss>