<?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[eigene Struct mit Vector benutzen]]></title><description><![CDATA[<p>Hallo @ all,</p>
<p>also ich habe eine struct erstellt mit:<br />
struct CONNECTION<br />
{<br />
CServerSocket m_pClientSocket;<br />
int status;<br />
};</p>
<p>und will davon nun mit vector ein dynamisches array ertstellen über:</p>
<p>vector&lt;CONNECTION&gt;m_pConnections;</p>
<p>allerdings kommt dann immer folgende fehlermeldung:</p>
<p>error C2558: struct 'CONNECTION' : no copy constructor available or copy constructor is declared 'explicit'</p>
<p>wie kann ich ihm das beibringen???</p>
<p>danke im voraus für eure hilfe.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/122981/eigene-struct-mit-vector-benutzen</link><generator>RSS for Node</generator><lastBuildDate>Tue, 30 Jun 2026 08:22:21 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/122981.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 11 Oct 2005 21:23:29 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to eigene Struct mit Vector benutzen on Tue, 11 Oct 2005 21:23:29 GMT]]></title><description><![CDATA[<p>Hallo @ all,</p>
<p>also ich habe eine struct erstellt mit:<br />
struct CONNECTION<br />
{<br />
CServerSocket m_pClientSocket;<br />
int status;<br />
};</p>
<p>und will davon nun mit vector ein dynamisches array ertstellen über:</p>
<p>vector&lt;CONNECTION&gt;m_pConnections;</p>
<p>allerdings kommt dann immer folgende fehlermeldung:</p>
<p>error C2558: struct 'CONNECTION' : no copy constructor available or copy constructor is declared 'explicit'</p>
<p>wie kann ich ihm das beibringen???</p>
<p>danke im voraus für eure hilfe.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/890096</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/890096</guid><dc:creator><![CDATA[xyz44]]></dc:creator><pubDate>Tue, 11 Oct 2005 21:23:29 GMT</pubDate></item><item><title><![CDATA[Reply to eigene Struct mit Vector benutzen on Tue, 11 Oct 2005 21:33:08 GMT]]></title><description><![CDATA[<p>CServerSocket kann nicht kopiert werden, was bedeutet du kannst das dem vector gar nicht beibringen <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 />
Lösung 1: du gibst CServerSocket nen copy constructor<br />
Lösung 2: Du speicherst zeiger auf CONNECTION im verctor dann musst CServerSocket nicht kopieren</p>
]]></description><link>https://www.c-plusplus.net/forum/post/890103</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/890103</guid><dc:creator><![CDATA[CMatt]]></dc:creator><pubDate>Tue, 11 Oct 2005 21:33:08 GMT</pubDate></item><item><title><![CDATA[Reply to eigene Struct mit Vector benutzen on Tue, 11 Oct 2005 21:37:17 GMT]]></title><description><![CDATA[<p>ich würde boost::shared_ptr nehmen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/890106</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/890106</guid><dc:creator><![CDATA[www.boost.org]]></dc:creator><pubDate>Tue, 11 Oct 2005 21:37:17 GMT</pubDate></item><item><title><![CDATA[Reply to eigene Struct mit Vector benutzen on Tue, 11 Oct 2005 21:52:55 GMT]]></title><description><![CDATA[<p>jetzt kommen bestimmt ne menge buuuuhhhsss, aba wie gebe ich den CServerSocket nen Copy Constructor??? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/890122</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/890122</guid><dc:creator><![CDATA[xyz44]]></dc:creator><pubDate>Tue, 11 Oct 2005 21:52:55 GMT</pubDate></item><item><title><![CDATA[Reply to eigene Struct mit Vector benutzen on Tue, 11 Oct 2005 22:00:51 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">class CServerSocket
{
...

public:
  // copy constructur
  CServerSocket(const CServerSocket &amp;r)
  {
    // copiere r in die aktuellen instanz
  }

...

}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/890129</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/890129</guid><dc:creator><![CDATA[CMatt]]></dc:creator><pubDate>Tue, 11 Oct 2005 22:00:51 GMT</pubDate></item><item><title><![CDATA[Reply to eigene Struct mit Vector benutzen on Tue, 11 Oct 2005 22:08:58 GMT]]></title><description><![CDATA[<p>Den Copy-Constructor müsstest du dann aber mit einem Referenz-Zähler implementieren. Und dann kannste gleich boost::shared_ptr nehmen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/890133</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/890133</guid><dc:creator><![CDATA[boost.org]]></dc:creator><pubDate>Tue, 11 Oct 2005 22:08:58 GMT</pubDate></item><item><title><![CDATA[Reply to eigene Struct mit Vector benutzen on Wed, 12 Oct 2005 10:47:59 GMT]]></title><description><![CDATA[<p>Wieso so kompliziert?<br />
Nimm doch einfach einen Vektor von Zeigern auf CONNECTION structs</p>
<pre><code class="language-cpp">vector&lt;CONNECTION*&gt; m_pConnections;
</code></pre>
<p>Ist aus Performancegründen sowieso besser</p>
]]></description><link>https://www.c-plusplus.net/forum/post/890447</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/890447</guid><dc:creator><![CDATA[Rapha]]></dc:creator><pubDate>Wed, 12 Oct 2005 10:47:59 GMT</pubDate></item></channel></rss>