<?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[Preprocessor: Ersetzungen in Raw-Strings]]></title><description><![CDATA[<p>Hallo Leute,</p>
<p>kann ich dem Preprocessor per Flag o.ä. mitteilen, dass defines auch innerhalb von Raw-Strings ersetzen, z.B:</p>
<pre><code>#define TIER Hund

// ...

R&quot;( 
  Das Tier ist ein TIER
)&quot;;

// ...
</code></pre>
<p>Dabei soll der Code von Preprocessor so umgeformt werden:</p>
<pre><code>#define TIER Hund

// ...

R&quot;( 
  Das Tier ist ein Hund
)&quot;;

// ...
</code></pre>
<p>Danke und Gruß</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/333913/preprocessor-ersetzungen-in-raw-strings</link><generator>RSS for Node</generator><lastBuildDate>Sun, 26 Apr 2026 05:28:43 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/333913.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 10 Aug 2015 12:27:00 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Preprocessor: Ersetzungen in Raw-Strings on Mon, 10 Aug 2015 12:27:00 GMT]]></title><description><![CDATA[<p>Hallo Leute,</p>
<p>kann ich dem Preprocessor per Flag o.ä. mitteilen, dass defines auch innerhalb von Raw-Strings ersetzen, z.B:</p>
<pre><code>#define TIER Hund

// ...

R&quot;( 
  Das Tier ist ein TIER
)&quot;;

// ...
</code></pre>
<p>Dabei soll der Code von Preprocessor so umgeformt werden:</p>
<pre><code>#define TIER Hund

// ...

R&quot;( 
  Das Tier ist ein Hund
)&quot;;

// ...
</code></pre>
<p>Danke und Gruß</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2463257</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2463257</guid><dc:creator><![CDATA[Gast12345]]></dc:creator><pubDate>Mon, 10 Aug 2015 12:27:00 GMT</pubDate></item><item><title><![CDATA[Reply to Preprocessor: Ersetzungen in Raw-Strings on Mon, 10 Aug 2015 12:34:51 GMT]]></title><description><![CDATA[<p>Direkt im string nicht aber so kannst du es z.B. machen:</p>
<pre><code>#define TIER &quot;Hund&quot;
//...
const char *text = &quot;Das Tier ist ein &quot; TIER;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2463258</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2463258</guid><dc:creator><![CDATA[tierschützer]]></dc:creator><pubDate>Mon, 10 Aug 2015 12:34:51 GMT</pubDate></item><item><title><![CDATA[Reply to Preprocessor: Ersetzungen in Raw-Strings on Mon, 10 Aug 2015 12:45:55 GMT]]></title><description><![CDATA[<p>Das ist ganz einfach möglich mit einem constexpr string-replace.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2463260</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2463260</guid><dc:creator><![CDATA[21thcentury]]></dc:creator><pubDate>Mon, 10 Aug 2015 12:45:55 GMT</pubDate></item><item><title><![CDATA[Reply to Preprocessor: Ersetzungen in Raw-Strings on Mon, 10 Aug 2015 12:47:59 GMT]]></title><description><![CDATA[<p>Vielen Dank.</p>
<p>In Wirklichkeit betrachte ich einen wesentlich komplexeren Raw-String; dein Vorgeschlagenes Vorgehen ist zwar möglich, würde meinen Code aber sehr unleserlich machen.<br />
Gibt es keine Möglichkeit dem Preprocessor mitzuteilen, dass er (ganz naiv) auch in Strings ersetzen soll?</p>
<p>Grüße</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2463261</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2463261</guid><dc:creator><![CDATA[Gast12345]]></dc:creator><pubDate>Mon, 10 Aug 2015 12:47:59 GMT</pubDate></item><item><title><![CDATA[Reply to Preprocessor: Ersetzungen in Raw-Strings on Mon, 10 Aug 2015 12:49:13 GMT]]></title><description><![CDATA[<p>Hallo 21thcentury,</p>
<p>kannst du mir evtl. eine Minimalbeispiel zeigen?</p>
<p>Danke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2463263</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2463263</guid><dc:creator><![CDATA[Gast12345]]></dc:creator><pubDate>Mon, 10 Aug 2015 12:49:13 GMT</pubDate></item><item><title><![CDATA[Reply to Preprocessor: Ersetzungen in Raw-Strings on Mon, 10 Aug 2015 12:54:22 GMT]]></title><description><![CDATA[<p>Sind die Strings gleich lang?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2463266</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2463266</guid><dc:creator><![CDATA[Columbo]]></dc:creator><pubDate>Mon, 10 Aug 2015 12:54:22 GMT</pubDate></item><item><title><![CDATA[Reply to Preprocessor: Ersetzungen in Raw-Strings on Mon, 10 Aug 2015 12:57:39 GMT]]></title><description><![CDATA[<p>Hallo Arcoth,</p>
<p>nein, die Strings werden sich durch Ersetzung mittels der defines in der Länge unterscheiden.</p>
<p>Danke und Gruß</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2463267</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2463267</guid><dc:creator><![CDATA[Gast12345]]></dc:creator><pubDate>Mon, 10 Aug 2015 12:57:39 GMT</pubDate></item><item><title><![CDATA[Reply to Preprocessor: Ersetzungen in Raw-Strings on Mon, 10 Aug 2015 13:22:24 GMT]]></title><description><![CDATA[<p>Ganz pragmatisch?</p>
<pre><code class="language-cpp">#define xstr(x) str(x)
#define str(x) #x

#define Tier Hund

auto s = R&quot;(
  Das Tier ist ein )&quot; xstr(Tier) R&quot;(
)&quot;;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2463269</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2463269</guid><dc:creator><![CDATA[Furble Wurble]]></dc:creator><pubDate>Mon, 10 Aug 2015 13:22:24 GMT</pubDate></item><item><title><![CDATA[Reply to Preprocessor: Ersetzungen in Raw-Strings on Mon, 10 Aug 2015 13:29:28 GMT]]></title><description><![CDATA[<p>Gast12345 schrieb:</p>
<blockquote>
<p>Vielen Dank.</p>
<p>In Wirklichkeit betrachte ich einen wesentlich komplexeren Raw-String; dein Vorgeschlagenes Vorgehen ist zwar möglich, würde meinen Code aber sehr unleserlich machen.</p>
</blockquote>
<p>Warum? Ich seh jetzt da keinen großen unterschied um ehrlich zu sein. Kannst du mal ein beispiel geben das diese unleserlichkeit demonstriert?</p>
<p>Gast12345 schrieb:</p>
<blockquote>
<p>Gibt es keine Möglichkeit dem Preprocessor mitzuteilen, dass er (ganz naiv) auch in Strings ersetzen soll?</p>
</blockquote>
<p>Wie gesagt, nein. Zumindest nicht exakt so wie du das willst.</p>
<p>Es geht aber auch noch einfacher: CTRL-H (auch: &quot;replace all&quot;) im Texteditor deiner wahl.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2463271</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2463271</guid><dc:creator><![CDATA[tierschützer]]></dc:creator><pubDate>Mon, 10 Aug 2015 13:29:28 GMT</pubDate></item></channel></rss>