<?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[Find_if Problem...]]></title><description><![CDATA[<pre><code class="language-cpp">//Map mit vectoren
std::map&lt;std::string,std::vector&lt;CModul*&gt; &gt; m_lCombModuls;

//Compare Funktion
bool ifx(const CModul oScr, UINT iID) { oScr.ModID()==iID; }
//Zweiter versuch
//bool ifx(const CModul *pScr, UINT iID) { pScr-&gt;ModID()==iID; }

//Hier will ich checken, ob Vector eine Modul mit ein best. ID enthält
std::find_if(m_lCombModuls[strGroup].begin(),m_lCombModuls[strGroup].end(),std::bind2nd(ifx,iID));
</code></pre>
<p>Fehler:</p>
<pre><code>d:\Projekte\Scheduler\SchedulerV3\WorkflowStateEx2\WorkflowState\Modul.h(110): error C2784: 'std::binder2nd&lt;_Fn2&gt; std::bind2nd(const _Fn2 &amp;,const _Ty &amp;)' : could not deduce template argument for 'overloaded function type' from 'overloaded function type'
</code></pre>
<p>HILFE..</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/217495/find_if-problem</link><generator>RSS for Node</generator><lastBuildDate>Sat, 10 Oct 2026 15:53:16 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/217495.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 08 Jul 2008 08:21:40 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Find_if Problem... on Tue, 08 Jul 2008 08:21:40 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">//Map mit vectoren
std::map&lt;std::string,std::vector&lt;CModul*&gt; &gt; m_lCombModuls;

//Compare Funktion
bool ifx(const CModul oScr, UINT iID) { oScr.ModID()==iID; }
//Zweiter versuch
//bool ifx(const CModul *pScr, UINT iID) { pScr-&gt;ModID()==iID; }

//Hier will ich checken, ob Vector eine Modul mit ein best. ID enthält
std::find_if(m_lCombModuls[strGroup].begin(),m_lCombModuls[strGroup].end(),std::bind2nd(ifx,iID));
</code></pre>
<p>Fehler:</p>
<pre><code>d:\Projekte\Scheduler\SchedulerV3\WorkflowStateEx2\WorkflowState\Modul.h(110): error C2784: 'std::binder2nd&lt;_Fn2&gt; std::bind2nd(const _Fn2 &amp;,const _Ty &amp;)' : could not deduce template argument for 'overloaded function type' from 'overloaded function type'
</code></pre>
<p>HILFE..</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1543165</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1543165</guid><dc:creator><![CDATA[NixMehrBlick]]></dc:creator><pubDate>Tue, 08 Jul 2008 08:21:40 GMT</pubDate></item><item><title><![CDATA[Reply to Find_if Problem... on Tue, 08 Jul 2008 10:07:09 GMT]]></title><description><![CDATA[<p>Per Funktionsobjekt vielleicht?</p>
<pre><code class="language-cpp">struct ifx : std::binary_function&lt; CModul*, UINT, bool &gt;
{
	result_type operator()( first_argument_type lhs, second_argument_type rhs ) const
	{
		return lhs-&gt;ModID() == rhs;
	}
};
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1543251</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1543251</guid><dc:creator><![CDATA[David_pb]]></dc:creator><pubDate>Tue, 08 Jul 2008 10:07:09 GMT</pubDate></item><item><title><![CDATA[Reply to Find_if Problem... on Tue, 08 Jul 2008 11:23:35 GMT]]></title><description><![CDATA[<p>Wie sehen denn die nachfolgenden Erläuterungen des Compilers zu diesem Fehler auf? Falls ifx überladen ist, musst du die resultierende Mehrdeutigkeit manuell (per static_cast in den gewünschten Funktionstyp) auflösen.</p>
<pre><code class="language-cpp">std::find_if(m_lCombModuls[strGroup].begin(),m_lCombModuls[strGroup].end(),std::bind2nd(static_cast&lt;bool(&amp;)(CModul,UINT)&gt;(ifx),iID));
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1543319</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1543319</guid><dc:creator><![CDATA[camper]]></dc:creator><pubDate>Tue, 08 Jul 2008 11:23:35 GMT</pubDate></item><item><title><![CDATA[Reply to Find_if Problem... on Tue, 08 Jul 2008 11:39:18 GMT]]></title><description><![CDATA[<p>Wie soll das funktionieren? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f62e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_open_mouth"
      title=":open_mouth:"
      alt="😮"
    /> Alternativen wären evtl noch boost::bind (die Bibliothek unterstützt auch Funktionen) oder std::ptr_fun;</p>
<pre><code class="language-cpp">bool ifx( CModul* oScr, UINT iID) { return oScr-&gt;ModID()==iID; }
// ...
std::find_if(m_lCombModuls[strGroup].begin(),m_lCombModuls[strGroup].end(),std::bind2nd(std::ptr_fun( ifx ),iID));
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1543338</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1543338</guid><dc:creator><![CDATA[David_pb]]></dc:creator><pubDate>Tue, 08 Jul 2008 11:39:18 GMT</pubDate></item><item><title><![CDATA[Reply to Find_if Problem... on Tue, 08 Jul 2008 11:43:51 GMT]]></title><description><![CDATA[<p>oh stimmt, wir brauchen erst einen Adapter ... hab mich schon zu sehr an boost::bind gewöhnt</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1543347</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1543347</guid><dc:creator><![CDATA[camper]]></dc:creator><pubDate>Tue, 08 Jul 2008 11:43:51 GMT</pubDate></item></channel></rss>