<?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[Analoge Literaren - guter Stil?]]></title><description><![CDATA[<p>Ich finde, das ist eine sehr gute Möglichkeit den semantischen Wert einer Variable deutlicher lesbar darzustellen:</p>
<pre><code class="language-cpp">#include &quot;analogliterals.hpp&quot;
#include &lt;cassert&gt;

int main ()
{
  using namespace analog_literals::symbols;

  unsigned int a = 4;

  unsigned int b = I---------I;

  assert( a == b );

  assert( I-I == 0 );
  assert( I---I == 1 );
  assert( I-----I == 2 );
  assert( I-------I == 3 );

  unsigned int c = ( o-----o
                     |     !
                     !     !
                     !     !
                     o-----o ).area;

  assert( c == (I-----I) * (I-------I) );

  assert( ( o-----o
            |     !
            !     !
            !     !
            !     !
            o-----o ).area == ( o---------o
                                |         !
                                !         !
                                o---------o ).area );

  assert( ( o-------------o
            |L             \
            | L             \
            |  L             \
            |   o-------------o
            |   !             !
            !   !             !
            o   |             !
             L  |             !
              L |             !
               L|             !
                o-------------o ).volume == ( o-------------o
                                              |             !
                                              !             !
                                              !             !
                                              o-------------o ).area * int(I-------------I) );

  assert( top( o-------o
               |L       \
               | L       \
               |  o-------o
               |  !       !
               !  !       !
               o  |       !
                L |       !
                 L|       !
                  o-------o ) == ( o-------o
                                   |       !
                                   !       !
                                   o-------o ) );

  analog_literals::rectangle&lt;4, 2&gt; r = o---------o
                                       |         !
                                       !         !
                                       o---------o;

}
</code></pre>
<p>und analog_literals.hpp:</p>
<pre><code class="language-cpp">#ifndef ANALOGLITERALS_HPP
#define ANALOGLITERALS_HPP

namespace analog_literals {

typedef unsigned int uint;

  enum line_end { o, I };
  enum Lsymbol { L };

  struct eLsymbol {};
  eLsymbol operator! (Lsymbol) { return eLsymbol(); }

  struct gen { template &lt;typename T&gt; operator T () const { return T(); } };

  template &lt;typename T, uint n&gt; struct excls { excls&lt;T, n + 1&gt; operator! () const { return gen(); } };

  template &lt;typename T, uint n&gt; struct dashes: excls&lt;dashes&lt;T, n&gt;, 0&gt;
  { dashes&lt;T, n + 1&gt; operator-- (int) const { return gen(); } };

  template &lt;typename, uint&gt; struct L_symbols {}; 
  template &lt;typename T, uint n&gt; L_symbols&lt;T, n + 1&gt; operator| (L_symbols&lt;T, n&gt;, Lsymbol) { return gen(); }

  template &lt;typename, uint&gt; struct eL_symbols {}; 
  template &lt;typename T, uint n&gt; eL_symbols&lt;T, n + 1&gt; operator| (eL_symbols&lt;T, n&gt;, eLsymbol) { return gen(); }

  dashes&lt;line_end, 1&gt; operator-- (line_end, int) { return gen(); }
  excls&lt;line_end, 1&gt; operator! (line_end) { return gen(); }

  template &lt;uint len&gt; struct line: L_symbols&lt;line&lt;len&gt;, 0&gt;
  { static uint const length; operator uint () const { return len; } };
  template &lt;uint x, uint y&gt; struct rectangle { static uint const width, height, area; };
  template &lt;uint x, uint y, uint z&gt; struct cuboid { static uint const width, height, depth, volume; };

  template &lt;uint len&gt; uint const line&lt;len&gt;::length = len;

  template &lt;uint x, uint y&gt; uint const rectangle&lt;x, y&gt;::width = x;
  template &lt;uint x, uint y&gt; uint const rectangle&lt;x, y&gt;::height = y;
  template &lt;uint x, uint y&gt; uint const rectangle&lt;x, y&gt;::area = x * y;

  template &lt;uint x, uint y, uint z&gt; uint const cuboid&lt;x, y, z&gt;::width = x;
  template &lt;uint x, uint y, uint z&gt; uint const cuboid&lt;x, y, z&gt;::height = y;
  template &lt;uint x, uint y, uint z&gt; uint const cuboid&lt;x, y, z&gt;::depth = z;
  template &lt;uint x, uint y, uint z&gt; uint const cuboid&lt;x, y, z&gt;::volume = x * y * z;

  template &lt;uint x, uint y, uint z&gt; rectangle&lt;x, y&gt; front (cuboid&lt;x, y, z&gt;) { return gen(); }
  template &lt;uint x, uint y, uint z&gt; rectangle&lt;z, y&gt; side (cuboid&lt;x, y, z&gt;) { return gen(); }
  template &lt;uint x, uint y, uint z&gt; rectangle&lt;x, z&gt; top (cuboid&lt;x, y, z&gt;) { return gen(); }

  template &lt;uint ax, uint bx&gt; bool operator== (line&lt;ax&gt;, line&lt;bx&gt;) { return ax == bx; }

  template &lt;uint ax, uint ay, uint bx, uint by&gt; bool operator== (rectangle&lt;ax, ay&gt;, rectangle&lt;bx, by&gt;)
  { return ax == bx &amp;&amp; ay == by; }

  template &lt;uint ax, uint ay, uint az, uint bx, uint by, uint bz&gt;
  bool operator== (cuboid&lt;ax, ay, az&gt;, cuboid&lt;bx, by, bz&gt;) { return ax == bx &amp;&amp; ay == by &amp;&amp; az == bz; }

  line&lt;0&gt; operator- (line_end, line_end) { return gen(); }
  template &lt;uint x&gt; line&lt;x&gt; operator- (dashes&lt;line_end, x&gt;, line_end) { return gen(); }

  template &lt;uint x, uint y&gt; struct lower_rectangle {}; 

  template &lt;uint excl_marks, uint x&gt;
  lower_rectangle&lt;x, (excl_marks + 1) / 2&gt; operator- (excls&lt;dashes&lt;line_end, x&gt;, excl_marks&gt;, line_end)
  { return gen(); }

  template &lt;uint x, uint y&gt; rectangle&lt;x, y&gt; operator| (line&lt;x&gt;, lower_rectangle&lt;x, y&gt;) { return gen(); }

  template &lt;uint x, uint y, uint z&gt; struct cuboid_top {};
  template &lt;uint x, uint y, uint z&gt; struct half_cuboid {};

  template &lt;uint x, uint n&gt;
  cuboid_top&lt;x, n + 1, n&gt; operator| (L_symbols&lt;line&lt;x&gt;, n&gt;, line&lt;x&gt;) { return gen(); }

  template &lt;uint x, uint y, uint z, uint n&gt;
  eL_symbols&lt;half_cuboid&lt;x, y + (n + 1) / 3, z&gt;, 0&gt; 
    operator| (cuboid_top&lt;x, y, z&gt;, excls&lt;line_end, n&gt;) { return gen(); }

  template &lt;uint x, uint y, uint z&gt;
  cuboid&lt;x, y, z&gt; operator| (eL_symbols&lt;half_cuboid&lt;x, y, z&gt;, z&gt;, lower_rectangle&lt;x, 1&gt;) { return gen(); }

  namespace symbols
  {
    using analog_literals::o;
    using analog_literals::I;
    using analog_literals::L;
  }

  namespace shapes
  {
    using analog_literals::line;
    using analog_literals::rectangle;
    using analog_literals::cuboid;
  }

}
</code></pre>
<p>Was haltet ihr davon?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/291454/analoge-literaren-guter-stil</link><generator>RSS for Node</generator><lastBuildDate>Mon, 17 Aug 2026 15:57:46 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/291454.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 18 Aug 2011 16:27:42 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Analoge Literaren - guter Stil? on Thu, 18 Aug 2011 16:27:42 GMT]]></title><description><![CDATA[<p>Ich finde, das ist eine sehr gute Möglichkeit den semantischen Wert einer Variable deutlicher lesbar darzustellen:</p>
<pre><code class="language-cpp">#include &quot;analogliterals.hpp&quot;
#include &lt;cassert&gt;

int main ()
{
  using namespace analog_literals::symbols;

  unsigned int a = 4;

  unsigned int b = I---------I;

  assert( a == b );

  assert( I-I == 0 );
  assert( I---I == 1 );
  assert( I-----I == 2 );
  assert( I-------I == 3 );

  unsigned int c = ( o-----o
                     |     !
                     !     !
                     !     !
                     o-----o ).area;

  assert( c == (I-----I) * (I-------I) );

  assert( ( o-----o
            |     !
            !     !
            !     !
            !     !
            o-----o ).area == ( o---------o
                                |         !
                                !         !
                                o---------o ).area );

  assert( ( o-------------o
            |L             \
            | L             \
            |  L             \
            |   o-------------o
            |   !             !
            !   !             !
            o   |             !
             L  |             !
              L |             !
               L|             !
                o-------------o ).volume == ( o-------------o
                                              |             !
                                              !             !
                                              !             !
                                              o-------------o ).area * int(I-------------I) );

  assert( top( o-------o
               |L       \
               | L       \
               |  o-------o
               |  !       !
               !  !       !
               o  |       !
                L |       !
                 L|       !
                  o-------o ) == ( o-------o
                                   |       !
                                   !       !
                                   o-------o ) );

  analog_literals::rectangle&lt;4, 2&gt; r = o---------o
                                       |         !
                                       !         !
                                       o---------o;

}
</code></pre>
<p>und analog_literals.hpp:</p>
<pre><code class="language-cpp">#ifndef ANALOGLITERALS_HPP
#define ANALOGLITERALS_HPP

namespace analog_literals {

typedef unsigned int uint;

  enum line_end { o, I };
  enum Lsymbol { L };

  struct eLsymbol {};
  eLsymbol operator! (Lsymbol) { return eLsymbol(); }

  struct gen { template &lt;typename T&gt; operator T () const { return T(); } };

  template &lt;typename T, uint n&gt; struct excls { excls&lt;T, n + 1&gt; operator! () const { return gen(); } };

  template &lt;typename T, uint n&gt; struct dashes: excls&lt;dashes&lt;T, n&gt;, 0&gt;
  { dashes&lt;T, n + 1&gt; operator-- (int) const { return gen(); } };

  template &lt;typename, uint&gt; struct L_symbols {}; 
  template &lt;typename T, uint n&gt; L_symbols&lt;T, n + 1&gt; operator| (L_symbols&lt;T, n&gt;, Lsymbol) { return gen(); }

  template &lt;typename, uint&gt; struct eL_symbols {}; 
  template &lt;typename T, uint n&gt; eL_symbols&lt;T, n + 1&gt; operator| (eL_symbols&lt;T, n&gt;, eLsymbol) { return gen(); }

  dashes&lt;line_end, 1&gt; operator-- (line_end, int) { return gen(); }
  excls&lt;line_end, 1&gt; operator! (line_end) { return gen(); }

  template &lt;uint len&gt; struct line: L_symbols&lt;line&lt;len&gt;, 0&gt;
  { static uint const length; operator uint () const { return len; } };
  template &lt;uint x, uint y&gt; struct rectangle { static uint const width, height, area; };
  template &lt;uint x, uint y, uint z&gt; struct cuboid { static uint const width, height, depth, volume; };

  template &lt;uint len&gt; uint const line&lt;len&gt;::length = len;

  template &lt;uint x, uint y&gt; uint const rectangle&lt;x, y&gt;::width = x;
  template &lt;uint x, uint y&gt; uint const rectangle&lt;x, y&gt;::height = y;
  template &lt;uint x, uint y&gt; uint const rectangle&lt;x, y&gt;::area = x * y;

  template &lt;uint x, uint y, uint z&gt; uint const cuboid&lt;x, y, z&gt;::width = x;
  template &lt;uint x, uint y, uint z&gt; uint const cuboid&lt;x, y, z&gt;::height = y;
  template &lt;uint x, uint y, uint z&gt; uint const cuboid&lt;x, y, z&gt;::depth = z;
  template &lt;uint x, uint y, uint z&gt; uint const cuboid&lt;x, y, z&gt;::volume = x * y * z;

  template &lt;uint x, uint y, uint z&gt; rectangle&lt;x, y&gt; front (cuboid&lt;x, y, z&gt;) { return gen(); }
  template &lt;uint x, uint y, uint z&gt; rectangle&lt;z, y&gt; side (cuboid&lt;x, y, z&gt;) { return gen(); }
  template &lt;uint x, uint y, uint z&gt; rectangle&lt;x, z&gt; top (cuboid&lt;x, y, z&gt;) { return gen(); }

  template &lt;uint ax, uint bx&gt; bool operator== (line&lt;ax&gt;, line&lt;bx&gt;) { return ax == bx; }

  template &lt;uint ax, uint ay, uint bx, uint by&gt; bool operator== (rectangle&lt;ax, ay&gt;, rectangle&lt;bx, by&gt;)
  { return ax == bx &amp;&amp; ay == by; }

  template &lt;uint ax, uint ay, uint az, uint bx, uint by, uint bz&gt;
  bool operator== (cuboid&lt;ax, ay, az&gt;, cuboid&lt;bx, by, bz&gt;) { return ax == bx &amp;&amp; ay == by &amp;&amp; az == bz; }

  line&lt;0&gt; operator- (line_end, line_end) { return gen(); }
  template &lt;uint x&gt; line&lt;x&gt; operator- (dashes&lt;line_end, x&gt;, line_end) { return gen(); }

  template &lt;uint x, uint y&gt; struct lower_rectangle {}; 

  template &lt;uint excl_marks, uint x&gt;
  lower_rectangle&lt;x, (excl_marks + 1) / 2&gt; operator- (excls&lt;dashes&lt;line_end, x&gt;, excl_marks&gt;, line_end)
  { return gen(); }

  template &lt;uint x, uint y&gt; rectangle&lt;x, y&gt; operator| (line&lt;x&gt;, lower_rectangle&lt;x, y&gt;) { return gen(); }

  template &lt;uint x, uint y, uint z&gt; struct cuboid_top {};
  template &lt;uint x, uint y, uint z&gt; struct half_cuboid {};

  template &lt;uint x, uint n&gt;
  cuboid_top&lt;x, n + 1, n&gt; operator| (L_symbols&lt;line&lt;x&gt;, n&gt;, line&lt;x&gt;) { return gen(); }

  template &lt;uint x, uint y, uint z, uint n&gt;
  eL_symbols&lt;half_cuboid&lt;x, y + (n + 1) / 3, z&gt;, 0&gt; 
    operator| (cuboid_top&lt;x, y, z&gt;, excls&lt;line_end, n&gt;) { return gen(); }

  template &lt;uint x, uint y, uint z&gt;
  cuboid&lt;x, y, z&gt; operator| (eL_symbols&lt;half_cuboid&lt;x, y, z&gt;, z&gt;, lower_rectangle&lt;x, 1&gt;) { return gen(); }

  namespace symbols
  {
    using analog_literals::o;
    using analog_literals::I;
    using analog_literals::L;
  }

  namespace shapes
  {
    using analog_literals::line;
    using analog_literals::rectangle;
    using analog_literals::cuboid;
  }

}
</code></pre>
<p>Was haltet ihr davon?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2107710</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2107710</guid><dc:creator><![CDATA[analog_literals]]></dc:creator><pubDate>Thu, 18 Aug 2011 16:27:42 GMT</pubDate></item><item><title><![CDATA[Reply to Analoge Literaren - guter Stil? on Thu, 18 Aug 2011 16:30:01 GMT]]></title><description><![CDATA[<p><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>
]]></description><link>https://www.c-plusplus.net/forum/post/2107712</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2107712</guid><dc:creator><![CDATA[Irgendwer]]></dc:creator><pubDate>Thu, 18 Aug 2011 16:30:01 GMT</pubDate></item><item><title><![CDATA[Reply to Analoge Literaren - guter Stil? on Thu, 18 Aug 2011 16:33:32 GMT]]></title><description><![CDATA[<p><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="😃"
    /> <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>
]]></description><link>https://www.c-plusplus.net/forum/post/2107716</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2107716</guid><dc:creator><![CDATA[314159265358979]]></dc:creator><pubDate>Thu, 18 Aug 2011 16:33:32 GMT</pubDate></item><item><title><![CDATA[Reply to Analoge Literaren - guter Stil? on Thu, 18 Aug 2011 16:51:53 GMT]]></title><description><![CDATA[<p>Interessante Idee. Schade dass gcc noch keine nutzerdefinierten Literale hat, dann könnte man daraus möglicherweise etwas nützliches bauen. In der jetzigen Form sind das ja keine Konstanten.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2107728</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2107728</guid><dc:creator><![CDATA[camper]]></dc:creator><pubDate>Thu, 18 Aug 2011 16:51:53 GMT</pubDate></item><item><title><![CDATA[Reply to Analoge Literaren - guter Stil? on Thu, 18 Aug 2011 16:55:47 GMT]]></title><description><![CDATA[<p>Copy paste ?</p>
<p><a href="http://hostilefork.com/2009/08/29/tweakinganalog-literals-humor/" rel="nofollow">http://hostilefork.com/2009/08/29/tweakinganalog-literals-humor/</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2107731</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2107731</guid><dc:creator><![CDATA[Jeremey Friesner]]></dc:creator><pubDate>Thu, 18 Aug 2011 16:55:47 GMT</pubDate></item><item><title><![CDATA[Reply to Analoge Literaren - guter Stil? on Thu, 18 Aug 2011 17:04:23 GMT]]></title><description><![CDATA[<p>Jeremey Friesner schrieb:</p>
<blockquote>
<p>Copy paste ?</p>
<p><a href="http://hostilefork.com/2009/08/29/tweakinganalog-literals-humor/" rel="nofollow">http://hostilefork.com/2009/08/29/tweakinganalog-literals-humor/</a></p>
</blockquote>
<p>Nein, der Quelltext ist natürlich alleine von mir verfasst - wir sind wohl zufällig auf die gleiche Lösung des gleichen Problems gekommen. Ist auch nicht großartig außergewöhnlich - für ein bestimmtes Problem gibt es eben zwar viele Lösungen, aber nur wenige gute, und diese haben wir eben beide gefunden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2107736</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2107736</guid><dc:creator><![CDATA[analog_literals]]></dc:creator><pubDate>Thu, 18 Aug 2011 17:04:23 GMT</pubDate></item><item><title><![CDATA[Reply to Analoge Literaren - guter Stil? on Thu, 18 Aug 2011 18:02:27 GMT]]></title><description><![CDATA[<p>Sehr krank! Aber genial. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f62e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_open_mouth"
      title=":open_mouth:"
      alt="😮"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2107764</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2107764</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Thu, 18 Aug 2011 18:02:27 GMT</pubDate></item><item><title><![CDATA[Reply to Analoge Literaren - guter Stil? on Thu, 18 Aug 2011 21:01:09 GMT]]></title><description><![CDATA[<p>camper schrieb:</p>
<blockquote>
<p>Schade dass gcc noch keine nutzerdefinierten Literale hat, dann könnte man daraus möglicherweise etwas nützliches bauen. In der jetzigen Form sind das ja keine Konstanten.</p>
</blockquote>
<p>Müsste sich doch auch mit constexpr hinbekommen lassen dass das &quot;echte&quot; Konstanten werden. Oder übersehe ich da jetzt was?<br />
Abgesehen davon dass ich es für total plem halte. Lustig, aber plem. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f921.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--clown_face"
      title=":clown:"
      alt="🤡"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2107831</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2107831</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Thu, 18 Aug 2011 21:01:09 GMT</pubDate></item><item><title><![CDATA[Reply to Analoge Literaren - guter Stil? on Thu, 18 Aug 2011 21:09:59 GMT]]></title><description><![CDATA[<p>analog_literals schrieb:</p>
<blockquote>
<p>für ein bestimmtes Problem gibt es eben zwar viele Lösungen, aber nur wenige gute, und diese haben wir eben beide gefunden.</p>
</blockquote>
<p>Na wenn du das sagst <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /> Ich bin mir nur noch nicht sicher, welches Problem du damit überhaupt lösen wolltest.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2107836</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2107836</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Thu, 18 Aug 2011 21:09:59 GMT</pubDate></item><item><title><![CDATA[Reply to Analoge Literaren - guter Stil? on Thu, 18 Aug 2011 21:29:16 GMT]]></title><description><![CDATA[<p><img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f62e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_open_mouth"
      title=":open_mouth:"
      alt="😮"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f62e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_open_mouth"
      title=":open_mouth:"
      alt="😮"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f62e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_open_mouth"
      title=":open_mouth:"
      alt="😮"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f62e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_open_mouth"
      title=":open_mouth:"
      alt="😮"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f62e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_open_mouth"
      title=":open_mouth:"
      alt="😮"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f62e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_open_mouth"
      title=":open_mouth:"
      alt="😮"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f62e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_open_mouth"
      title=":open_mouth:"
      alt="😮"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f62e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_open_mouth"
      title=":open_mouth:"
      alt="😮"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2107843</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2107843</guid><dc:creator><![CDATA[rumeeker]]></dc:creator><pubDate>Thu, 18 Aug 2011 21:29:16 GMT</pubDate></item><item><title><![CDATA[Reply to Analoge Literaren - guter Stil? on Thu, 18 Aug 2011 22:35:22 GMT]]></title><description><![CDATA[<p>Finde ich schwach <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_down"
      title=":-1:"
      alt="👎"
    />.</p>
<p>Hier ist natürlich auf den ersten Blick ersichtlich, welcher Quader welches Volumen hat. Ist ja super intuitiv im Vergleich zu &quot;42&quot;. Aber was ist, wenn ich den Code an jemanden schicke, der keinen monospaced font eingestellt hat? soll der dann etwas Zeichen zählen, um zu sehen, dass ich das richtige Volumen eingegeben hab?</p>
<blockquote>
<p>assert( ( o-------------o<br />
|L \<br />
| L \<br />
| L \<br />
| o-------------o<br />
| ! !<br />
! ! !<br />
o | !<br />
L | !<br />
L | !<br />
L| !<br />
o-------------o ).volume == ( o-------------o<br />
| !<br />
! !<br />
! !<br />
o-------------o ).area * int(I-------------I) );</p>
</blockquote>
<p>seht ihr? klappt gar nicht! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f921.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--clown_face"
      title=":clown:"
      alt="🤡"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2107867</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2107867</guid><dc:creator><![CDATA[otze]]></dc:creator><pubDate>Thu, 18 Aug 2011 22:35:22 GMT</pubDate></item><item><title><![CDATA[Reply to Analoge Literaren - guter Stil? on Thu, 18 Aug 2011 23:32:49 GMT]]></title><description><![CDATA[<p>analog_literals schrieb:</p>
<blockquote>
<p>Nein, der Quelltext ist natürlich alleine von mir verfasst - wir sind wohl zufällig auf die gleiche Lösung des gleichen Problems gekommen. Ist auch nicht großartig außergewöhnlich - für ein bestimmtes Problem gibt es eben zwar viele Lösungen, aber nur wenige gute, und diese haben wir eben beide gefunden.</p>
</blockquote>
<p>Da kommt's her: <a href="http://weegen.home.xs4all.nl/eelis/analogliterals.xhtml" rel="nofollow">http://weegen.home.xs4all.nl/eelis/analogliterals.xhtml</a></p>
<p>Der Code ist 1:1 der Gleiche, die Eigenleistung des OP scheint darin zu bestehen, dem Namen des Headers einen Unterstrich hinzugefügt zu haben.</p>
<p>Warum er meint, diesen Kram guttenbergisieren zu müssen, ist mir allerdings schleierhaft. Das ging vor ein paar Jahren schon einmal um, und es musste damit gerechnet werden dass 1. sich jemand daran erinnert und 2. es im Google-Zeitalter leicht gefunden werden kann, zumal 3. nicht viel Ruhm damit zu haben ist. Ganz ernst gemeint kann das Ganze ja nicht sein.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2107894</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2107894</guid><dc:creator><![CDATA[seldon]]></dc:creator><pubDate>Thu, 18 Aug 2011 23:32:49 GMT</pubDate></item><item><title><![CDATA[Reply to Analoge Literaren - guter Stil? on Fri, 19 Aug 2011 06:33:17 GMT]]></title><description><![CDATA[<p>Ich find das jetzt auch so mäßig hilfreich. Rechtecke und Quader kann ich mir auch selbst noch vorstellen. Für komplexere Objekte, die meine Vorstellungskraft überschreiben, reicht Editor-Code aber bestimmt nicht aus. Nicht zu sprechen von der Tipparbeit, die man dabei hat. Wenn ich Rechteck(10, 5) schreibe, halte ich das für einfacher... Die LOC bläht man natürlich schön auf.</p>
<p>Übrigens ist es völlig egal, ob OP Urheber ist oder nicht, da er sowieso ein Unreg ist. Wenn jemand anonym postet, ist mir das ziemlich egal... (nichts für ungut, seldon)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2107917</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2107917</guid><dc:creator><![CDATA[Eisflamme]]></dc:creator><pubDate>Fri, 19 Aug 2011 06:33:17 GMT</pubDate></item><item><title><![CDATA[Reply to Analoge Literaren - guter Stil? on Fri, 19 Aug 2011 09:12:36 GMT]]></title><description><![CDATA[<p>Leute, ihr nehmt das wohl ein bisschen zu ernst.</p>
<p>seldon schrieb:</p>
<blockquote>
<p>Warum er meint, diesen Kram guttenbergisieren zu müssen, ist mir allerdings schleierhaft.</p>
</blockquote>
<p>Ich habe analog_literals' zweiten Post jedenfalls ironisch verstanden.</p>
<p>Eisflamme schrieb:</p>
<blockquote>
<p>Ich find das jetzt auch so mäßig hilfreich.</p>
</blockquote>
<p><img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f921.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--clown_face"
      title=":clown:"
      alt="🤡"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2107962</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2107962</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Fri, 19 Aug 2011 09:12:36 GMT</pubDate></item><item><title><![CDATA[Reply to Analoge Literaren - guter Stil? on Fri, 19 Aug 2011 09:17:03 GMT]]></title><description><![CDATA[<p>Ich und irgendwas ernst nehmen? Pah. <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>
<p>Ne, hast wohl Recht, ist ne ganz witzige Spielerei.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2107966</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2107966</guid><dc:creator><![CDATA[Eisflamme]]></dc:creator><pubDate>Fri, 19 Aug 2011 09:17:03 GMT</pubDate></item><item><title><![CDATA[Reply to Analoge Literaren - guter Stil? on Fri, 19 Aug 2011 11:10:23 GMT]]></title><description><![CDATA[<p>hustbaer schrieb:</p>
<blockquote>
<p>camper schrieb:</p>
<blockquote>
<p>Schade dass gcc noch keine nutzerdefinierten Literale hat, dann könnte man daraus möglicherweise etwas nützliches bauen. In der jetzigen Form sind das ja keine Konstanten.</p>
</blockquote>
<p>Müsste sich doch auch mit constexpr hinbekommen lassen dass das &quot;echte&quot; Konstanten werden. Oder übersehe ich da jetzt was?</p>
</blockquote>
<p>Ich denke, ähnlich Boost Binary müsste das sogar in C (und damit auch jedem C++) als echte Makro-Konstante gehen. Die Syntax wäre dann halt eher</p>
<pre><code>XXXXX XXXXX XXX
</code></pre>
<p>und</p>
<pre><code>ooooo ooooo ooo
I             I
I             I
I             I
I             I
ooooo ooooo ooo
</code></pre>
<p>und</p>
<pre><code>IHHHH HHH HHHH
IL            L
I L            L
I  L            L
I   LHHHH HHHHH HL
 L  I            I
  L I            I
   LI            I
    LHHHH HHHHH HH
</code></pre>
<p>Nicht so schön zum Lösen, dafür aber als Makro gelöst. Wer hat Lust, das zu schreiben?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2108030</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2108030</guid><dc:creator><![CDATA[gutti]]></dc:creator><pubDate>Fri, 19 Aug 2011 11:10:23 GMT</pubDate></item><item><title><![CDATA[Reply to Analoge Literaren - guter Stil? on Fri, 19 Aug 2011 12:29:08 GMT]]></title><description><![CDATA[<blockquote>
<p>Da kommt's her: <a href="http://weegen.home.xs4all.nl/eelis/analogliterals.xhtml" rel="nofollow">http://weegen.home.xs4all.nl/eelis/analogliterals.xhtml</a></p>
</blockquote>
<p>Oh oh oh was ist da los <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="😃"
    /> <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="😃"
    /> <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="😃"
    /><br />
Würd ich sagen , ziemlich erbärmlich <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2108080</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2108080</guid><dc:creator><![CDATA[7xCore]]></dc:creator><pubDate>Fri, 19 Aug 2011 12:29:08 GMT</pubDate></item></channel></rss>