<?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[std::bind2nd( ... AND ... )]]></title><description><![CDATA[<p>Hallo Forum:</p>
<p>Ich würde gerne mit std::find_if in einem std::vector eine Zahl finden, die zwischen 11 und 20 liegt.</p>
<p>Suche ich nur nach einer Bedingung, z.B. nach einer Zahl &gt; 11, geht dies wunderbar mit:</p>
<pre><code>std::vector&lt;short&gt;::iterator itEnd = std::find_if( Values.begin(), Values.end(), std::bind2nd( std::greater_equal&lt;short&gt;(), 11 ) );
</code></pre>
<p>Aber was mache ich, wenn ich 2 Bedingungen habe? Das hier kompiliert nicht:</p>
<pre><code>std::vector&lt;short&gt;::iterator itEnd = std::find_if( Values.begin(), Values.end(), std::bind2nd( std::greater_equal&lt;short&gt;(), 11 &amp; std::less&lt;short&gt;(), 20 );
</code></pre>
<p>Danke an alle!!</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/162591/std-bind2nd-and</link><generator>RSS for Node</generator><lastBuildDate>Sat, 12 Sep 2026 09:20:03 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/162591.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 20 Oct 2006 07:37:43 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to std::bind2nd( ... AND ... ) on Fri, 20 Oct 2006 07:37:43 GMT]]></title><description><![CDATA[<p>Hallo Forum:</p>
<p>Ich würde gerne mit std::find_if in einem std::vector eine Zahl finden, die zwischen 11 und 20 liegt.</p>
<p>Suche ich nur nach einer Bedingung, z.B. nach einer Zahl &gt; 11, geht dies wunderbar mit:</p>
<pre><code>std::vector&lt;short&gt;::iterator itEnd = std::find_if( Values.begin(), Values.end(), std::bind2nd( std::greater_equal&lt;short&gt;(), 11 ) );
</code></pre>
<p>Aber was mache ich, wenn ich 2 Bedingungen habe? Das hier kompiliert nicht:</p>
<pre><code>std::vector&lt;short&gt;::iterator itEnd = std::find_if( Values.begin(), Values.end(), std::bind2nd( std::greater_equal&lt;short&gt;(), 11 &amp; std::less&lt;short&gt;(), 20 );
</code></pre>
<p>Danke an alle!!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1158105</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1158105</guid><dc:creator><![CDATA[atlastraeger]]></dc:creator><pubDate>Fri, 20 Oct 2006 07:37:43 GMT</pubDate></item><item><title><![CDATA[Reply to std::bind2nd( ... AND ... ) on Fri, 20 Oct 2006 07:41:56 GMT]]></title><description><![CDATA[<p>Bastel Dir doch einfach ein eigenes Prädikat IsInRange(x,y) das sowas testen kann.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1158107</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1158107</guid><dc:creator><![CDATA[Jester]]></dc:creator><pubDate>Fri, 20 Oct 2006 07:41:56 GMT</pubDate></item><item><title><![CDATA[Reply to std::bind2nd( ... AND ... ) on Fri, 20 Oct 2006 07:42:37 GMT]]></title><description><![CDATA[<p>Dazu gibt es in der STL nichts entsprechendes, aber in verschiedenen Biliotheken gibt es compose()-Funktoren, mit denen du so eine Konstruktion nachbauen kannst (ein Beispiel findest du im Magazin unter <a href="http://c-plusplus.net/forum/viewtopic-var-t-is-150106.html" rel="nofollow">Aufbau der STL 3</a> - Kapitel 3.4 - den für dich benötigten compose_f_gx_hx kannst du analog dazu entwickeln).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1158108</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1158108</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Fri, 20 Oct 2006 07:42:37 GMT</pubDate></item></channel></rss>