<?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[was heißt vector fehler?]]></title><description><![CDATA[<p>Hallo zusammen,</p>
<p>weils so schön ist, gleich noch was von mir. Ich habe folgende member variablen:<br />
MM.h</p>
<pre><code class="language-cpp">//stores for each provided handle the related index within
        //the storing area
        int handle_store[DSM_MM_MAX_STORING_AREAS];

        //stores for each TSA the actual read index
        //only used in case of a read operation
        int tsa_index[DSM_MM_MAX_STORING_AREAS];

        //simulates the FLASH temporary storing area, used to save reveived 
        //result set for a certain period of time
        //the maximum number of a resultset is:
        //max number of select vars +  max number of select aggs (2 values) and
        //three meta variables (id, geo, ts)
        std::vector&lt;int[DSM_RS_MAX_SIZE]&gt; tsa[DSM_MM_MAX_STORING_AREAS];
</code></pre>
<p><a href="http://MM.cc" rel="nofollow">MM.cc</a></p>
<pre><code class="language-cpp">/**
     * This method stores a resultset entry within a TSA. It simulates a
     * temporary FLASH storage.
     *
     * @param vals the values to store
     * @param length the length of the vals array
     * @param handle the handle to the storing area
     * the storage
     */
    void MemoryManager::storeInTSA(int* vals, int length, int handle) {

        int index = handle_store[handle];

        int cookie[DSM_RS_MAX_SIZE];
        //copy the resulset entry
        memcpy(&amp;cookie[0], vals, length);

        vector&lt;int[DSM_RS_MAX_SIZE]&gt;* v = &amp;tsa[index];
        v-&gt;push_back(cookie);

    }//End store
</code></pre>
<p>Und bekomme bei der v-&gt;push_back(cookie) Zeile folgende Fehlermeldung, welche mir leider komplett unverständlich ist:</p>
<pre><code>/Application/tinyDSM/dsmql/mm'
/usr/bin/g++34 -c -O2 -DNDEBUG=1   -DWITH_PARSIM -DWITH_NETBUILDER -g -I. -I../../../../../helpStructures -I../ -I../ast -I../mm -I~/omnetpp/include memorymanager.cc
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_construct.h: In function `void std::_Construct(_T1*, const _T2&amp;) [with _T1 = int[15], _T2 = int[15&rsqb;&rsqb;':
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_vector.h:560:   instantiated from `void std::vector&lt;_Tp, _Alloc&gt;::push_back(const _Tp&amp;) [with _Tp = int[15], _Alloc = std::allocator&lt;int[15]&gt;]'
memorymanager.cc:744:   instantiated from here
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_construct.h:81: Fehler: ISO-C++ verbietet Initialisierung eines Feldes mit Â»newÂ«
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/vector.tcc: In member function `void std::vector&lt;_Tp, _Alloc&gt;::_M_insert_aux(__gnu_cxx::__normal_iterator&lt;typename _Alloc::pointer, std::vector&lt;_Tp, _Alloc&gt; &gt;, const _Tp&amp;) [with _Tp = int[15], _Alloc = std::allocator&lt;int[15]&gt;]':
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_vector.h:564:   instantiated from `void std::vector&lt;_Tp, _Alloc&gt;::push_back(const _Tp&amp;) [with _Tp = int[15], _Alloc = std::allocator&lt;int[15]&gt;]'
memorymanager.cc:744:   instantiated from here
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/vector.tcc:234: Fehler: ungÃ¼ltige Initialisierung
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_vector.h:564:   instantiated from `void std::vector&lt;_Tp, _Alloc&gt;::push_back(const _Tp&amp;) [with _Tp = int[15], _Alloc = std::allocator&lt;int[15]&gt;]'
memorymanager.cc:744:   instantiated from here
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/vector.tcc:238: Fehler: ISO C++ forbids assignment of arrays
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algobase.h: In function `_BidirectionalIterator std::__copy_backward(_RandomAccessIterator, _RandomAccessIterator, _BidirectionalIterator, std::random_access_iterator_tag) [with _RandomAccessIterator = int (*)[15], _BidirectionalIterator = int (*)[15&rsqb;&rsqb;':
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algobase.h:396:   instantiated from `static _BidirectionalIterator2 std::__copy_backward_dispatch&lt;_BidirectionalIterator1, _BidirectionalIterator2, _BoolType&gt;::copy(_BidirectionalIterator1, _BidirectionalIterator1, _BidirectionalIterator2) [with _BidirectionalIterator1 = int (*)[15], _BidirectionalIterator2 = int (*)[15], _BoolType = __false_type]'
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algobase.h:429:   instantiated from `_BI2 std::__copy_backward_aux(_BI1, _BI1, _BI2) [with _BI1 = int (*)[15], _BI2 = int (*)[15&rsqb;&rsqb;'
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algobase.h:439:   instantiated from `_BI2 std::__copy_backward_output_normal_iterator(_BI1, _BI1, _BI2, __true_type) [with _BI1 = int (*)[15], _BI2 = __gnu_cxx::__normal_iterator&lt;int (*)[15], std::vector&lt;int[15], std::allocator&lt;int[15]&gt; &gt; &gt;]'
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algobase.h:453:   instantiated from `_BI2 std::__copy_backward_input_normal_iterator(_BI1, _BI1, _BI2, __true_type) [with _BI1 = __gnu_cxx::__normal_iterator&lt;int (*)[15], std::vector&lt;int[15], std::allocator&lt;int[15]&gt; &gt; &gt;, _BI2 = __gnu_cxx::__normal_iterator&lt;int (*)[15], std::vector&lt;int[15], std::allocator&lt;int[15]&gt; &gt; &gt;]'
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algobase.h:498:   instantiated from `_BI2 std::copy_backward(_BI1, _BI1, _BI2) [with _BI1 = __gnu_cxx::__normal_iterator&lt;int (*)[15], std::vector&lt;int[15], std::allocator&lt;int[15]&gt; &gt; &gt;, _BI2 = __gnu_cxx::__normal_iterator&lt;int (*)[15], std::vector&lt;int[15], std::allocator&lt;int[15]&gt; &gt; &gt;]'
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/vector.tcc:235:   instantiated from `void std::vector&lt;_Tp, _Alloc&gt;::_M_insert_aux(__gnu_cxx::__normal_iterator&lt;typename _Alloc::pointer, std::vector&lt;_Tp, _Alloc&gt; &gt;, const _Tp&amp;) [with _Tp = int[15], _Alloc = std::allocator&lt;int[15]&gt;]'
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_vector.h:564:   instantiated from `void std::vector&lt;_Tp, _Alloc&gt;::push_back(const _Tp&amp;) [with _Tp = int[15], _Alloc = std::allocator&lt;int[15]&gt;]'
memorymanager.cc:744:   instantiated from here
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algobase.h:380: Fehler: ISO C++ forbids assignment of arrays
gmake[8]: *** [memorymanager.o] Fehler 1
</code></pre>
<p>Und was soll mir das sagen? Ich will einfach den cookie dem Vektor an der stelle tsa[index] anfügen. Kompliert, irgendwie. Mh.</p>
<p>Uwe</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/241293/was-heißt-vector-fehler</link><generator>RSS for Node</generator><lastBuildDate>Mon, 21 Sep 2026 12:21:49 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/241293.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 18 May 2009 17:59:57 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to was heißt vector fehler? on Mon, 18 May 2009 17:59:57 GMT]]></title><description><![CDATA[<p>Hallo zusammen,</p>
<p>weils so schön ist, gleich noch was von mir. Ich habe folgende member variablen:<br />
MM.h</p>
<pre><code class="language-cpp">//stores for each provided handle the related index within
        //the storing area
        int handle_store[DSM_MM_MAX_STORING_AREAS];

        //stores for each TSA the actual read index
        //only used in case of a read operation
        int tsa_index[DSM_MM_MAX_STORING_AREAS];

        //simulates the FLASH temporary storing area, used to save reveived 
        //result set for a certain period of time
        //the maximum number of a resultset is:
        //max number of select vars +  max number of select aggs (2 values) and
        //three meta variables (id, geo, ts)
        std::vector&lt;int[DSM_RS_MAX_SIZE]&gt; tsa[DSM_MM_MAX_STORING_AREAS];
</code></pre>
<p><a href="http://MM.cc" rel="nofollow">MM.cc</a></p>
<pre><code class="language-cpp">/**
     * This method stores a resultset entry within a TSA. It simulates a
     * temporary FLASH storage.
     *
     * @param vals the values to store
     * @param length the length of the vals array
     * @param handle the handle to the storing area
     * the storage
     */
    void MemoryManager::storeInTSA(int* vals, int length, int handle) {

        int index = handle_store[handle];

        int cookie[DSM_RS_MAX_SIZE];
        //copy the resulset entry
        memcpy(&amp;cookie[0], vals, length);

        vector&lt;int[DSM_RS_MAX_SIZE]&gt;* v = &amp;tsa[index];
        v-&gt;push_back(cookie);

    }//End store
</code></pre>
<p>Und bekomme bei der v-&gt;push_back(cookie) Zeile folgende Fehlermeldung, welche mir leider komplett unverständlich ist:</p>
<pre><code>/Application/tinyDSM/dsmql/mm'
/usr/bin/g++34 -c -O2 -DNDEBUG=1   -DWITH_PARSIM -DWITH_NETBUILDER -g -I. -I../../../../../helpStructures -I../ -I../ast -I../mm -I~/omnetpp/include memorymanager.cc
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_construct.h: In function `void std::_Construct(_T1*, const _T2&amp;) [with _T1 = int[15], _T2 = int[15&rsqb;&rsqb;':
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_vector.h:560:   instantiated from `void std::vector&lt;_Tp, _Alloc&gt;::push_back(const _Tp&amp;) [with _Tp = int[15], _Alloc = std::allocator&lt;int[15]&gt;]'
memorymanager.cc:744:   instantiated from here
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_construct.h:81: Fehler: ISO-C++ verbietet Initialisierung eines Feldes mit Â»newÂ«
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/vector.tcc: In member function `void std::vector&lt;_Tp, _Alloc&gt;::_M_insert_aux(__gnu_cxx::__normal_iterator&lt;typename _Alloc::pointer, std::vector&lt;_Tp, _Alloc&gt; &gt;, const _Tp&amp;) [with _Tp = int[15], _Alloc = std::allocator&lt;int[15]&gt;]':
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_vector.h:564:   instantiated from `void std::vector&lt;_Tp, _Alloc&gt;::push_back(const _Tp&amp;) [with _Tp = int[15], _Alloc = std::allocator&lt;int[15]&gt;]'
memorymanager.cc:744:   instantiated from here
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/vector.tcc:234: Fehler: ungÃ¼ltige Initialisierung
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_vector.h:564:   instantiated from `void std::vector&lt;_Tp, _Alloc&gt;::push_back(const _Tp&amp;) [with _Tp = int[15], _Alloc = std::allocator&lt;int[15]&gt;]'
memorymanager.cc:744:   instantiated from here
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/vector.tcc:238: Fehler: ISO C++ forbids assignment of arrays
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algobase.h: In function `_BidirectionalIterator std::__copy_backward(_RandomAccessIterator, _RandomAccessIterator, _BidirectionalIterator, std::random_access_iterator_tag) [with _RandomAccessIterator = int (*)[15], _BidirectionalIterator = int (*)[15&rsqb;&rsqb;':
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algobase.h:396:   instantiated from `static _BidirectionalIterator2 std::__copy_backward_dispatch&lt;_BidirectionalIterator1, _BidirectionalIterator2, _BoolType&gt;::copy(_BidirectionalIterator1, _BidirectionalIterator1, _BidirectionalIterator2) [with _BidirectionalIterator1 = int (*)[15], _BidirectionalIterator2 = int (*)[15], _BoolType = __false_type]'
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algobase.h:429:   instantiated from `_BI2 std::__copy_backward_aux(_BI1, _BI1, _BI2) [with _BI1 = int (*)[15], _BI2 = int (*)[15&rsqb;&rsqb;'
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algobase.h:439:   instantiated from `_BI2 std::__copy_backward_output_normal_iterator(_BI1, _BI1, _BI2, __true_type) [with _BI1 = int (*)[15], _BI2 = __gnu_cxx::__normal_iterator&lt;int (*)[15], std::vector&lt;int[15], std::allocator&lt;int[15]&gt; &gt; &gt;]'
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algobase.h:453:   instantiated from `_BI2 std::__copy_backward_input_normal_iterator(_BI1, _BI1, _BI2, __true_type) [with _BI1 = __gnu_cxx::__normal_iterator&lt;int (*)[15], std::vector&lt;int[15], std::allocator&lt;int[15]&gt; &gt; &gt;, _BI2 = __gnu_cxx::__normal_iterator&lt;int (*)[15], std::vector&lt;int[15], std::allocator&lt;int[15]&gt; &gt; &gt;]'
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algobase.h:498:   instantiated from `_BI2 std::copy_backward(_BI1, _BI1, _BI2) [with _BI1 = __gnu_cxx::__normal_iterator&lt;int (*)[15], std::vector&lt;int[15], std::allocator&lt;int[15]&gt; &gt; &gt;, _BI2 = __gnu_cxx::__normal_iterator&lt;int (*)[15], std::vector&lt;int[15], std::allocator&lt;int[15]&gt; &gt; &gt;]'
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/vector.tcc:235:   instantiated from `void std::vector&lt;_Tp, _Alloc&gt;::_M_insert_aux(__gnu_cxx::__normal_iterator&lt;typename _Alloc::pointer, std::vector&lt;_Tp, _Alloc&gt; &gt;, const _Tp&amp;) [with _Tp = int[15], _Alloc = std::allocator&lt;int[15]&gt;]'
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_vector.h:564:   instantiated from `void std::vector&lt;_Tp, _Alloc&gt;::push_back(const _Tp&amp;) [with _Tp = int[15], _Alloc = std::allocator&lt;int[15]&gt;]'
memorymanager.cc:744:   instantiated from here
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algobase.h:380: Fehler: ISO C++ forbids assignment of arrays
gmake[8]: *** [memorymanager.o] Fehler 1
</code></pre>
<p>Und was soll mir das sagen? Ich will einfach den cookie dem Vektor an der stelle tsa[index] anfügen. Kompliert, irgendwie. Mh.</p>
<p>Uwe</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1712391</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1712391</guid><dc:creator><![CDATA[uwerothfeld]]></dc:creator><pubDate>Mon, 18 May 2009 17:59:57 GMT</pubDate></item><item><title><![CDATA[Reply to was heißt vector fehler? on Mon, 18 May 2009 18:06:56 GMT]]></title><description><![CDATA[<p>Ich behaupte das folgendes dein Problem ist:</p>
<pre><code class="language-cpp">std::vector&lt;int[DSM_RS_MAX_SIZE]&gt;
</code></pre>
<p>Ich sage nur C-Arrays... Besser das Array durch einen std::vector (Oder falls TR1 bei deinen Compiler schon verfügbar ist std::tr1::array aus &lt;array.h&gt;).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1712397</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1712397</guid><dc:creator><![CDATA[asc]]></dc:creator><pubDate>Mon, 18 May 2009 18:06:56 GMT</pubDate></item><item><title><![CDATA[Reply to was heißt vector fehler? on Mon, 18 May 2009 18:11:02 GMT]]></title><description><![CDATA[<p>Mh,</p>
<p>tr1 darf ich nicht verwenden, da nicht standard. eigentlich wollte ich mir die umkopiererei einfach machen, da ich ein c-array bekomme. auch soll ich einen pointer auf ein c-array zurückgeben, wenn dann die jeweiligen elemente im tsa ausgelesen werden. mh.</p>
<p>uwe</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1712399</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1712399</guid><dc:creator><![CDATA[uwerothfeld]]></dc:creator><pubDate>Mon, 18 May 2009 18:11:02 GMT</pubDate></item><item><title><![CDATA[Reply to was heißt vector fehler? on Mon, 18 May 2009 18:15:42 GMT]]></title><description><![CDATA[<p>Tja, da hast du aber das grosse Problem, dass man ein C Array nicht über den <code>operator =</code> kopieren kann. Boost darfst du wohl auch nicht benutzen? Also <code>boost::array</code> ?<br />
Dann nimm halt wirklich einen <code>std::vector</code> oder bau dir schnell selber ein <code>std::tr1::array</code> , abschauen kannst du bei Boost, bzw. so schwer ist es ja nicht <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>Grüssli</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1712405</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1712405</guid><dc:creator><![CDATA[Dravere]]></dc:creator><pubDate>Mon, 18 May 2009 18:15:42 GMT</pubDate></item><item><title><![CDATA[Reply to was heißt vector fehler? on Mon, 18 May 2009 19:02:12 GMT]]></title><description><![CDATA[<p>TR1 _ist_ Standard. Nur eben nicht verpflichtend, um sich ISO-konform nennen zu dürfen.</p>
<p>Davon abgesehen würde ein std::vector&lt;std::vector&lt;int&gt; &gt; Deine Semantik nicht unbedingt zerstören, da man bei vector auch einen Zeiger auf einen zusammenhängenden Speicherbereich (also ein Array) bekommt, und zwar über die Adresse des ersten Elements. Musst nur drauf achten, dass der innere Vektor immer groß genug ist.</p>
<pre><code class="language-cpp">int index = handle_store[handle];

// initialize vector and copy values
vector&lt;int&gt; cookie(vals, vals + length);
// resize vector to max. size, in case length &lt; max. size
cookie.resize(DSM_RS_MAX_SIZE);

tsa[index].push_back(cookie);

// oder, um Kopien zu vermeiden:
tsa[index].push_back(vector&lt;int&gt;());
tsa[index].assign(vals, vals + length);
tsa[index].resize(DSM_RS_MAX_SIZE);

// Und hier bekommst Du nen Zeiger auf das Array:
int* vals = &amp;tsa[index][0];
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1712423</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1712423</guid><dc:creator><![CDATA[LordJaxom]]></dc:creator><pubDate>Mon, 18 May 2009 19:02:12 GMT</pubDate></item><item><title><![CDATA[Reply to was heißt vector fehler? on Tue, 19 May 2009 07:14:41 GMT]]></title><description><![CDATA[<p>LordJaxom schrieb:</p>
<blockquote>
<p>...Musst nur drauf achten, dass der innere Vektor immer groß genug ist....</p>
</blockquote>
<p>... was ja bei Arrays auch so ist. <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="😉"
    /><br />
Also keine echte Einschränkung.</p>
<p>Gruß,</p>
<p>Simon2.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1712581</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1712581</guid><dc:creator><![CDATA[Simon2]]></dc:creator><pubDate>Tue, 19 May 2009 07:14:41 GMT</pubDate></item><item><title><![CDATA[Reply to was heißt vector fehler? on Tue, 19 May 2009 09:44:36 GMT]]></title><description><![CDATA[<p>Hallo zusammen,</p>
<p>das ist natürlich schon genial. Da merkt man, wer sich auskennt <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>Leider habe ich noch ein Problem, was ich nicht ganz verstehe:</p>
<pre><code class="language-cpp">Fehler: no matching function for call to `std::vector&lt;int, std::allocator&lt;int&gt; &gt;::push_back(std::vector&lt;int, std::allocator&lt;int&gt; &gt;&amp;)'
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_vector.h:557: 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>Dies betrifft die Stelle:</p>
<pre><code class="language-cpp">int index = handle_store[handle];

// initialize vector and copy values
vector&lt;int&gt; cookie(vals, vals + length);

// resize vector to max. size, in case length &lt; max. size
cookie.resize(DSM_RS_MAX_SIZE);

//store
tsa[index].push_back(cookie); // &lt;-------- fehler
</code></pre>
<p>Es heißt ja soviel wie die Typen passen nicht, oder? Ich habe tsa als:</p>
<pre><code class="language-cpp">std::vector&lt;std::vector&lt;int&gt; &gt; tsa;
</code></pre>
<p>also ein Vektor mit Int-Vektoren. Warum geht das nicht <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>
<p>Uwe</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1712680</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1712680</guid><dc:creator><![CDATA[uwerothfeld_]]></dc:creator><pubDate>Tue, 19 May 2009 09:44:36 GMT</pubDate></item><item><title><![CDATA[Reply to was heißt vector fehler? on Tue, 19 May 2009 09:50:47 GMT]]></title><description><![CDATA[<p>Simon2 schrieb:</p>
<blockquote>
<p>... was ja bei Arrays auch so ist. <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="😉"
    /><br />
Also keine echte Einschränkung.</p>
</blockquote>
<p>Naja, ein int[BLA_MAX_SIZE] wäre schon automatisch groß genug. Natürlich nur theoretisch, da das so ja nicht möglich ist. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1712684</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1712684</guid><dc:creator><![CDATA[LordJaxom]]></dc:creator><pubDate>Tue, 19 May 2009 09:50:47 GMT</pubDate></item><item><title><![CDATA[Reply to was heißt vector fehler? on Tue, 19 May 2009 11:08:48 GMT]]></title><description><![CDATA[<p>Hallo zusammen,</p>
<p>ich habe es jetzt so zum fliegen bekommen:</p>
<pre><code class="language-cpp">std::vector&lt;int&gt; tsa[DSM_MM_TSA_MAX];
</code></pre>
<pre><code class="language-cpp">void MemoryManager::storeInTSA(int* vals, int length, int handle) {

        int index = handle_store[handle];

        // initialize vector and copy values
        vector&lt;int&gt; cookie(vals, vals + length);

        // resize vector to max. size, in case length &lt; max. size
        cookie.resize(DSM_RS_MAX_SIZE);

        //store
        tsa[index]= cookie;

    }//End store
</code></pre>
<p>Ist das ok so, oder haben die Profis noch Verbesserungsvorschläge?<br />
Danke für Eure tolle Hilfe.</p>
<p>Uwe</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1712710</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1712710</guid><dc:creator><![CDATA[uwerothfeld]]></dc:creator><pubDate>Tue, 19 May 2009 11:08:48 GMT</pubDate></item><item><title><![CDATA[Reply to was heißt vector fehler? on Tue, 19 May 2009 11:50:49 GMT]]></title><description><![CDATA[<p>uwerothfeld schrieb:</p>
<blockquote>
<p>Ist das ok so, oder haben die Profis noch Verbesserungsvorschläge?</p>
</blockquote>
<p>Ja. Lass die zig redundanten Kommentare weg. Die Prämisse &quot;kommentiere viel und ausführlich&quot; ist veraltet und kommt aus den zeiten, wo variabelnnamen nur eine bestimmte Länge haben durften. Benenne lieber deine Variablen so, dass man schon aus dem Code leicht erkennen kann was passiert.<br />
Beispiel:</p>
<pre><code class="language-cpp">// resize vector to max. size, in case length &lt; max. size
        cookie.resize(DSM_RS_MAX_SIZE);
</code></pre>
<p>das ist genau das was resize tut, nicht nötig es nochmal drüber zu schreiben.</p>
<p>Zu viele überflüssige Kommentare sind eher eine Quelle der späteren Fehlinformation: In einem schnellen Bugfix wird mal eben die Zeile geändert, nicht aber der Kommentar. Das Resultat ist dass der Kommentar fortan Lügen über den Code beinhaltet.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1712734</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1712734</guid><dc:creator><![CDATA[pumuckl]]></dc:creator><pubDate>Tue, 19 May 2009 11:50:49 GMT</pubDate></item><item><title><![CDATA[Reply to was heißt vector fehler? on Tue, 19 May 2009 12:42:29 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ist ja völliger Blödsinn, den ich da gemacht habe. Also wieder zurück dass ganze. Ich habe also wieder:</p>
<pre><code class="language-cpp">std::vector&lt; std::vector&lt;int&gt; &gt;tsa;
</code></pre>
<p>und</p>
<pre><code class="language-cpp">int index = handle_store[handle];

// initialize vector and copy values
vector&lt;int&gt; cookie(vals, vals + length);

cookie.resize(DSM_RS_MAX_SIZE);

//store
tsa[index].push_back(cookie); //&lt;-- fehler
</code></pre>
<pre><code class="language-cpp">Fehler: no matching function for call to `std::vector&lt;int, std::allocator&lt;int&gt; &gt;::push_back(std::vector&lt;int, std::allocator&lt;int&gt; &gt;&amp;)'
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_vector.h:557: Anmerkung: Kandidaten sind: void std::vector&lt;_Tp, _Alloc&gt;::push_back(const _Tp&amp;) [with _Tp = int, _Alloc = std::allocator&lt;int&gt;]
gmake[8]: *** [memorymanager.o] Fehler 1
</code></pre>
<p>Überall wo ich google, klappt das aber so??? Jemand nen Tip? Bin am Durchdrehen.<br />
Uwe</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1712764</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1712764</guid><dc:creator><![CDATA[uwerothfeld]]></dc:creator><pubDate>Tue, 19 May 2009 12:42:29 GMT</pubDate></item><item><title><![CDATA[Reply to was heißt vector fehler? on Tue, 19 May 2009 12:45:33 GMT]]></title><description><![CDATA[<p>Verzichte auf den vector und arbeite mit dem int-Array</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1712765</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1712765</guid><dc:creator><![CDATA[C++Fan 2009]]></dc:creator><pubDate>Tue, 19 May 2009 12:45:33 GMT</pubDate></item><item><title><![CDATA[Reply to was heißt vector fehler? on Tue, 19 May 2009 12:47:50 GMT]]></title><description><![CDATA[<p>tsa ist ein ein vector&lt;vector&lt;int&gt; &gt;, damit ist tsa[i] ein vector&lt;int&gt;. Einem vector von int kann man ints hinzufügen, Du versuchst aber, ihm einen vector hinzuzufügen.</p>
<p>Hast Du da im Kopf eine Dimension zu viel?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1712767</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1712767</guid><dc:creator><![CDATA[LordJaxom]]></dc:creator><pubDate>Tue, 19 May 2009 12:47:50 GMT</pubDate></item><item><title><![CDATA[Reply to was heißt vector fehler? on Tue, 19 May 2009 22:01:09 GMT]]></title><description><![CDATA[<p>Hallo zusammen,</p>
<p>ich hatte nicht ne Dimension zu viel, sondern zu wenig!!! Ich wollte je handle ein vector, n int-arrays enthält, welches ich ja durch einen vector ersetzen. von daher:</p>
<pre><code class="language-cpp">std::vector&lt; std::vector&lt; std::vector&lt;int&gt; &gt; &gt;tsa;
</code></pre>
<p>Damit klappts! Vielen Dank für Eure HIlfe. Ihr ward wieder Gold wert.</p>
<p>Ich bin sehr begeistert. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /><br />
Uwe</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1713013</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1713013</guid><dc:creator><![CDATA[uwerothfeld]]></dc:creator><pubDate>Tue, 19 May 2009 22:01:09 GMT</pubDate></item><item><title><![CDATA[Reply to was heißt vector fehler? on Wed, 20 May 2009 07:48:48 GMT]]></title><description><![CDATA[<p>uwerothfeld schrieb:</p>
<blockquote>
<p>ich hatte nicht ne Dimension zu viel, sondern zu wenig!!! Ich wollte je handle ein vector, n int-arrays enthält, welches ich ja durch einen vector ersetzen. von daher</p>
</blockquote>
<p>Ich glaube aber, wenn ich mir deinen Anfangscode ansehe, das du vielleicht hiermit besser bedient wärst:</p>
<pre><code class="language-cpp">// Key: Handle
std::map&lt;int, std::vector&lt; std::vector&lt;int&gt; &gt; &gt;
</code></pre>
<p>Damit du direkt über das Handle die passende Liste bekommst...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1713136</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1713136</guid><dc:creator><![CDATA[asc]]></dc:creator><pubDate>Wed, 20 May 2009 07:48:48 GMT</pubDate></item></channel></rss>