<?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[Namespaces]]></title><description><![CDATA[<p>Hier mal ein kleines Beispiel zur Verwendung von Namespaces innerhalb eines Moduls, das die Namespace &lt;compiler&gt; implementiert. Folgender Code sei &lt;<a href="http://main.cc" rel="nofollow">main.cc</a>&gt;, wobei die Funktion &lt;StartCompiler()&gt; static sein soll, also zusätzlich in einer anonymen Namespace deklariert und definiert ist. Mache ich es zu kompliziert (möchte keine using-Direktive verwenden) oder ist das so korrekt?</p>
<pre><code class="language-cpp">// Compiler declarations
namespace compiler {

// Local declarations
namespace {

int Start(int argc, char** argv);

}  // namespace

}  // namespace compiler

int main(int argc, char** argv) {
  return compiler::Start(argc, argv);
}

// Compiler definitions
namespace compiler {

// Local definitions
namespace {

int Start(int argc, char** argv) {
  return 0;
}

}  // namespace

}  // namespace compiler
</code></pre>
<p>Danke und Gruß,<br />
T.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/301806/namespaces</link><generator>RSS for Node</generator><lastBuildDate>Tue, 11 Aug 2026 18:28:27 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/301806.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 04 Apr 2012 08:45:59 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Namespaces on Wed, 04 Apr 2012 08:49:32 GMT]]></title><description><![CDATA[<p>Hier mal ein kleines Beispiel zur Verwendung von Namespaces innerhalb eines Moduls, das die Namespace &lt;compiler&gt; implementiert. Folgender Code sei &lt;<a href="http://main.cc" rel="nofollow">main.cc</a>&gt;, wobei die Funktion &lt;StartCompiler()&gt; static sein soll, also zusätzlich in einer anonymen Namespace deklariert und definiert ist. Mache ich es zu kompliziert (möchte keine using-Direktive verwenden) oder ist das so korrekt?</p>
<pre><code class="language-cpp">// Compiler declarations
namespace compiler {

// Local declarations
namespace {

int Start(int argc, char** argv);

}  // namespace

}  // namespace compiler

int main(int argc, char** argv) {
  return compiler::Start(argc, argv);
}

// Compiler definitions
namespace compiler {

// Local definitions
namespace {

int Start(int argc, char** argv) {
  return 0;
}

}  // namespace

}  // namespace compiler
</code></pre>
<p>Danke und Gruß,<br />
T.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2198584</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2198584</guid><dc:creator><![CDATA[Tomahawk]]></dc:creator><pubDate>Wed, 04 Apr 2012 08:49:32 GMT</pubDate></item><item><title><![CDATA[Reply to Namespaces on Wed, 04 Apr 2012 10:43:38 GMT]]></title><description><![CDATA[<p>Welchen Zweck soll der Compiler-Namespace um den Anonymen erfüllen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2198617</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2198617</guid><dc:creator><![CDATA[manni66]]></dc:creator><pubDate>Wed, 04 Apr 2012 10:43:38 GMT</pubDate></item><item><title><![CDATA[Reply to Namespaces on Wed, 04 Apr 2012 10:46:20 GMT]]></title><description><![CDATA[<p>manni66 schrieb:</p>
<blockquote>
<p>Welchen Zweck soll der Compiler-Namespace um den Anonymen erfüllen?</p>
</blockquote>
<p>vermutlich den gleichen, den ein using namespace compiler; innerhalb aller Funktionen des anonymen namespace hat - nichtqualifizierten Zugriff auf die Inhalte von compiler.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2198618</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2198618</guid><dc:creator><![CDATA[pumuckl]]></dc:creator><pubDate>Wed, 04 Apr 2012 10:46:20 GMT</pubDate></item><item><title><![CDATA[Reply to Namespaces on Wed, 04 Apr 2012 11:09:37 GMT]]></title><description><![CDATA[<p>pumuckl schrieb:</p>
<blockquote>
<p>manni66 schrieb:</p>
<blockquote>
<p>Welchen Zweck soll der Compiler-Namespace um den Anonymen erfüllen?</p>
</blockquote>
<p>vermutlich den gleichen, den ein using namespace compiler; innerhalb aller Funktionen des anonymen namespace hat - nichtqualifizierten Zugriff auf die Inhalte von compiler.</p>
</blockquote>
<p>Genau, es geht um das Vermeiden der Using-Direktive.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2198625</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2198625</guid><dc:creator><![CDATA[Tomahawk]]></dc:creator><pubDate>Wed, 04 Apr 2012 11:09:37 GMT</pubDate></item><item><title><![CDATA[Reply to Namespaces on Wed, 04 Apr 2012 12:20:07 GMT]]></title><description><![CDATA[<p>Eine IDE wird den nested namespace entsprechend einrücken. Meiner Meinung nach wird das Ganze dadurch nicht unbedingt schöner/übersichtlicher. Aber das ist sicherlich Ansichtssache ...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2198653</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2198653</guid><dc:creator><![CDATA[manni66]]></dc:creator><pubDate>Wed, 04 Apr 2012 12:20:07 GMT</pubDate></item></channel></rss>