<?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[repeat bei boost::assign verwenden]]></title><description><![CDATA[<p>Hi,</p>
<p>ich habe folgende Code-Blocks:</p>
<pre><code class="language-cpp">vector&lt;int&gt; v;
v += 1,repeat(10,4);
</code></pre>
<p>und</p>
<pre><code class="language-cpp">vector&lt;int&gt; w;
w += repeat(10,4);
</code></pre>
<p>Den ersten kann man kompilieren, der zweite meldet</p>
<pre><code class="language-cpp">g++ -c -o jphmm_interface.o jphmm_interface.cpp -Wall -O3 -DNDEBUG -I/home/ingo/libs/boost -I/home/ingo/libs/gsl/include
/home/ingo/libs/boost/boost/assign/list_inserter.hpp: In member function »void boost::assign_detail::call_push_back&lt;C&gt;::operator()(T) [with T = boost::assign_detail::repeater&lt;int&gt;, C = std::vector&lt;int, std::allocator&lt;int&gt; &gt;]«:
/home/ingo/libs/boost/boost/assign/list_inserter.hpp:272:   instantiated from »boost::assign::list_inserter&lt;Function, Argument&gt;&amp; boost::assign::list_inserter&lt;Function, Argument&gt;::operator()(const T&amp;) [with T = boost::assign_detail::repeater&lt;int&gt;, Function = boost::assign_detail::call_push_back&lt;std::vector&lt;int, std::allocator&lt;int&gt; &gt; &gt;, Argument = int]«
/home/ingo/libs/boost/boost/assign/std/vector.hpp:31:   instantiated from »boost::assign::list_inserter&lt;boost::assign_detail::call_push_back&lt;std::vector&lt;_Tp, _Alloc&gt; &gt;, V&gt; boost::assign::operator+=(std::vector&lt;_Tp, _Alloc&gt;&amp;, V2) [with V = int, A = std::allocator&lt;int&gt;, V2 = boost::assign_detail::repeater&lt;int&gt;]«
jphmm_interface.cpp:201:   instantiated from here
/home/ingo/libs/boost/boost/assign/list_inserter.hpp:68: Fehler: keine passende Funktion für Aufruf von »std::vector&lt;int, std::allocator&lt;int&gt; &gt;::push_back(boost::assign_detail::repeater&lt;int&gt;&amp;)«
/usr/include/c++/4.3/bits/stl_vector.h:686: Anmerkung: Kandidaten sind: void std::vector&lt;_Tp, _Alloc&gt;::push_back(const _Tp&amp;) [with _Tp = int, _Alloc = std::allocator&lt;int&gt;]
</code></pre>
<p>Weiss jemand, wie man hier repeat zu verwenden hat?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/243284/repeat-bei-boost-assign-verwenden</link><generator>RSS for Node</generator><lastBuildDate>Mon, 07 Sep 2026 20:24:07 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/243284.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 15 Jun 2009 07:53:20 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to repeat bei boost::assign verwenden on Mon, 15 Jun 2009 07:53:20 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>ich habe folgende Code-Blocks:</p>
<pre><code class="language-cpp">vector&lt;int&gt; v;
v += 1,repeat(10,4);
</code></pre>
<p>und</p>
<pre><code class="language-cpp">vector&lt;int&gt; w;
w += repeat(10,4);
</code></pre>
<p>Den ersten kann man kompilieren, der zweite meldet</p>
<pre><code class="language-cpp">g++ -c -o jphmm_interface.o jphmm_interface.cpp -Wall -O3 -DNDEBUG -I/home/ingo/libs/boost -I/home/ingo/libs/gsl/include
/home/ingo/libs/boost/boost/assign/list_inserter.hpp: In member function »void boost::assign_detail::call_push_back&lt;C&gt;::operator()(T) [with T = boost::assign_detail::repeater&lt;int&gt;, C = std::vector&lt;int, std::allocator&lt;int&gt; &gt;]«:
/home/ingo/libs/boost/boost/assign/list_inserter.hpp:272:   instantiated from »boost::assign::list_inserter&lt;Function, Argument&gt;&amp; boost::assign::list_inserter&lt;Function, Argument&gt;::operator()(const T&amp;) [with T = boost::assign_detail::repeater&lt;int&gt;, Function = boost::assign_detail::call_push_back&lt;std::vector&lt;int, std::allocator&lt;int&gt; &gt; &gt;, Argument = int]«
/home/ingo/libs/boost/boost/assign/std/vector.hpp:31:   instantiated from »boost::assign::list_inserter&lt;boost::assign_detail::call_push_back&lt;std::vector&lt;_Tp, _Alloc&gt; &gt;, V&gt; boost::assign::operator+=(std::vector&lt;_Tp, _Alloc&gt;&amp;, V2) [with V = int, A = std::allocator&lt;int&gt;, V2 = boost::assign_detail::repeater&lt;int&gt;]«
jphmm_interface.cpp:201:   instantiated from here
/home/ingo/libs/boost/boost/assign/list_inserter.hpp:68: Fehler: keine passende Funktion für Aufruf von »std::vector&lt;int, std::allocator&lt;int&gt; &gt;::push_back(boost::assign_detail::repeater&lt;int&gt;&amp;)«
/usr/include/c++/4.3/bits/stl_vector.h:686: Anmerkung: Kandidaten sind: void std::vector&lt;_Tp, _Alloc&gt;::push_back(const _Tp&amp;) [with _Tp = int, _Alloc = std::allocator&lt;int&gt;]
</code></pre>
<p>Weiss jemand, wie man hier repeat zu verwenden hat?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1726758</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1726758</guid><dc:creator><![CDATA[ingobulla]]></dc:creator><pubDate>Mon, 15 Jun 2009 07:53:20 GMT</pubDate></item><item><title><![CDATA[Reply to repeat bei boost::assign verwenden on Mon, 15 Jun 2009 09:39:36 GMT]]></title><description><![CDATA[<p><code>repeat</code> funktioniert nur innerhalb eines Boost.Assign Ausdruckes. Man kann es nicht alleinstehend verwenden. Es gibt allerdings ein paar hilfreiche Memberfunktionen im Rückgabetyp vom <code>boost::assign::list_of</code> :</p>
<pre><code class="language-cpp">#include &lt;boost/assign.hpp&gt;

#include &lt;vector&gt;

int main()
{
	using namespace boost::assign;

	std::vector&lt;int&gt; v = list_of&lt;int&gt;().repeat(10, 4);

	return 0;
}
</code></pre>
<p>Grüssli</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1726819</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1726819</guid><dc:creator><![CDATA[Dravere]]></dc:creator><pubDate>Mon, 15 Jun 2009 09:39:36 GMT</pubDate></item><item><title><![CDATA[Reply to repeat bei boost::assign verwenden on Wed, 10 Feb 2010 11:08:04 GMT]]></title><description><![CDATA[<p>Dravere schrieb:</p>
<blockquote>
<pre><code class="language-cpp">std::vector&lt;int&gt; v = list_of&lt;int&gt;().repeat(10, 4);
</code></pre>
</blockquote>
<p>Ich habe gerade festgestellt, dass das dazu fuehrt, dass v die Werte</p>
<pre><code>0 4 4 4 4 4 4 4 4 4 4
</code></pre>
<p>enthaelt.</p>
<p>Von daher: Weiss jemand, wie man das richtig (und moeglichst kurz) macht?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1853232</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1853232</guid><dc:creator><![CDATA[ingobulla]]></dc:creator><pubDate>Wed, 10 Feb 2010 11:08:04 GMT</pubDate></item><item><title><![CDATA[Reply to repeat bei boost::assign verwenden on Wed, 10 Feb 2010 19:12:20 GMT]]></title><description><![CDATA[<p>was möchtest du denn?<br />
den vektor einfach nur mit 10 werten füllen, die alle 4 sind?<br />
da gibts doch nen extra konstruktor für...</p>
<pre><code class="language-cpp">std::vector&lt;int&gt; arr(10, 4);

std::cout &lt;&lt; &quot;Inhalt:\r\n&quot;;
std::copy(arr.begin(), arr.end(), std::ostream_iterator&lt;char&gt;(std::cout, &quot;\r\n&quot;));
std::cout &lt;&lt; std::flush;
</code></pre>
<p>bb</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1853830</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1853830</guid><dc:creator><![CDATA[unskilled]]></dc:creator><pubDate>Wed, 10 Feb 2010 19:12:20 GMT</pubDate></item></channel></rss>