<?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[error C2621]]></title><description><![CDATA[<pre><code>template &lt;class T&gt;
std::basic_string&lt;T, std::char_traits&lt;T&gt;, std::allocator&lt;T&gt;&gt; to_wstring(const std::string &amp;in)
{
	typename std::basic_string&lt;T, std::char_traits&lt;T&gt;, std::allocator&lt;T&gt;&gt;::size_type inLength = in.length();

	const std::ctype&lt;T&gt; *cType;
	cType = &amp;std::use_facet&lt;std::ctype&lt;T&gt; &gt;(std::locale());

	auto inSrc = in.c_str();

	std::vector&lt;T&gt; out(inLength);
	cType-&gt;widen(inSrc, inSrc + inLength, &amp;out[0]);

	return std::basic_string&lt;T, std::char_traits&lt;T&gt;, std::allocator&lt;T&gt;&gt;(&amp;out[0], inLength);
}
</code></pre>
<p>Das ist eine Funktion um einen std::string in einen std::wstring zu konvertieren. Ich weiß, der Code ist noch nicht sonderlich schön, mir geht es aber erstmal darum, dass er funktioniert.</p>
<p>Momentan bekomme ich folgende Fehlermeldung:</p>
<pre><code>error C2621: Element 'std::_String_val&lt;_Val_types&gt;::_Bxty::_Buf' von Union 'std::_String_val&lt;_Val_types&gt;::_Bxty' besitzt den Kopierkonstruktor
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/312344/error-c2621</link><generator>RSS for Node</generator><lastBuildDate>Sun, 02 Aug 2026 20:45:10 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/312344.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 02 Jan 2013 13:08:55 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to error C2621 on Wed, 02 Jan 2013 13:08:55 GMT]]></title><description><![CDATA[<pre><code>template &lt;class T&gt;
std::basic_string&lt;T, std::char_traits&lt;T&gt;, std::allocator&lt;T&gt;&gt; to_wstring(const std::string &amp;in)
{
	typename std::basic_string&lt;T, std::char_traits&lt;T&gt;, std::allocator&lt;T&gt;&gt;::size_type inLength = in.length();

	const std::ctype&lt;T&gt; *cType;
	cType = &amp;std::use_facet&lt;std::ctype&lt;T&gt; &gt;(std::locale());

	auto inSrc = in.c_str();

	std::vector&lt;T&gt; out(inLength);
	cType-&gt;widen(inSrc, inSrc + inLength, &amp;out[0]);

	return std::basic_string&lt;T, std::char_traits&lt;T&gt;, std::allocator&lt;T&gt;&gt;(&amp;out[0], inLength);
}
</code></pre>
<p>Das ist eine Funktion um einen std::string in einen std::wstring zu konvertieren. Ich weiß, der Code ist noch nicht sonderlich schön, mir geht es aber erstmal darum, dass er funktioniert.</p>
<p>Momentan bekomme ich folgende Fehlermeldung:</p>
<pre><code>error C2621: Element 'std::_String_val&lt;_Val_types&gt;::_Bxty::_Buf' von Union 'std::_String_val&lt;_Val_types&gt;::_Bxty' besitzt den Kopierkonstruktor
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2285312</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2285312</guid><dc:creator><![CDATA[to__wstring]]></dc:creator><pubDate>Wed, 02 Jan 2013 13:08:55 GMT</pubDate></item><item><title><![CDATA[Reply to error C2621 on Wed, 02 Jan 2013 13:13:18 GMT]]></title><description><![CDATA[<p>Schon mal<a href="http://en.cppreference.com/w/cpp/locale/wstring_convert" rel="nofollow"> <code>wstring_convert</code> </a>angeschaut?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2285314</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2285314</guid><dc:creator><![CDATA[ungemeinschoen]]></dc:creator><pubDate>Wed, 02 Jan 2013 13:13:18 GMT</pubDate></item><item><title><![CDATA[Reply to error C2621 on Wed, 02 Jan 2013 13:15:04 GMT]]></title><description><![CDATA[<p>laut fehler meldung hat eine union bei dir (verbotenerweise) einen kopierkonstruktor. aber das solltest ja schon selbst herausgefunden haben per google etc.</p>
<p>aber ein bisschen mehr der fehlermeldung wäre hübsch...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2285315</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2285315</guid><dc:creator><![CDATA[Skym0sh0]]></dc:creator><pubDate>Wed, 02 Jan 2013 13:15:04 GMT</pubDate></item></channel></rss>