<?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[Fehler Meldung wegen Vektoriterator]]></title><description><![CDATA[<p>Was passt hier nicht?</p>
<pre><code class="language-cpp">double func(const vector&lt;double&gt; &amp;temp)
{
    double counter = 0;
    for(vector&lt;double&gt;::const_iterator start = temp.begin; start != temp.end(); ++start)
    {
        counter = counter + *start;
    }
    return counter;
}
</code></pre>
<blockquote>
<p>error: conversion from <code>&lt;unknown type&gt;' to non-scalar type</code>__gnu_cxx::__normal_iterator&lt;const double*, std::vector&lt;double, std::allocator&lt;double&gt; &gt; &gt;' requested</p>
</blockquote>
<p>MfG<br />
Stromberg</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/257400/fehler-meldung-wegen-vektoriterator</link><generator>RSS for Node</generator><lastBuildDate>Thu, 10 Sep 2026 13:36:54 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/257400.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 28 Dec 2009 00:30:03 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Fehler Meldung wegen Vektoriterator on Mon, 28 Dec 2009 00:30:03 GMT]]></title><description><![CDATA[<p>Was passt hier nicht?</p>
<pre><code class="language-cpp">double func(const vector&lt;double&gt; &amp;temp)
{
    double counter = 0;
    for(vector&lt;double&gt;::const_iterator start = temp.begin; start != temp.end(); ++start)
    {
        counter = counter + *start;
    }
    return counter;
}
</code></pre>
<blockquote>
<p>error: conversion from <code>&lt;unknown type&gt;' to non-scalar type</code>__gnu_cxx::__normal_iterator&lt;const double*, std::vector&lt;double, std::allocator&lt;double&gt; &gt; &gt;' requested</p>
</blockquote>
<p>MfG<br />
Stromberg</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1828731</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1828731</guid><dc:creator><![CDATA[Stromberg*]]></dc:creator><pubDate>Mon, 28 Dec 2009 00:30:03 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler Meldung wegen Vektoriterator on Mon, 28 Dec 2009 00:33:54 GMT]]></title><description><![CDATA[<p>Versuchs mal so:</p>
<pre><code class="language-cpp">for(vector&lt;double&gt;::const_iterator start = temp.begin, end_it = tmp.end(); start != end_it; ++start)
</code></pre>
<p>Vielleicht hat gcc ein Problem damit const_iterator mit iterator zu vergleichen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1828732</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1828732</guid><dc:creator><![CDATA[asdfasd]]></dc:creator><pubDate>Mon, 28 Dec 2009 00:33:54 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler Meldung wegen Vektoriterator on Mon, 28 Dec 2009 00:35:18 GMT]]></title><description><![CDATA[<p><em>Edit:<br />
ich seh grad, du hast die Klammern bei tmp.begin</em>*()** vergessen. Tippfehler?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1828733</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1828733</guid><dc:creator><![CDATA[asdfasd]]></dc:creator><pubDate>Mon, 28 Dec 2009 00:35:18 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler Meldung wegen Vektoriterator on Mon, 28 Dec 2009 09:42:16 GMT]]></title><description><![CDATA[<p>asdfasd schrieb:</p>
<blockquote>
<p><em>Edit:<br />
ich seh grad, du hast die Klammern bei tmp.begin</em>*()** vergessen.</p>
</blockquote>
<p>Das ist auch der Grund für die Fehlermeldung. begin ist überladen und referenziert beide Versionen, const und nicht-const. Deswegen schreibt der GCC auch etwas von &quot;&lt;unknown type&gt;&quot;. Aber eine viel sinnigere Fehlermeldung wäre gewesen: &quot;result of non-static element function access (&quot;begin&quot;) can only be used in combination with the function call operator&quot;. Das sagt zumindest der C++ Standard. Der GCC hat allerdings eine Erweiterung drin, die tmp.begin per reinterpret_cast zu einem &quot;normalen&quot; Funktionszeiger casten lässt, weswegen er tmp.begin ohne () erlaub.</p>
<p>Gruß,<br />
SP</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1828775</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1828775</guid><dc:creator><![CDATA[Sebastian Pizer]]></dc:creator><pubDate>Mon, 28 Dec 2009 09:42:16 GMT</pubDate></item></channel></rss>