<?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[Anfängerfrage zu boost::spirit: Methode als Aktor aufrufen]]></title><description><![CDATA[<p>Hallo allerseits,</p>
<p>Ich mache gerade meine ersten Schritte mit boost::spirit und benötige Eure Hilfe:</p>
<p>Wenn ich eine freie Funktion folgendermaßen als Aktor einsetze, dann funktioniert das ohne Probleme:</p>
<pre><code class="language-cpp">void doSomething(const char* begin, const char* end)
{
    foobar();
}

// ...

rule&lt;&gt; itemFile = *(item &gt;&gt; ch_p(';')) [ &amp;doSomething ];
</code></pre>
<p>Nun würde ich aber gerne eine Klassen-Methode als Aktor aufrufen, was einfach nicht funktionieren will. Was mache ich falsch?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/162873/anfängerfrage-zu-boost-spirit-methode-als-aktor-aufrufen</link><generator>RSS for Node</generator><lastBuildDate>Thu, 09 Jul 2026 05:10:42 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/162873.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 23 Oct 2006 22:47:41 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Anfängerfrage zu boost::spirit: Methode als Aktor aufrufen on Mon, 23 Oct 2006 22:49:32 GMT]]></title><description><![CDATA[<p>Hallo allerseits,</p>
<p>Ich mache gerade meine ersten Schritte mit boost::spirit und benötige Eure Hilfe:</p>
<p>Wenn ich eine freie Funktion folgendermaßen als Aktor einsetze, dann funktioniert das ohne Probleme:</p>
<pre><code class="language-cpp">void doSomething(const char* begin, const char* end)
{
    foobar();
}

// ...

rule&lt;&gt; itemFile = *(item &gt;&gt; ch_p(';')) [ &amp;doSomething ];
</code></pre>
<p>Nun würde ich aber gerne eine Klassen-Methode als Aktor aufrufen, was einfach nicht funktionieren will. Was mache ich falsch?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1159987</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1159987</guid><dc:creator><![CDATA[nman]]></dc:creator><pubDate>Mon, 23 Oct 2006 22:49:32 GMT</pubDate></item><item><title><![CDATA[Reply to Anfängerfrage zu boost::spirit: Methode als Aktor aufrufen on Tue, 24 Oct 2006 08:05:46 GMT]]></title><description><![CDATA[<p>Also deinen Fehler kann ich in dem Code nicht erkennen... <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>Aber ich mach das immer mit boost::bind:</p>
<pre><code class="language-cpp">struct foo
{ 
void bar(char* beg, char* end){std::cout &lt;&lt; std::string(beg,end) &lt;&lt; std::endl;}
};
rule&lt;&gt; value = int_p &gt;&gt; *(',' &gt;&gt; int_p);
rule&lt;&gt; x = value[boost::bind(&amp;foo::bar,pointer_auf_foo_instanz,_1,_2)];
</code></pre>
<p>Und evtl. solltest du dir auch die predefined Actors ansehen, da kann man auch recht viel mit machen:<br />
<a href="http://boost.org/libs/spirit/doc/predefined_actors.html" rel="nofollow">http://boost.org/libs/spirit/doc/predefined_actors.html</a></p>
<p>phlox</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1160057</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1160057</guid><dc:creator><![CDATA[phlox81]]></dc:creator><pubDate>Tue, 24 Oct 2006 08:05:46 GMT</pubDate></item><item><title><![CDATA[Reply to Anfängerfrage zu boost::spirit: Methode als Aktor aufrufen on Tue, 24 Oct 2006 07:55:56 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>ich hab zwar von boost::spirit keine Ahnung, aber u.U. hilft dir ja der <a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-139383-and-start-is-0.html" rel="nofollow">Artikel</a> von Tobias Gerg weiter.</p>
<p>Grüße</p>
<p>GPC</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1160060</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1160060</guid><dc:creator><![CDATA[GPC]]></dc:creator><pubDate>Tue, 24 Oct 2006 07:55:56 GMT</pubDate></item><item><title><![CDATA[Reply to Anfängerfrage zu boost::spirit: Methode als Aktor aufrufen on Tue, 24 Oct 2006 08:24:30 GMT]]></title><description><![CDATA[<p>phlox81 schrieb:</p>
<blockquote>
<p>Also deinen Fehler kann ich in dem Code nicht erkennen... <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>
</blockquote>
<p>Argh. Sorry, hab extra den Beitrag nochmal editiert, damit ich den nicht funktionierenden Code reintun kann, und es dann erst recht vergessen.</p>
<p>Mittlerweile hat sich die Sache schon erledigt, das Problem lag doch woanders. Aber die Verwendung von boost::bind werde ich trotzdem beibehalten, das gefällt mir richtig gut. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /></p>
<p>GPC: Danke für den Tip, werde ich mir nächste Woche mal ansehen. Spirit ist aber zum Glück ja eh sehr gut dokumentiert, bin damit bis jetzt erstaunlich gut klargekommen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1160080</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1160080</guid><dc:creator><![CDATA[nman]]></dc:creator><pubDate>Tue, 24 Oct 2006 08:24:30 GMT</pubDate></item></channel></rss>