<?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[Custom Allocator: function does not take 2 arguments?]]></title><description><![CDATA[<p>Mein allocator ('bridge_allocator') funktioniert mit LLVM/GCC, Visual C++ 2013 zickt aber irgendwie rum und ich kann mit der Fehlermeldung nichts anfangen. Konkret geht es um die <a href="http://www.cplusplus.com/reference/memory/allocator/construct/" rel="nofollow">construct-Methode</a>:</p>
<pre><code>error C2660: 'std::_Wrap_alloc&lt;bridge_allocator&lt;int&gt;&gt;::construct' : function does not take 2 arguments	C:\...\VC\include\vector	873
</code></pre>
<p>Ich habe alle möglichen Überladungen reinkopiert und trotzdem sagt er mir das.</p>
<pre><code>.
.
.
template&lt;typename U, typename... Args&gt;
void construct(U *, Args &amp;&amp;...);
template&lt;typename U, typename V&gt;
void construct(U, V); // zum testen
</code></pre>
<p>Es kompiliert nicht wenn ich bei einem vector push_back benutzen will, und der Code dort sieht so aus:</p>
<pre><code>void push_back(value_type&amp;&amp; _Val)
		{	// insert by moving into element at end
		if (_Inside(_STD addressof(_Val)))
			{	// push back an element
			size_type _Idx = _STD addressof(_Val) - this-&gt;_Myfirst;
			if (this-&gt;_Mylast == this-&gt;_Myend)
				_Reserve(1);
			_Orphan_range(this-&gt;_Mylast, this-&gt;_Mylast);
			this-&gt;_Getal().construct(this-&gt;_Mylast,
				_STD forward&lt;value_type&gt;(this-&gt;_Myfirst[_Idx]));
			++this-&gt;_Mylast;
			}
		else
			{	// push back a non-element
			if (this-&gt;_Mylast == this-&gt;_Myend)
				_Reserve(1);
			_Orphan_range(this-&gt;_Mylast, this-&gt;_Mylast);
			this-&gt;_Getal().construct(this-&gt;_Mylast,
				_STD forward&lt;value_type&gt;(_Val));
			++this-&gt;_Mylast;
			}
		}
</code></pre>
<p>Die Zeilen 9 und 18 rufen this-&gt;_Getal() auf; allerdings kommt dort nicht mein bridge_allocator raus, sondern ein _wrap_alloc&lt;bridge_allocator&lt;...&gt;&gt;. Ich denke, es müsste ja trotzdem gehen? Was habe ich vergessen?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/324877/custom-allocator-function-does-not-take-2-arguments</link><generator>RSS for Node</generator><lastBuildDate>Mon, 13 Jul 2026 22:01:13 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/324877.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 06 Apr 2014 09:57:09 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Custom Allocator: function does not take 2 arguments? on Sun, 06 Apr 2014 09:57:09 GMT]]></title><description><![CDATA[<p>Mein allocator ('bridge_allocator') funktioniert mit LLVM/GCC, Visual C++ 2013 zickt aber irgendwie rum und ich kann mit der Fehlermeldung nichts anfangen. Konkret geht es um die <a href="http://www.cplusplus.com/reference/memory/allocator/construct/" rel="nofollow">construct-Methode</a>:</p>
<pre><code>error C2660: 'std::_Wrap_alloc&lt;bridge_allocator&lt;int&gt;&gt;::construct' : function does not take 2 arguments	C:\...\VC\include\vector	873
</code></pre>
<p>Ich habe alle möglichen Überladungen reinkopiert und trotzdem sagt er mir das.</p>
<pre><code>.
.
.
template&lt;typename U, typename... Args&gt;
void construct(U *, Args &amp;&amp;...);
template&lt;typename U, typename V&gt;
void construct(U, V); // zum testen
</code></pre>
<p>Es kompiliert nicht wenn ich bei einem vector push_back benutzen will, und der Code dort sieht so aus:</p>
<pre><code>void push_back(value_type&amp;&amp; _Val)
		{	// insert by moving into element at end
		if (_Inside(_STD addressof(_Val)))
			{	// push back an element
			size_type _Idx = _STD addressof(_Val) - this-&gt;_Myfirst;
			if (this-&gt;_Mylast == this-&gt;_Myend)
				_Reserve(1);
			_Orphan_range(this-&gt;_Mylast, this-&gt;_Mylast);
			this-&gt;_Getal().construct(this-&gt;_Mylast,
				_STD forward&lt;value_type&gt;(this-&gt;_Myfirst[_Idx]));
			++this-&gt;_Mylast;
			}
		else
			{	// push back a non-element
			if (this-&gt;_Mylast == this-&gt;_Myend)
				_Reserve(1);
			_Orphan_range(this-&gt;_Mylast, this-&gt;_Mylast);
			this-&gt;_Getal().construct(this-&gt;_Mylast,
				_STD forward&lt;value_type&gt;(_Val));
			++this-&gt;_Mylast;
			}
		}
</code></pre>
<p>Die Zeilen 9 und 18 rufen this-&gt;_Getal() auf; allerdings kommt dort nicht mein bridge_allocator raus, sondern ein _wrap_alloc&lt;bridge_allocator&lt;...&gt;&gt;. Ich denke, es müsste ja trotzdem gehen? Was habe ich vergessen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2392995</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2392995</guid><dc:creator><![CDATA[*rant*]]></dc:creator><pubDate>Sun, 06 Apr 2014 09:57:09 GMT</pubDate></item><item><title><![CDATA[Reply to Custom Allocator: function does not take 2 arguments? on Sun, 06 Apr 2014 10:29:01 GMT]]></title><description><![CDATA[<p>Könnte ein bug sein, frag mal <a href="http://nuwen.net/stl.html" rel="nofollow">http://nuwen.net/stl.html</a> (ganz runter scrollen da stehen seine E-Mail Adressen). <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="😉"
    /> Du willst ihm allerdings vermutlich ein kompilierbares Minimalbeispiel geben. (Das würde auch uns helfen.)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2393000</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2393000</guid><dc:creator><![CDATA[cooky451]]></dc:creator><pubDate>Sun, 06 Apr 2014 10:29:01 GMT</pubDate></item><item><title><![CDATA[Reply to Custom Allocator: function does not take 2 arguments? on Sun, 06 Apr 2014 20:29:18 GMT]]></title><description><![CDATA[<p>Sehr spannend der Typ. Werde ihn vielleicht mal anschreiben, aber dafür brauche ich wie gesagt ein Beispiel. Werde mal versuchen, das alles isoliert aufzubereiten. Komisch trotzdem, dass mein Allocator nicht direkt genutzt wird.</p>
<p>Danke für den Link <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /></p>
<p>$Edit: Ich habe einige Sachen umgestellt und jetzt gibts nur noch <em>fatal error C1001: An internal error has occurred in the compiler (compiler file 'msc1.cpp', line 1325)</em>. Beim LLVM läuft eine ganze Batterie an Tests problemlos durch. Vielleicht sollte ich die neuste Preview installieren <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2393076</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2393076</guid><dc:creator><![CDATA[*rant*]]></dc:creator><pubDate>Sun, 06 Apr 2014 20:29:18 GMT</pubDate></item></channel></rss>