<?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[Probleme mit Boost MPL (Lambda und Transform)]]></title><description><![CDATA[<p>Hallo!</p>
<p>Ich möchte mich gerne in Boost MPL (Sequence und Lambda) einarbeiten und verstehe die Compilerfehler nun nicht mehr (es wird nur noch in die MPL-Bibliothek verwiesen).</p>
<p>Hier der Code:</p>
<pre><code class="language-cpp">template&lt;typename Formula&gt;
struct negate
{
	typedef typename Formula::negated type;
};

// ------------------------------------------------------------------------
//	Term
// ------------------------------------------------------------------------
template&lt;typename Polarity&gt;
struct term 
{
	typedef typename term&lt;Polarity&gt; negated;
};

// ------------------------------------------------------------------------
//	Formula
// ------------------------------------------------------------------------
template
	&lt;typename Polarity, typename Junctor, typename Sequence&gt;
struct connected
{
	// Negated Formula
	typedef typename connected&lt;mpl::not_&lt;Polarity&gt;, Junctor, Sequence&gt; negated;

	typedef typename mpl::lambda&lt; negate &lt;mpl::_1&gt; &gt; neg;

	typedef typename mpl::transform&lt;Sequence, neg &gt;::type neg_sequence;
};

...

typedef connected&lt;mpl::true_, and, term&lt;mpl::false_ &gt; &gt; f;
f::neg_sequence l;
</code></pre>
<p>Problematisch ist die letzte Typdefinition. Ich möchte erreichen, dass jedes Element in Sequence negiert wird, also neg aufgerufen wird.</p>
<p>Vielen Dank für eure Hilfe</p>
<p>Schöne Grüße<br />
Tobias Philipp</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/237833/probleme-mit-boost-mpl-lambda-und-transform</link><generator>RSS for Node</generator><lastBuildDate>Wed, 23 Sep 2026 06:09:26 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/237833.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 02 Apr 2009 13:52:44 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Probleme mit Boost MPL (Lambda und Transform) on Thu, 02 Apr 2009 13:52:44 GMT]]></title><description><![CDATA[<p>Hallo!</p>
<p>Ich möchte mich gerne in Boost MPL (Sequence und Lambda) einarbeiten und verstehe die Compilerfehler nun nicht mehr (es wird nur noch in die MPL-Bibliothek verwiesen).</p>
<p>Hier der Code:</p>
<pre><code class="language-cpp">template&lt;typename Formula&gt;
struct negate
{
	typedef typename Formula::negated type;
};

// ------------------------------------------------------------------------
//	Term
// ------------------------------------------------------------------------
template&lt;typename Polarity&gt;
struct term 
{
	typedef typename term&lt;Polarity&gt; negated;
};

// ------------------------------------------------------------------------
//	Formula
// ------------------------------------------------------------------------
template
	&lt;typename Polarity, typename Junctor, typename Sequence&gt;
struct connected
{
	// Negated Formula
	typedef typename connected&lt;mpl::not_&lt;Polarity&gt;, Junctor, Sequence&gt; negated;

	typedef typename mpl::lambda&lt; negate &lt;mpl::_1&gt; &gt; neg;

	typedef typename mpl::transform&lt;Sequence, neg &gt;::type neg_sequence;
};

...

typedef connected&lt;mpl::true_, and, term&lt;mpl::false_ &gt; &gt; f;
f::neg_sequence l;
</code></pre>
<p>Problematisch ist die letzte Typdefinition. Ich möchte erreichen, dass jedes Element in Sequence negiert wird, also neg aufgerufen wird.</p>
<p>Vielen Dank für eure Hilfe</p>
<p>Schöne Grüße<br />
Tobias Philipp</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1689909</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1689909</guid><dc:creator><![CDATA[tphilipp_]]></dc:creator><pubDate>Thu, 02 Apr 2009 13:52:44 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit Boost MPL (Lambda und Transform) on Thu, 02 Apr 2009 14:03:42 GMT]]></title><description><![CDATA[<p>Nur weil du die Fehlermeldung nicht mehr verstehst, heisst das nicht, dass wir damit auch nicht klar kommen. Es ist sehr schwer einfach so auf Anhieb ohne genauere Angaben rauszufinden, was hier falsch ist. Die Fehlermeldungen sind zwar komplex, aber meistens sehr hilfreich.</p>
<p>Grüssli</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1689915</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1689915</guid><dc:creator><![CDATA[Dravere]]></dc:creator><pubDate>Thu, 02 Apr 2009 14:03:42 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit Boost MPL (Lambda und Transform) on Thu, 02 Apr 2009 14:22:18 GMT]]></title><description><![CDATA[<p>Danke für deine schnelle Antwort. Bisher kam ich mit den Fehlermeldungen auch klar, aber es wurde auf meinem Quelltext verwiesen. Zur Not konnte ich da noch raten <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>Hier noch die Fehlermeldung. Ich dachte nicht, dass diese weiterhilft. Achja, kompiliert wurde mit Visual Studio 2008:</p>
<pre><code>1&gt;c:\users\tobias\documents\downloads\boost_1_38_0\boost_1_38_0\boost\mpl\clear.hpp(30) : error C2903: 'apply' : symbol is neither a class template nor a function template
1&gt;        c:\users\tobias\documents\downloads\boost_1_38_0\boost_1_38_0\boost\mpl\transform.hpp(113) : see reference to class template instantiation 'boost::mpl::clear&lt;Sequence&gt;' being compiled
1&gt;        with
1&gt;        [
1&gt;            Sequence=miniplan::term&lt;boost::mpl::false_&gt;
1&gt;        ]
1&gt;        c:\users\tobias\documents\downloads\boost_1_38_0\boost_1_38_0\boost\mpl\eval_if.hpp(41) : see reference to class template instantiation 'boost::mpl::transform1&lt;P1,P2,P3&gt;' being compiled
1&gt;        with
1&gt;        [
1&gt;            P1=miniplan::term&lt;boost::mpl::false_&gt;,
1&gt;            P2=miniplan::connected&lt;boost::mpl::true_,miniplan::and,miniplan::term&lt;boost::mpl::false_&gt;&gt;::neg,
1&gt;            P3=boost::mpl::na
1&gt;        ]
1&gt;        c:\users\tobias\documents\downloads\boost_1_38_0\boost_1_38_0\boost\mpl\transform.hpp(138) : see reference to class template instantiation 'boost::mpl::eval_if&lt;C,F1,F2&gt;' being compiled
1&gt;        with
1&gt;        [
1&gt;            C=boost::mpl::or_&lt;boost::mpl::is_na&lt;boost::mpl::na&gt;,boost::mpl::is_lambda_expression&lt;miniplan::connected&lt;boost::mpl::true_,miniplan::and,miniplan::term&lt;boost::mpl::false_&gt;&gt;::neg&gt;,boost::mpl::not_&lt;boost::mpl::is_sequence&lt;miniplan::connected&lt;boost::mpl::true_,miniplan::and,miniplan::term&lt;boost::mpl::false_&gt;&gt;::neg&gt;&gt;&gt;,
1&gt;            F1=boost::mpl::transform1&lt;miniplan::term&lt;boost::mpl::false_&gt;,miniplan::connected&lt;boost::mpl::true_,miniplan::and,miniplan::term&lt;boost::mpl::false_&gt;&gt;::neg,boost::mpl::na&gt;,
1&gt;            F2=boost::mpl::transform2&lt;miniplan::term&lt;boost::mpl::false_&gt;,miniplan::connected&lt;boost::mpl::true_,miniplan::and,miniplan::term&lt;boost::mpl::false_&gt;&gt;::neg,boost::mpl::na,boost::mpl::na&gt;
1&gt;        ]
1&gt;        c:\users\tobias\desktop\lala\miniplan\liblogic\static_formula.h(105) : see reference to class template instantiation 'boost::mpl::transform&lt;Seq1,Seq2OrOperation&gt;' being compiled
1&gt;        with
1&gt;        [
1&gt;            Seq1=miniplan::term&lt;boost::mpl::false_&gt;,
1&gt;            Seq2OrOperation=miniplan::connected&lt;boost::mpl::true_,miniplan::and,miniplan::term&lt;boost::mpl::false_&gt;&gt;::neg
1&gt;        ]
1&gt;        c:\users\tobias\desktop\lala\miniplan\liblogic\liblogic.cpp(19) : see reference to class template instantiation 'miniplan::connected&lt;Polarity,Junctor,Sequence&gt;' being compiled
1&gt;        with
1&gt;        [
1&gt;            Polarity=boost::mpl::true_,
1&gt;            Junctor=miniplan::and,
1&gt;            Sequence=miniplan::term&lt;boost::mpl::false_&gt;
1&gt;        ]
1&gt;c:\users\tobias\documents\downloads\boost_1_38_0\boost_1_38_0\boost\mpl\clear.hpp(30) : error C2039: 'apply' : is not a member of 'boost::mpl::clear_impl&lt;boost::mpl::non_sequence_tag&gt;'
1&gt;        c:\users\tobias\documents\downloads\boost_1_38_0\boost_1_38_0\boost\mpl\aux_\clear_impl.hpp(31) : see declaration of 'boost::mpl::clear_impl&lt;boost::mpl::non_sequence_tag&gt;'
1&gt;c:\users\tobias\documents\downloads\boost_1_38_0\boost_1_38_0\boost\mpl\clear.hpp(30) : error C2955: 'boost::mpl::apply' : use of class template requires template argument list
1&gt;        c:\users\tobias\documents\downloads\boost_1_38_0\boost_1_38_0\boost\mpl\aux_\preprocessed\plain\apply.hpp(134) : see declaration of 'boost::mpl::apply'
1&gt;c:\users\tobias\documents\downloads\boost_1_38_0\boost_1_38_0\boost\mpl\clear.hpp(30) : error C2143: syntax error : missing ',' before '&lt;'
1&gt;c:\users\tobias\documents\downloads\boost_1_38_0\boost_1_38_0\boost\mpl\transform.hpp(113) : error C2039: 'type' : is not a member of 'boost::mpl::clear&lt;Sequence&gt;'
1&gt;        with
1&gt;        [
1&gt;            Sequence=miniplan::term&lt;boost::mpl::false_&gt;
1&gt;        ]
1&gt;c:\users\tobias\documents\downloads\boost_1_38_0\boost_1_38_0\boost\mpl\transform.hpp(113) : error C2146: syntax error : missing ',' before identifier 'type'
1&gt;c:\users\tobias\documents\downloads\boost_1_38_0\boost_1_38_0\boost\mpl\transform.hpp(113) : error C2065: 'type' : undeclared identifier
1&gt;c:\users\tobias\documents\downloads\boost_1_38_0\boost_1_38_0\boost\mpl\transform.hpp(113) : error C3203: 'back_inserter' : unspecialized class template can't be used as a template argument for template parameter 'In', expected a real type
1&gt;c:\users\tobias\documents\downloads\boost_1_38_0\boost_1_38_0\boost\mpl\transform.hpp(113) : error C2955: 'boost::mpl::back_inserter' : use of class template requires template argument list
1&gt;        c:\users\tobias\documents\downloads\boost_1_38_0\boost_1_38_0\boost\mpl\back_inserter.hpp(28) : see declaration of 'boost::mpl::back_inserter'
1&gt;c:\users\tobias\documents\downloads\boost_1_38_0\boost_1_38_0\boost\mpl\transform.hpp(113) : error C2039: 'type' : is not a member of 'boost::mpl::clear&lt;Sequence&gt;'
1&gt;        with
1&gt;        [
1&gt;            Sequence=miniplan::term&lt;boost::mpl::false_&gt;
1&gt;        ]
1&gt;c:\users\tobias\documents\downloads\boost_1_38_0\boost_1_38_0\boost\mpl\transform.hpp(113) : error C2146: syntax error : missing ',' before identifier 'type'
1&gt;c:\users\tobias\documents\downloads\boost_1_38_0\boost_1_38_0\boost\mpl\transform.hpp(113) : error C2065: 'type' : undeclared identifier
1&gt;c:\users\tobias\documents\downloads\boost_1_38_0\boost_1_38_0\boost\mpl\transform.hpp(113) : error C3203: 'front_inserter' : unspecialized class template can't be used as a template argument for template parameter 'In', expected a real type
1&gt;c:\users\tobias\documents\downloads\boost_1_38_0\boost_1_38_0\boost\mpl\transform.hpp(113) : error C2955: 'boost::mpl::front_inserter' : use of class template requires template argument list
1&gt;        c:\users\tobias\documents\downloads\boost_1_38_0\boost_1_38_0\boost\mpl\front_inserter.hpp(27) : see declaration of 'boost::mpl::front_inserter'
1&gt;c:\users\tobias\documents\downloads\boost_1_38_0\boost_1_38_0\boost\mpl\transform.hpp(113) : error C3203: 'transform1_impl' : unspecialized class template can't be used as a template argument for template parameter 'T2', expected a real type
1&gt;c:\users\tobias\documents\downloads\boost_1_38_0\boost_1_38_0\boost\mpl\transform.hpp(113) : error C2955: 'boost::mpl::aux::transform1_impl' : use of class template requires template argument list
1&gt;        c:\users\tobias\documents\downloads\boost_1_38_0\boost_1_38_0\boost\mpl\transform.hpp(40) : see declaration of 'boost::mpl::aux::transform1_impl'
1&gt;c:\users\tobias\documents\downloads\boost_1_38_0\boost_1_38_0\boost\mpl\transform.hpp(113) : error C3203: 'reverse_transform1_impl' : unspecialized class template can't be used as a template argument for template parameter 'T3', expected a real type
1&gt;c:\users\tobias\documents\downloads\boost_1_38_0\boost_1_38_0\boost\mpl\transform.hpp(113) : error C2955: 'boost::mpl::aux::reverse_transform1_impl' : use of class template requires template argument list
1&gt;        c:\users\tobias\documents\downloads\boost_1_38_0\boost_1_38_0\boost\mpl\transform.hpp(57) : see declaration of 'boost::mpl::aux::reverse_transform1_impl'
1&gt;c:\users\tobias\documents\downloads\boost_1_38_0\boost_1_38_0\boost\mpl\transform.hpp(113) : error C2955: 'boost::mpl::if_' : use of class template requires template argument list
1&gt;        c:\users\tobias\documents\downloads\boost_1_38_0\boost_1_38_0\boost\mpl\if.hpp(56) : see declaration of 'boost::mpl::if_'
1&gt;c:\users\tobias\documents\downloads\boost_1_38_0\boost_1_38_0\boost\mpl\transform.hpp(113) : fatal error C1903: unable to recover from previous error(s); stopping compilation
1&gt;Build log was saved at &quot;file://c:\Users\Tobias\Desktop\lala\miniplan\liblogic\Debug\BuildLog.htm&quot;
1&gt;liblogic - 20 error(s), 1 warning(s)
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1689925</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1689925</guid><dc:creator><![CDATA[tphilipp_]]></dc:creator><pubDate>Thu, 02 Apr 2009 14:22:18 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit Boost MPL (Lambda und Transform) on Thu, 02 Apr 2009 15:09:14 GMT]]></title><description><![CDATA[<p>Hmmm, das Problem scheint recht trivial zu sein. Deine Sequence ist schlicht und einfach gesagt keine Sequence. Sie erfüllt das Konzept der Forward Sequence nicht.</p>
<p>Transform:<br />
<a href="http://www.boost.org/doc/libs/1_38_0/libs/mpl/doc/refmanual/transform.html" rel="nofollow">http://www.boost.org/doc/libs/1_38_0/libs/mpl/doc/refmanual/transform.html</a></p>
<p>Erwartet eine Sequence, welche das Konzept Forward Sequence erfüllt:<br />
<a href="http://www.boost.org/doc/libs/1_38_0/libs/mpl/doc/refmanual/forward-sequence.html" rel="nofollow">http://www.boost.org/doc/libs/1_38_0/libs/mpl/doc/refmanual/forward-sequence.html</a></p>
<p>Du übergibst <code>term&lt;mpl::false_ &gt;</code> , was überhaupt nichts mit einer solchen Sequenz zu tun hat. Mach daraus z.B. ein <code>mpl::vector&lt;term&lt;mpl::false_&gt; &gt;</code> und schon kompiliert es.</p>
<p>Grüssli</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1689951</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1689951</guid><dc:creator><![CDATA[Dravere]]></dc:creator><pubDate>Thu, 02 Apr 2009 15:09:14 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit Boost MPL (Lambda und Transform) on Thu, 02 Apr 2009 15:50:06 GMT]]></title><description><![CDATA[<p>Ach Mist! Das hatte ich übersehen.</p>
<p>Vielen Dank, es funktioniert. Schon gut, wenn ein anderer auch mal drauf guckt <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="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1689970</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1689970</guid><dc:creator><![CDATA[tphilipp_]]></dc:creator><pubDate>Thu, 02 Apr 2009 15:50:06 GMT</pubDate></item></channel></rss>