<?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::bind]]></title><description><![CDATA[<p>hi,<br />
es geht um boost::bind bei member funktionen. habe bisher so gut wie alles ausprobiert, wird aber nix.<br />
sprich:</p>
<pre><code class="language-cpp">std::for_each(stringVec.begin,
                   stringVec.end,
                   boost::bind(&amp;Klasse::Show, _1);

...

void Klasse::Show(std::string var)
{ ... }
</code></pre>
<p>(so in etwa)</p>
<p>er zeigt mir immer sachen an wie:</p>
<pre><code>see reference to class template instantiation 'boost::_bi::add_cref&lt;Pm,I&gt;' being compiled
</code></pre>
<p>kann mich mal einer aufklären? ahja, die boost doku habe ich auch gelesen, werde aber nicht schlau aus dem dort gezeigtem code.</p>
<p>danke an alle</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/253312/boost-bind</link><generator>RSS for Node</generator><lastBuildDate>Sun, 13 Sep 2026 23:00:26 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/253312.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 31 Oct 2009 15:25:36 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to boost::bind on Sat, 31 Oct 2009 15:25:36 GMT]]></title><description><![CDATA[<p>hi,<br />
es geht um boost::bind bei member funktionen. habe bisher so gut wie alles ausprobiert, wird aber nix.<br />
sprich:</p>
<pre><code class="language-cpp">std::for_each(stringVec.begin,
                   stringVec.end,
                   boost::bind(&amp;Klasse::Show, _1);

...

void Klasse::Show(std::string var)
{ ... }
</code></pre>
<p>(so in etwa)</p>
<p>er zeigt mir immer sachen an wie:</p>
<pre><code>see reference to class template instantiation 'boost::_bi::add_cref&lt;Pm,I&gt;' being compiled
</code></pre>
<p>kann mich mal einer aufklären? ahja, die boost doku habe ich auch gelesen, werde aber nicht schlau aus dem dort gezeigtem code.</p>
<p>danke an alle</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1801207</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1801207</guid><dc:creator><![CDATA[boost0r]]></dc:creator><pubDate>Sat, 31 Oct 2009 15:25:36 GMT</pubDate></item><item><title><![CDATA[Reply to boost::bind on Sat, 31 Oct 2009 15:34:19 GMT]]></title><description><![CDATA[<p>was ist mit dem zweiten Parameter?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1801212</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1801212</guid><dc:creator><![CDATA[camper]]></dc:creator><pubDate>Sat, 31 Oct 2009 15:34:19 GMT</pubDate></item><item><title><![CDATA[Reply to boost::bind on Sat, 31 Oct 2009 15:41:11 GMT]]></title><description><![CDATA[<p>camper schrieb:</p>
<blockquote>
<p>was ist mit dem zweiten Parameter?</p>
</blockquote>
<p>wie!? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1801221</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1801221</guid><dc:creator><![CDATA[boost0r]]></dc:creator><pubDate>Sat, 31 Oct 2009 15:41:11 GMT</pubDate></item><item><title><![CDATA[Reply to boost::bind on Sat, 31 Oct 2009 15:46:02 GMT]]></title><description><![CDATA[<p>Du musst auch sagen welches Object der Klasse Klasse.</p>
<pre><code class="language-cpp">Klasse kl;
	std::vector&lt;std::string&gt; stringVec;
	stringVec.push_back(&quot;aaa&quot;);
	stringVec.push_back(&quot;vvv&quot;);
	std::for_each(stringVec.begin(),
                   stringVec.end(),
                   boost::bind(&amp;Klasse::Show, kl, _1));
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1801226</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1801226</guid><dc:creator><![CDATA[pupsBoost]]></dc:creator><pubDate>Sat, 31 Oct 2009 15:46:02 GMT</pubDate></item><item><title><![CDATA[Reply to boost::bind on Sat, 31 Oct 2009 15:47:28 GMT]]></title><description><![CDATA[<p>boost0r schrieb:</p>
<blockquote>
<pre><code class="language-cpp">std::for_each(stringVec.begin,
                   stringVec.end,
                   boost::bind(&amp;Klasse::Show, _1);

...

void Klasse::Show(std::string var)
{ ... }
</code></pre>
</blockquote>
<p>Show ist eine nicht-statische Elementfunktion, die einem Parameter bekommt. Um so eine Funktion allerdings aufrufen zu können, brauchst man auch das entsprechende <code>Klasse</code> -Objekt dafür. Der bind-Aufruf muss daher 3 Parameter bekommen: den Elementfunktionszeiger, einen Objekt-Zeiger/Referenz (oder Platzhalter dafür) und einen String-Parameter (oder Platzhalter dafür).</p>
<p>Gruß,<br />
SP</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1801227</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1801227</guid><dc:creator><![CDATA[Sebastian Pizer]]></dc:creator><pubDate>Sat, 31 Oct 2009 15:47:28 GMT</pubDate></item><item><title><![CDATA[Reply to boost::bind on Sat, 31 Oct 2009 15:52:35 GMT]]></title><description><![CDATA[<p>wenn ich es so mache wie von pupsboost gezeigt, dann kommt:</p>
<blockquote>
<p>Unhandled exception at 0x00312d59 in test.exe: 0xC00000FD: Stack overflow.</p>
</blockquote>
<p>und zeigt mir folgende zeile aus der xutility an:</p>
<pre><code>{	// cut ties with parent
		if (_Mycont != 0 &amp;&amp; _Mycont-&gt;_Myfirstiter != _IGNORE_MYITERLIST)
</code></pre>
<p>danke schonmal</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1801229</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1801229</guid><dc:creator><![CDATA[boost0r]]></dc:creator><pubDate>Sat, 31 Oct 2009 15:52:35 GMT</pubDate></item><item><title><![CDATA[Reply to boost::bind on Sat, 31 Oct 2009 16:49:52 GMT]]></title><description><![CDATA[<p>*push*</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1801273</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1801273</guid><dc:creator><![CDATA[boost0r]]></dc:creator><pubDate>Sat, 31 Oct 2009 16:49:52 GMT</pubDate></item><item><title><![CDATA[Reply to boost::bind on Sat, 31 Oct 2009 17:08:16 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">class Klasse{
public:
	void Klasse::Show(std::string const &amp; var) {
		std::cout&lt;&lt;var&lt;&lt;std::endl;
	}
};

int main()
{
	Klasse kl;
	std::vector&lt;std::string&gt; stringVec;
	stringVec.push_back(&quot;aaa&quot;);
	stringVec.push_back(&quot;vvv&quot;);
	std::for_each(stringVec.begin(),
                   stringVec.end(),
                   boost::bind(&amp;Klasse::Show, kl, _1)); 
}
</code></pre>
<p>Geht ohne Probleme</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1801279</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1801279</guid><dc:creator><![CDATA[pupsBoost]]></dc:creator><pubDate>Sat, 31 Oct 2009 17:08:16 GMT</pubDate></item></channel></rss>