<?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::pair in ofstream speichern]]></title><description><![CDATA[<p>Hallo</p>
<p>Wie kann man dies relisieren:</p>
<pre><code class="language-cpp">ofstream m_FiletoWriteIn;
std::pair&lt;std::string, int &gt; m_PairHighscore;
m_FileToWriteIn&lt;&lt;m_pairHighscore&lt;&lt;std::endl;
</code></pre>
<p>Ich bekomme immer die Fehlermeldung:</p>
<blockquote>
<p>error C2679: binary '&lt;&lt;' : no operator found which takes a right-hand operand of type 'std::pair&lt;_Ty1,_Ty2&gt;' (or there is no acceptable conversion)<br />
with<br />
[<br />
_Ty1=std::string,<br />
_Ty2=int<br />
]</p>
</blockquote>
<p>Danke für eure Hilfe</p>
<p>chrische</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/126480/std-pair-in-ofstream-speichern</link><generator>RSS for Node</generator><lastBuildDate>Mon, 24 Aug 2026 17:44:56 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/126480.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 15 Nov 2005 17:46:46 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to std::pair in ofstream speichern on Tue, 15 Nov 2005 17:46:46 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Wie kann man dies relisieren:</p>
<pre><code class="language-cpp">ofstream m_FiletoWriteIn;
std::pair&lt;std::string, int &gt; m_PairHighscore;
m_FileToWriteIn&lt;&lt;m_pairHighscore&lt;&lt;std::endl;
</code></pre>
<p>Ich bekomme immer die Fehlermeldung:</p>
<blockquote>
<p>error C2679: binary '&lt;&lt;' : no operator found which takes a right-hand operand of type 'std::pair&lt;_Ty1,_Ty2&gt;' (or there is no acceptable conversion)<br />
with<br />
[<br />
_Ty1=std::string,<br />
_Ty2=int<br />
]</p>
</blockquote>
<p>Danke für eure Hilfe</p>
<p>chrische</p>
]]></description><link>https://www.c-plusplus.net/forum/post/918504</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/918504</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Tue, 15 Nov 2005 17:46:46 GMT</pubDate></item><item><title><![CDATA[Reply to std::pair in ofstream speichern on Tue, 15 Nov 2005 17:54:05 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>Machs halt nacheinander.</p>
<pre><code class="language-cpp">m_FileToWriteIn &lt;&lt; m_pairHighscore.first &lt;&lt; &quot; &quot; &lt;&lt; m_pairHighscore.second &lt;&lt; std::endl;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/918516</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/918516</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Tue, 15 Nov 2005 17:54:05 GMT</pubDate></item><item><title><![CDATA[Reply to std::pair in ofstream speichern on Tue, 15 Nov 2005 17:59:24 GMT]]></title><description><![CDATA[<p>du könntest dir eventuell auch den operator&lt;&lt; überladen für pair ganz allgemein</p>
<pre><code class="language-cpp">template &lt;class T, class U&gt;
std::ostream&amp; operator&lt;&lt; (std::ostream&amp; out, std::pair&lt;T,U&gt; const&amp; p)
{
   return out &lt;&lt; p.first &lt;&lt; ' ' &lt;&lt; p.second; //hier kommt es drauf an, wie du die daten letztendlich dann ausgegeben haben möchtest
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/918524</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/918524</guid><dc:creator><![CDATA[davie]]></dc:creator><pubDate>Tue, 15 Nov 2005 17:59:24 GMT</pubDate></item></channel></rss>