<?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[&amp;quot;using&amp;quot; auf Objekt um es in den scope einzubinden möglich?]]></title><description><![CDATA[<p>Eine Funktionalität die ich ich aus Pascal kenne ist, dass man Objekte (Sei es struct oder class) in den namensraum (scope) einbinden kann.</p>
<p>Ein Beispiel wie ich es meine:</p>
<pre><code>struct A
{
 int x;
};

void irgendEineFunktion()
{
 A a;
 using a;
 x = 1;
}
</code></pre>
<p>Ist soetwas in der Art in C++ möglich?<br />
Denn mit using kann man anscheinend nur Namensräume oder Klassen, jedoch keine Objekte in den scope einbinden.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/326248/quot-using-quot-auf-objekt-um-es-in-den-scope-einzubinden-möglich</link><generator>RSS for Node</generator><lastBuildDate>Sat, 11 Jul 2026 05:20:53 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/326248.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 09 Jun 2014 05:57:21 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to &amp;quot;using&amp;quot; auf Objekt um es in den scope einzubinden möglich? on Mon, 09 Jun 2014 05:57:21 GMT]]></title><description><![CDATA[<p>Eine Funktionalität die ich ich aus Pascal kenne ist, dass man Objekte (Sei es struct oder class) in den namensraum (scope) einbinden kann.</p>
<p>Ein Beispiel wie ich es meine:</p>
<pre><code>struct A
{
 int x;
};

void irgendEineFunktion()
{
 A a;
 using a;
 x = 1;
}
</code></pre>
<p>Ist soetwas in der Art in C++ möglich?<br />
Denn mit using kann man anscheinend nur Namensräume oder Klassen, jedoch keine Objekte in den scope einbinden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2403053</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2403053</guid><dc:creator><![CDATA[Osbios]]></dc:creator><pubDate>Mon, 09 Jun 2014 05:57:21 GMT</pubDate></item><item><title><![CDATA[Reply to &amp;quot;using&amp;quot; auf Objekt um es in den scope einzubinden möglich? on Mon, 09 Jun 2014 06:20:53 GMT]]></title><description><![CDATA[<p>a ist doch schon im Scope von irgendEineFunktion. Vielleicht meinst du stattdessen using A::x;?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2403054</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2403054</guid><dc:creator><![CDATA[nwp3]]></dc:creator><pubDate>Mon, 09 Jun 2014 06:20:53 GMT</pubDate></item><item><title><![CDATA[Reply to &amp;quot;using&amp;quot; auf Objekt um es in den scope einzubinden möglich? on Mon, 09 Jun 2014 06:48:46 GMT]]></title><description><![CDATA[<p>Um den Unterschied nochmal zu verdeutlichen.</p>
<pre><code>void irgendEineFunktion()
{
 A a;
 a.x = 1;
}
</code></pre>
<pre><code>void irgendEineFunktion()
{
 A a;
 using a;
 x = 1;
}
</code></pre>
<p>Wenn man using auf namespaces anwendet kann man ja auch die ganze Unterstruktur einbinden:</p>
<pre><code>void irgendEineFunktion()
{
 std::cout &lt;&lt; &quot;bla&quot;;
}
</code></pre>
<pre><code>void irgendEineFunktion()
{
 using namespace std;
 cout &lt;&lt; &quot;bla&quot;;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2403055</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2403055</guid><dc:creator><![CDATA[Osbios]]></dc:creator><pubDate>Mon, 09 Jun 2014 06:48:46 GMT</pubDate></item><item><title><![CDATA[Reply to &amp;quot;using&amp;quot; auf Objekt um es in den scope einzubinden möglich? on Mon, 09 Jun 2014 07:02:54 GMT]]></title><description><![CDATA[<p>Nein, so etwas wie die <a href="http://www.delphibasics.co.uk/RTL.asp?Name=With" rel="nofollow">with</a>-Anweisung gibt es in C++ (und auch in C) nicht - man muß immer ein Objekt explizit bei jedem Zugriff angeben.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2403056</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2403056</guid><dc:creator><![CDATA[Th69]]></dc:creator><pubDate>Mon, 09 Jun 2014 07:02:54 GMT</pubDate></item><item><title><![CDATA[Reply to &amp;quot;using&amp;quot; auf Objekt um es in den scope einzubinden möglich? on Mon, 09 Jun 2014 07:12:49 GMT]]></title><description><![CDATA[<p>Th69 schrieb:</p>
<blockquote>
<p>Nein, so etwas wie die <a href="http://www.delphibasics.co.uk/RTL.asp?Name=With" rel="nofollow">with</a>-Anweisung gibt es in C++ (und auch in C) nicht</p>
</blockquote>
<p>Naja, man kann es künsteln:</p>
<pre><code>#define with(...) for( bool B65 = true; B65;) for( auto&amp;&amp; __VA_ARGS__; B65; B65 = false )
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2403057</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2403057</guid><dc:creator><![CDATA[Columbo]]></dc:creator><pubDate>Mon, 09 Jun 2014 07:12:49 GMT</pubDate></item><item><title><![CDATA[Reply to &amp;quot;using&amp;quot; auf Objekt um es in den scope einzubinden möglich? on Mon, 09 Jun 2014 07:29:05 GMT]]></title><description><![CDATA[<p>Arcoth schrieb:</p>
<blockquote>
<p>Th69 schrieb:</p>
<blockquote>
<p>Nein, so etwas wie die <a href="http://www.delphibasics.co.uk/RTL.asp?Name=With" rel="nofollow">with</a>-Anweisung gibt es in C++ (und auch in C) nicht</p>
</blockquote>
<p>Naja, man kann es künsteln:</p>
<pre><code>#define with(...) for( bool B65 = true; B65;) for( auto&amp;&amp; __VA_ARGS__; B65; B65 = false )
</code></pre>
</blockquote>
<p>Bitte mit Anwendungsbeispiel, damit man sehen kann, ob's den Auwand wert ist.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2403059</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2403059</guid><dc:creator><![CDATA[volkard]]></dc:creator><pubDate>Mon, 09 Jun 2014 07:29:05 GMT</pubDate></item><item><title><![CDATA[Reply to &amp;quot;using&amp;quot; auf Objekt um es in den scope einzubinden möglich? on Mon, 09 Jun 2014 12:02:26 GMT]]></title><description><![CDATA[<p>volkard schrieb:</p>
<blockquote>
<p>Arcoth schrieb:</p>
<blockquote>
<p>Th69 schrieb:</p>
<blockquote>
<p>Nein, so etwas wie die <a href="http://www.delphibasics.co.uk/RTL.asp?Name=With" rel="nofollow">with</a>-Anweisung gibt es in C++ (und auch in C) nicht</p>
</blockquote>
<p>Naja, man kann es künsteln:</p>
<pre><code>#define with(...) for( bool B65 = true; B65;) for( auto&amp;&amp; __VA_ARGS__; B65; B65 = false )
</code></pre>
</blockquote>
<p>Bitte mit Anwendungsbeispiel, damit man sehen kann, ob's den Auwand wert ist.</p>
</blockquote>
<p>Welchen Aufwand? Dass der Bezeichner <code>B65</code> nicht mehr verfügbar ist? Die absolut unplausible Möglichkeit dass der Compiler die Schleife nicht wegoptimiert?</p>
<pre><code>for( auto const&amp; motion : motions )
		with( n = motion.get_normal(), t = motion.get_tangent() )
		{
			/// Berechungen anstellen, die mehrfaches verwenden der Tangente und Normale erfordern
		}
</code></pre>
<p>Ich frage mich gerade ob es auch eine Definition mit range-based for gibt. Aber wie abspeichern? Durch <code>std::reference_wrapper</code> o.ä. klappt es nicht für rvalues...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2403101</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2403101</guid><dc:creator><![CDATA[Columbo]]></dc:creator><pubDate>Mon, 09 Jun 2014 12:02:26 GMT</pubDate></item><item><title><![CDATA[Reply to &amp;quot;using&amp;quot; auf Objekt um es in den scope einzubinden möglich? on Mon, 09 Jun 2014 13:08:43 GMT]]></title><description><![CDATA[<p>Das ersetzt aber gerade eben nicht die Delphi-Syntax.<br />
Bei dir muß man ja dann noch explizit einmalig jeden Member zuweisen.<br />
Nur zur Klarstellung, so müsste die Syntax aussehen:</p>
<pre><code class="language-cpp">A a;
with(a)
{
  x = 1;
}
</code></pre>
<p>In Delphi benutzt man diese Schreibweise hauptsächlich für die Zuweisung an Eigenschaften (properties).<br />
Und in C# z.B. gibt es für die Initialisierung eine ähnliche Möglichkeit:</p>
<pre><code class="language-csharp">A a = new A { X = 1 }; // X muß aber auch hier eine Eigenschaft sein
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2403109</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2403109</guid><dc:creator><![CDATA[Th69]]></dc:creator><pubDate>Mon, 09 Jun 2014 13:08:43 GMT</pubDate></item><item><title><![CDATA[Reply to &amp;quot;using&amp;quot; auf Objekt um es in den scope einzubinden möglich? on Mon, 09 Jun 2014 14:13:12 GMT]]></title><description><![CDATA[<p>Arcoth schrieb:</p>
<blockquote>
<p>volkard schrieb:</p>
<blockquote>
<p>Arcoth schrieb:</p>
<blockquote>
<p>Th69 schrieb:</p>
<blockquote>
<p>Nein, so etwas wie die <a href="http://www.delphibasics.co.uk/RTL.asp?Name=With" rel="nofollow">with</a>-Anweisung gibt es in C++ (und auch in C) nicht</p>
</blockquote>
<p>Naja, man kann es künsteln:</p>
<pre><code>#define with(...) for( bool B65 = true; B65;) for( auto&amp;&amp; __VA_ARGS__; B65; B65 = false )
</code></pre>
</blockquote>
<p>Bitte mit Anwendungsbeispiel, damit man sehen kann, ob's den Auwand wert ist.</p>
</blockquote>
<p>Welchen Aufwand?</p>
</blockquote>
<p>Den Aufwand, das neue Kunstrukt überhaupt zu lernen.</p>
<p>Arcoth schrieb:</p>
<blockquote>
<p>Dass der Bezeichner <code>B65</code> nicht mehr verfügbar ist? Die absolut unplausible Möglichkeit dass der Compiler die Schleife nicht wegoptimiert?</p>
</blockquote>
<p>Nee, aus B65 hätte man schon noch nen eindeutigen Namen basteln können, und daß0 der Compiler schummelt, davon mag ich gerade nicht ausgehen.</p>
<p>Arcoth schrieb:</p>
<blockquote>
<pre><code>for( auto const&amp; motion : motions )
		with( n = motion.get_normal(), t = motion.get_tangent() )
		{
			/// Berechungen anstellen, die mehrfaches verwenden der Tangente und Normale erfordern
		}
</code></pre>
</blockquote>
<pre><code>for( auto const&amp; motion : motions )
		{
			auto = motion.get_normal();
			auto t = motion.get_tangent();
			/// Berechungen anstellen, die mehrfaches verwenden der Tangente und Normale erfordern
		}
//da hat mir with gar nicht viel gebracht.
</code></pre>
<p>Hier scheint es was zu bringen.</p>
<pre><code>With UserHandler.GetUser.First.User
    .FirstName=&quot;Stefan&quot;
    .LastName=&quot;Karlsson&quot;
    .Age=&quot;39&quot;
    .Sex=&quot;Male&quot;
    .Occupation=&quot;Programmer&quot;
    .UserID=&quot;0&quot;
end with
</code></pre>
<p>Ob man in C++ häufiger so lange Initialisierungslisten hat oder ob man es abkürzen würde mit</p>
<pre><code>{
    auto&amp; u=UserHandler.GetUser.First.User;
    u.FirstName=&quot;Stefan&quot;;
    u.LastName=&quot;Karlsson&quot;;
    u.Age=&quot;39&quot;;
    u.Sex=&quot;Male&quot;;
    u.Occupation=&quot;Programmer&quot;;
    u.UserID=&quot;0&quot;;
}
</code></pre>
<p>weiß ich nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2403121</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2403121</guid><dc:creator><![CDATA[volkard]]></dc:creator><pubDate>Mon, 09 Jun 2014 14:13:12 GMT</pubDate></item><item><title><![CDATA[Reply to &amp;quot;using&amp;quot; auf Objekt um es in den scope einzubinden möglich? on Mon, 09 Jun 2014 14:29:01 GMT]]></title><description><![CDATA[<blockquote>
<p>Nee, aus B65 hätte man schon noch nen eindeutigen Namen basteln können</p>
</blockquote>
<p>Das war ausschließlich demonstrativ gewählt. Daher ist das kein Argument gegen die Idee an sich.</p>
<blockquote>
<p>daß der Compiler schummelt, davon mag ich gerade nicht ausgehen.</p>
</blockquote>
<p>Jedes Optimierungslevel bei Clang und GCC ab 1 optimiert die Schleife vollständig weg. Und Schummelei würde ich das nicht nennen. as-if.</p>
<p>Ich würde das in meinem Projekt auch nie nutzen. Es ist aber ganz witzig.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2403127</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2403127</guid><dc:creator><![CDATA[Columbo]]></dc:creator><pubDate>Mon, 09 Jun 2014 14:29:01 GMT</pubDate></item><item><title><![CDATA[Reply to &amp;quot;using&amp;quot; auf Objekt um es in den scope einzubinden möglich? on Mon, 09 Jun 2014 15:09:28 GMT]]></title><description><![CDATA[<p>Macros dieser Art vermeide ich. Die können oft zu fürchterlichen Fehlermeldungen führen wenn was nicht stimmt.</p>
<p>Also gibts keinen with Ersatz.<br />
Bleibt nur die nächst beste Methode es zu handhaben:</p>
<pre><code>struct langerStructName
{
 int x;
};

void funktionDerMacht(langerStructName &amp;mitNochLängerenVariablenNamen)
{
 langerStructName &amp;v = mitNochLängerenVariablenNamen;
 v.x = 1;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2403131</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2403131</guid><dc:creator><![CDATA[Osbios]]></dc:creator><pubDate>Mon, 09 Jun 2014 15:09:28 GMT</pubDate></item><item><title><![CDATA[Reply to &amp;quot;using&amp;quot; auf Objekt um es in den scope einzubinden möglich? on Mon, 09 Jun 2014 15:11:22 GMT]]></title><description><![CDATA[<p>Oder seit C++11:</p>
<pre><code>auto &amp;v = mitNochLängerenVariablenNamen;
</code></pre>
<p>Bzw.</p>
<pre><code>#define var auto&amp;&amp;

var v = mitNochLaengerenVariablenNamen;
</code></pre>
<p>Ich sollte weniger Metal hören, während ich hier antworte.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2403132</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2403132</guid><dc:creator><![CDATA[Columbo]]></dc:creator><pubDate>Mon, 09 Jun 2014 15:11:22 GMT</pubDate></item><item><title><![CDATA[Reply to &amp;quot;using&amp;quot; auf Objekt um es in den scope einzubinden möglich? on Mon, 09 Jun 2014 22:14:32 GMT]]></title><description><![CDATA[<p>Ist diese Syntax angenehm?</p>
<pre><code class="language-cpp">int main() {
  std::vector&lt;int&gt; v;
  WITH(v,
       push_back(1),
       push_back(2),
       resize(5,3));
  for (int i : v)
    printf(&quot;%d\n&quot;, i);
}
</code></pre>
<p><a href="http://ideone.com/UDdtBj" rel="nofollow">http://ideone.com/UDdtBj</a></p>
<pre><code class="language-cpp">#define CONCATENATE(arg1, arg2)  CONCATENATE1(arg1, arg2)
#define CONCATENATE1(arg1, arg2) CONCATENATE2(arg1, arg2)
#define CONCATENATE2(arg1, arg2) arg1##arg2

#define FOR_EACH_1(what, arg, x) what(arg, x)
#define FOR_EACH_2(what, arg, x, ...) what(arg, x) FOR_EACH_1(what, arg, __VA_ARGS__);
#define FOR_EACH_3(what, arg, x, ...) what(arg, x) FOR_EACH_2(what, arg, __VA_ARGS__);
#define FOR_EACH_4(what, arg, x, ...) what(arg, x) FOR_EACH_3(what, arg, __VA_ARGS__);
#define FOR_EACH_5(what, arg, x, ...) what(arg, x) FOR_EACH_4(what, arg, __VA_ARGS__);
#define FOR_EACH_6(what, arg, x, ...) what(arg, x) FOR_EACH_5(what, arg, __VA_ARGS__);
#define FOR_EACH_7(what, arg, x, ...) what(arg, x) FOR_EACH_6(what, arg, __VA_ARGS__);
#define FOR_EACH_8(what, arg, x, ...) what(arg, x) FOR_EACH_7(what, arg, __VA_ARGS__);

#define FOR_EACH_NARG(...) FOR_EACH_NARG_(__VA_ARGS__, FOR_EACH_RSEQ_N())
#define FOR_EACH_NARG_(...) FOR_EACH_ARG_N(__VA_ARGS__) 
#define FOR_EACH_ARG_N(_1, _2, _3, _4, _5, _6, _7, _8, N, ...) N 
#define FOR_EACH_RSEQ_N() 8, 7, 6, 5, 4, 3, 2, 1, 0

#define FOR_EACH_(N, what, arg, x, ...) CONCATENATE(FOR_EACH_, N)(what, arg, x, __VA_ARGS__)
#define FOR_EACH(what, arg, x, ...) FOR_EACH_(FOR_EACH_NARG(x, __VA_ARGS__), what, arg, x, __VA_ARGS__)

#define DO_WITH(var,action) var.action;
#define WITH(var, ...) ([&amp;]{ FOR_EACH(DO_WITH, var, __VA_ARGS__) }())
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2403200</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2403200</guid><dc:creator><![CDATA[kingofmacros]]></dc:creator><pubDate>Mon, 09 Jun 2014 22:14:32 GMT</pubDate></item><item><title><![CDATA[Reply to &amp;quot;using&amp;quot; auf Objekt um es in den scope einzubinden möglich? on Tue, 10 Jun 2014 17:21:30 GMT]]></title><description><![CDATA[<blockquote>
<p>Ist diese Syntax angenehm?</p>
</blockquote>
<p>Edit: Die Syntax ist akzeptabel* - nur ist deine Lösung furchtbar. Vor allem weil sie schon bei Templates aussteigen sollte. Aber auch, weil <code>WITH(v, push_back(1));</code> schon nicht mehr funktioniert.</p>
<p>Zeig erstmal die Boost.PP-Lösung.</p>
<p>* Es wird mit dieser Syntax jedoch das Template-Argument Problem nie gelöst.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2403334</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2403334</guid><dc:creator><![CDATA[Columbo]]></dc:creator><pubDate>Tue, 10 Jun 2014 17:21:30 GMT</pubDate></item><item><title><![CDATA[Reply to &amp;quot;using&amp;quot; auf Objekt um es in den scope einzubinden möglich? on Tue, 10 Jun 2014 18:53:45 GMT]]></title><description><![CDATA[<p>Lustig, dass man in C++ doch recht nahe an die ursprüngliche Syntax herankommt, wenn auch mit Einschränkungen.</p>
<p>Der Nutzen eines <code>with</code> -Schlüsselworts wäre mir allerdings viel zu klein, um so eine &quot;Lösung&quot; zu bemühen... Wenn ein ähnliches Feature nützlich ist, dann eher was in Richtung benannte Parameter à la Boost.Parameter, aber auch da steckt mir etwas viel schwarze Magie drin.</p>
<p>Für die Realität ist volkards letzter Code definitiv vorzuziehen -- nicht nur weil es ohne Probleme und in allen Fällen funktioniert, sondern weil auch andere C++-Programmierer den Code verstehen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2403355</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2403355</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Tue, 10 Jun 2014 18:53:45 GMT</pubDate></item><item><title><![CDATA[Reply to &amp;quot;using&amp;quot; auf Objekt um es in den scope einzubinden möglich? on Tue, 10 Jun 2014 19:13:01 GMT]]></title><description><![CDATA[<p>Eine simple Lösung die auch mit Template-Argument-Listen funktioniert ist</p>
<pre><code>#define BOOST_PP_VARIADICS 1 /// Für Clang. Boost.PP erlaubt Clang die variadic macros default-mäßig noch nicht
#include &lt;boost/preprocessor/list/for_each.hpp&gt;
#include &lt;boost/preprocessor/variadic/to_list.hpp&gt;

#define VARIADIC_IDENTITY( ... ) __VA_ARGS__
#define DO_CALL(_, d, call) (d). VARIADIC_IDENTITY call ;
#define WITH(d, ...) { BOOST_PP_LIST_FOR_EACH( DO_CALL, d, BOOST_PP_VARIADIC_TO_LIST(__VA_ARGS__)) }
</code></pre>
<p>Beispiel:</p>
<pre><code>#include &lt;iostream&gt;

struct A
{
	template&lt;int... i&gt;
	void f()
	{
		for(auto g : {i...})
			std::cout &lt;&lt; g &lt;&lt; ' ';
		std::cout &lt;&lt; std::endl;
	}
};

int main()
{
	A v;
	WITH( v,
	     (f&lt;4,5&gt;()),
	     (f&lt;51, 8, 7&gt;()) );
}
</code></pre>
<p>Warum das with-statement übrigens zu einem Ausdruck werden soll, ist mir unklar - ein compound-statement reicht doch?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2403359</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2403359</guid><dc:creator><![CDATA[Columbo]]></dc:creator><pubDate>Tue, 10 Jun 2014 19:13:01 GMT</pubDate></item><item><title><![CDATA[Reply to &amp;quot;using&amp;quot; auf Objekt um es in den scope einzubinden möglich? on Wed, 11 Jun 2014 21:55:36 GMT]]></title><description><![CDATA[<p>...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2403362</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2403362</guid><dc:creator><![CDATA[Swordfish]]></dc:creator><pubDate>Wed, 11 Jun 2014 21:55:36 GMT</pubDate></item><item><title><![CDATA[Reply to &amp;quot;using&amp;quot; auf Objekt um es in den scope einzubinden möglich? on Tue, 10 Jun 2014 19:13:58 GMT]]></title><description><![CDATA[<p>Swordfish schrieb:</p>
<blockquote>
<p>h4x0r! Mir graut's vor dir!</p>
</blockquote>
<p>Kann jemand dem Fisch mal eins mit dem Totschläger verpassen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2403363</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2403363</guid><dc:creator><![CDATA[Columbo]]></dc:creator><pubDate>Tue, 10 Jun 2014 19:13:58 GMT</pubDate></item><item><title><![CDATA[Reply to &amp;quot;using&amp;quot; auf Objekt um es in den scope einzubinden möglich? on Wed, 11 Jun 2014 21:55:42 GMT]]></title><description><![CDATA[<p>...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2403370</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2403370</guid><dc:creator><![CDATA[Swordfish]]></dc:creator><pubDate>Wed, 11 Jun 2014 21:55:42 GMT</pubDate></item><item><title><![CDATA[Reply to &amp;quot;using&amp;quot; auf Objekt um es in den scope einzubinden möglich? on Tue, 10 Jun 2014 19:41:49 GMT]]></title><description><![CDATA[<p>Swordfish schrieb:</p>
<blockquote>
<p>Vorsichtig. Ganz, ganz vorsichtig, h4x0r. § 26 StGB.</p>
</blockquote>
<p>Seit wann ist es rechtswidrig jemanden dazu anzustiften Fische zu töten? :p<br />
Dann müsste man ja alle Chefs von Fischerei betrieben verhaften.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2403372</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2403372</guid><dc:creator><![CDATA[Nathan]]></dc:creator><pubDate>Tue, 10 Jun 2014 19:41:49 GMT</pubDate></item><item><title><![CDATA[Reply to &amp;quot;using&amp;quot; auf Objekt um es in den scope einzubinden möglich? on Wed, 11 Jun 2014 21:55:49 GMT]]></title><description><![CDATA[<p>...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2403373</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2403373</guid><dc:creator><![CDATA[Swordfish]]></dc:creator><pubDate>Wed, 11 Jun 2014 21:55:49 GMT</pubDate></item><item><title><![CDATA[Reply to &amp;quot;using&amp;quot; auf Objekt um es in den scope einzubinden möglich? on Tue, 10 Jun 2014 19:47:51 GMT]]></title><description><![CDATA[<p>Swordfish schrieb:</p>
<blockquote>
<p>Fischereibetrieb schreibt man zusammen.</p>
</blockquote>
<p>Ja, tut man. Das war...<br />
Ach, egal.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2403374</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2403374</guid><dc:creator><![CDATA[Nathan]]></dc:creator><pubDate>Tue, 10 Jun 2014 19:47:51 GMT</pubDate></item><item><title><![CDATA[Reply to &amp;quot;using&amp;quot; auf Objekt um es in den scope einzubinden möglich? on Wed, 11 Jun 2014 21:55:57 GMT]]></title><description><![CDATA[<p>...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2403376</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2403376</guid><dc:creator><![CDATA[Swordfish]]></dc:creator><pubDate>Wed, 11 Jun 2014 21:55:57 GMT</pubDate></item><item><title><![CDATA[Reply to &amp;quot;using&amp;quot; auf Objekt um es in den scope einzubinden möglich? on Tue, 10 Jun 2014 20:39:48 GMT]]></title><description><![CDATA[<blockquote>
<p>Vorsichtig.</p>
</blockquote>
<p>Hihi, ein Möchtegern.</p>
<p>Kannst du mich fachlich noch übertreffen? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2403382</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2403382</guid><dc:creator><![CDATA[Columbo]]></dc:creator><pubDate>Tue, 10 Jun 2014 20:39:48 GMT</pubDate></item><item><title><![CDATA[Reply to &amp;quot;using&amp;quot; auf Objekt um es in den scope einzubinden möglich? on Wed, 11 Jun 2014 21:56:03 GMT]]></title><description><![CDATA[<p>...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2403389</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2403389</guid><dc:creator><![CDATA[Swordfish]]></dc:creator><pubDate>Wed, 11 Jun 2014 21:56:03 GMT</pubDate></item><item><title><![CDATA[Reply to &amp;quot;using&amp;quot; auf Objekt um es in den scope einzubinden möglich? on Tue, 10 Jun 2014 21:49:54 GMT]]></title><description><![CDATA[<p>Arcoth schrieb:</p>
<blockquote>
<blockquote>
<p>Ist diese Syntax angenehm?</p>
</blockquote>
<p>Edit: Die Syntax ist akzeptabel* - nur ist deine Lösung furchtbar. Vor allem weil sie schon bei Templates aussteigen sollte.</p>
</blockquote>
<p>Bitte genauer spezifizieren: Wer Methoden aufruft, bei denen zwei oder mehr Template-Argumente explizit angegeben werden müssen, hat unter Umständen Schwierigkeiten. Durchschnittliche Auftritte pro 1000 Zeilen Sourcecode: 0.00.</p>
<blockquote>
<p>Aber auch, weil <code>WITH(v, push_back(1));</code> schon nicht mehr funktioniert.</p>
</blockquote>
<p>Oh wie schrecklich, WITH mit einem Argument war der Hauptanwendungszweck!!!<br />
Lässt sich trivial anpassen, falls das wirklich jemand braucht.</p>
<blockquote>
<p>Zeig erstmal die Boost.PP-Lösung.</p>
</blockquote>
<p>Das bisschen Makrogedöns ist mit der Skriptsprache deiner Wahl (!=C++) mit einem Einzeiler generiert.</p>
<blockquote>
<p>* Es wird mit dieser Syntax jedoch das Template-Argument Problem nie gelöst.</p>
</blockquote>
<p>Methodenaufrufe mit expliziten Template-Argumenten (sogar Mehrzahl!) kommen so selten vor, dass dafür die Syntax im General Case zu verschlimmern nicht für mich nicht vertretbar ist.</p>
<p>Arcoth schrieb:</p>
<blockquote>
<p>Warum das with-statement übrigens zu einem Ausdruck werden soll, ist mir unklar - ein compound-statement reicht doch?</p>
</blockquote>
<p>Wegen dem im Gegensatz zu Template-Argumenten normalen Use-Case:</p>
<pre><code class="language-cpp">A v;
    if (rand()%2)
      WITH( v,
           (f&lt;4,5&gt;()),
           (f&lt;51, 8, 7&gt;()) ); // das Semikolon ist das Problem
    else
      WITH( v,
           (f&lt;4,6&gt;()),
           (f&lt;51, 5, 7&gt;()) );
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2403392</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2403392</guid><dc:creator><![CDATA[kingofmacros]]></dc:creator><pubDate>Tue, 10 Jun 2014 21:49:54 GMT</pubDate></item></channel></rss>