<?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[BOOST_STATIC_ASSERT_MSG]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich verstehe nicht wie man den Befehl: &quot;BOOST_STATIC_ASSERT_MSG&quot; nutzen soll.</p>
<p>Ich habe folgenden Code</p>
<pre><code class="language-cpp">#include &lt;boost/static_assert.hpp&gt;
...
bool myfunc()
{
...
if( ! kondition )
{
  BOOST_STATIC_ASSERT_MSG(false,&quot;Could not ...&quot;);
  return false;
}
...
}
</code></pre>
<p>Mein VS2008 Compiler bringt folgendes:</p>
<pre><code>1&gt;a.cpp(54) : error C2975: 'x' : invalid template argument for 'boost::STATIC_ASSERTION_FAILURE', expected compile-time constant expression
1&gt;        C:\boost\boost_1_47_0\boost/static_assert.hpp(54) : see declaration of 'x'
1&gt;a.cpp(54) : error C2027: use of undefined type 'boost::STATIC_ASSERTION_FAILURE&lt;x&gt;'
1&gt;        with
1&gt;        [
1&gt;            x=false
1&gt;        ]
</code></pre>
<p>Was mache ich falsch?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/294786/boost_static_assert_msg</link><generator>RSS for Node</generator><lastBuildDate>Sat, 15 Aug 2026 15:43:40 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/294786.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 01 Nov 2011 15:43:58 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to BOOST_STATIC_ASSERT_MSG on Tue, 01 Nov 2011 15:43:58 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich verstehe nicht wie man den Befehl: &quot;BOOST_STATIC_ASSERT_MSG&quot; nutzen soll.</p>
<p>Ich habe folgenden Code</p>
<pre><code class="language-cpp">#include &lt;boost/static_assert.hpp&gt;
...
bool myfunc()
{
...
if( ! kondition )
{
  BOOST_STATIC_ASSERT_MSG(false,&quot;Could not ...&quot;);
  return false;
}
...
}
</code></pre>
<p>Mein VS2008 Compiler bringt folgendes:</p>
<pre><code>1&gt;a.cpp(54) : error C2975: 'x' : invalid template argument for 'boost::STATIC_ASSERTION_FAILURE', expected compile-time constant expression
1&gt;        C:\boost\boost_1_47_0\boost/static_assert.hpp(54) : see declaration of 'x'
1&gt;a.cpp(54) : error C2027: use of undefined type 'boost::STATIC_ASSERTION_FAILURE&lt;x&gt;'
1&gt;        with
1&gt;        [
1&gt;            x=false
1&gt;        ]
</code></pre>
<p>Was mache ich falsch?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2138791</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2138791</guid><dc:creator><![CDATA[sdasdasd]]></dc:creator><pubDate>Tue, 01 Nov 2011 15:43:58 GMT</pubDate></item><item><title><![CDATA[Reply to BOOST_STATIC_ASSERT_MSG on Wed, 02 Nov 2011 20:17:30 GMT]]></title><description><![CDATA[<p>Kann vielleicht jemand mal versuchen diesen Fehler zu reproduzieren?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2139531</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2139531</guid><dc:creator><![CDATA[sdasdasd]]></dc:creator><pubDate>Wed, 02 Nov 2011 20:17:30 GMT</pubDate></item><item><title><![CDATA[Reply to BOOST_STATIC_ASSERT_MSG on Wed, 02 Nov 2011 20:28:20 GMT]]></title><description><![CDATA[<p>Funktioniert doch.</p>
<p>Lies einfach nach, was <code>BOOST_STATIC_ASSERT/_MSG</code> tut.</p>
<p>Was du vielleicht suchst, ist <code>assert</code> aus <code>&lt;cassert&gt;</code> .</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2139537</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2139537</guid><dc:creator><![CDATA[TyRoXx]]></dc:creator><pubDate>Wed, 02 Nov 2011 20:28:20 GMT</pubDate></item><item><title><![CDATA[Reply to BOOST_STATIC_ASSERT_MSG on Wed, 02 Nov 2011 20:30:52 GMT]]></title><description><![CDATA[<p>TyRoXx schrieb:</p>
<blockquote>
<p>Funktioniert doch.</p>
<p>Lies einfach nach, was <code>BOOST_STATIC_ASSERT/_MSG</code> tut.</p>
<p>Was du vielleicht suchst, ist <code>assert</code> aus <code>&lt;cassert&gt;</code> .</p>
</blockquote>
<p>Hmm ich dachte eigentlich dass wäre C++ (assert). Assert selber ist ja noch auc C Libraries..</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2139539</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2139539</guid><dc:creator><![CDATA[sdasdasd]]></dc:creator><pubDate>Wed, 02 Nov 2011 20:30:52 GMT</pubDate></item><item><title><![CDATA[Reply to BOOST_STATIC_ASSERT_MSG on Wed, 02 Nov 2011 20:33:14 GMT]]></title><description><![CDATA[<p>Das &quot;static&quot; will dir etwas sagen <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="😉"
    /> Die Bedingung wird bereits zur Compilezeit ausgewertet. Wenn sie false ergibt, wird ein Compilerfehler generiert.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2139541</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2139541</guid><dc:creator><![CDATA[Michael E.]]></dc:creator><pubDate>Wed, 02 Nov 2011 20:33:14 GMT</pubDate></item><item><title><![CDATA[Reply to BOOST_STATIC_ASSERT_MSG on Wed, 02 Nov 2011 20:38:09 GMT]]></title><description><![CDATA[<p>Michael E. schrieb:</p>
<blockquote>
<p>Das &quot;static&quot; will dir etwas sagen <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="😉"
    /> Die Bedingung wird bereits zur Compilezeit ausgewertet. Wenn sie false ergibt, wird ein Compilerfehler generiert.</p>
</blockquote>
<p>Jetzt sehe ich ein dass ich doof war. Gibt es ein ähnliches Ding für C++? Sollte man asserts nutzen? Ich finde sie vor allem in der Entwicklungsphase ganz praktisch zumal es im Release Modus nicht behindert.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2139543</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2139543</guid><dc:creator><![CDATA[sdasdasd]]></dc:creator><pubDate>Wed, 02 Nov 2011 20:38:09 GMT</pubDate></item><item><title><![CDATA[Reply to BOOST_STATIC_ASSERT_MSG on Wed, 02 Nov 2011 20:39:41 GMT]]></title><description><![CDATA[<p>Klar, du kannst das assert aus &lt;cassert&gt; benutzen. Nicht alles, was von C kommt, ist böse <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="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2139546</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2139546</guid><dc:creator><![CDATA[Michael E.]]></dc:creator><pubDate>Wed, 02 Nov 2011 20:39:41 GMT</pubDate></item><item><title><![CDATA[Reply to BOOST_STATIC_ASSERT_MSG on Wed, 02 Nov 2011 20:43:41 GMT]]></title><description><![CDATA[<p>Michael E. schrieb:</p>
<blockquote>
<p>Klar, du kannst das assert aus &lt;cassert&gt; benutzen. Nicht alles, was von C kommt, ist böse <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="😉"
    /></p>
</blockquote>
<p>Puh... ich dachte schon man schimpft mich wieder als JW. Nochmal heil davongekommen...</p>
<p>Danke an die Helfenden!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2139550</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2139550</guid><dc:creator><![CDATA[sdasdasd]]></dc:creator><pubDate>Wed, 02 Nov 2011 20:43:41 GMT</pubDate></item><item><title><![CDATA[Reply to BOOST_STATIC_ASSERT_MSG on Wed, 02 Nov 2011 20:56:00 GMT]]></title><description><![CDATA[<p>Wenn du Boost willst, kannst du auch <code>BOOST_ASSERT_MSG</code> verwenden. Soll etwas mächtiger als das normale <code>assert</code> sein, aber ehrlich gesagt habe ich die Features nie benötigt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2139560</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2139560</guid><dc:creator><![CDATA[biest]]></dc:creator><pubDate>Wed, 02 Nov 2011 20:56:00 GMT</pubDate></item><item><title><![CDATA[Reply to BOOST_STATIC_ASSERT_MSG on Thu, 03 Nov 2011 20:46:46 GMT]]></title><description><![CDATA[<p>sdasdasd schrieb:</p>
<blockquote>
<pre><code class="language-cpp">if( ! kondition )
</code></pre>
</blockquote>
<p>ohjeh<br />
<a href="http://de.wikipedia.org/wiki/Kondition" rel="nofollow">http://de.wikipedia.org/wiki/Kondition</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2140035</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2140035</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Thu, 03 Nov 2011 20:46:46 GMT</pubDate></item><item><title><![CDATA[Reply to BOOST_STATIC_ASSERT_MSG on Thu, 03 Nov 2011 22:00:03 GMT]]></title><description><![CDATA[<p>In der angegeben Form macht assert aber nicht so richtig viel Sinn. Wenn ich da nicht etwas böse falsch verstehe, willst du da im Release-Modus in irgendeiner Form weitermachen, während die Debug-Binaries einfach abstürzen, und es ist eine ausgesprochen heikle Angelegenheit, für Debug- und Release-Modi verschiedene Verhaltensweisen vorzusehen. assert(bedingung); ist zu verstehen als &quot;Ich behaupte, dass diese Bedingung immer gilt. Wenn das nicht der Fall ist, ist etwas richtig fies kaputt und nichts mehr zu retten.&quot; Wenn du weitermachen kannst, obwohl die Bedingung nicht erfüllt ist, wäre es angebrachter, den Fehler in eine Logdatei, syslog o.ä. zu schreiben.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2140063</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2140063</guid><dc:creator><![CDATA[seldon]]></dc:creator><pubDate>Thu, 03 Nov 2011 22:00:03 GMT</pubDate></item></channel></rss>