assert_msg.html 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <html>
  2. <head>
  3. <title>BOOST_PP_ASSERT_MSG</title>
  4. <link rel="stylesheet" type="text/css" href="../styles.css">
  5. </head>
  6. <body>
  7. <div style="margin-left: 0px;">
  8. The <b>BOOST_PP_ASSERT_MSG</b> macro conditionally inserts debugging text.
  9. </div>
  10. <h4>Usage</h4>
  11. <div class="code">
  12. <b>BOOST_PP_ASSERT_MSG</b>(<i>cond</i>, <i>msg</i>)
  13. </div>
  14. <h4>Arguments</h4>
  15. <dl>
  16. <dt>cond</dt>
  17. <dd>
  18. A condition that determines whether an assertion occurs.&nbsp;
  19. Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_MAG</b>.
  20. </dd>
  21. <dt>msg</dt>
  22. <dd>
  23. A message to display if <i>cond</i> evaluates to <i>0</i>.
  24. </dd>
  25. </dl>
  26. <h4>Remarks</h4>
  27. <div>
  28. If <i>cond</i> expands to <i>0</i>, this macro expands to <i>msg</i>.&nbsp;
  29. Otherwise, it expands to nothing.
  30. </div>
  31. <h4>See Also</h4>
  32. <ul>
  33. <li><a href="assert_msg.html">BOOST_PP_ASSERT_MSG</a></li>
  34. <li><a href="limit_mag.html">BOOST_PP_LIMIT_MAG</a></li>
  35. </ul>
  36. <h4>Requirements</h4>
  37. <div>
  38. <b>Header:</b> &nbsp;<a href="../headers/debug/assert.html">&lt;boost/preprocessor/debug/assert.hpp&gt;</a>
  39. </div>
  40. <h4>Sample Code</h4>
  41. <div><pre>
  42. #include &lt;<a href="../headers/comparison/equal.html">boost/preprocessor/comparison/equal.hpp</a>&gt;
  43. #include &lt;<a href="../headers/debug/assert.html">boost/preprocessor/debug/assert.hpp</a>&gt;
  44. // lines are supposed to be counted
  45. // in translation phase 1
  46. #line 9
  47. <a href="assert_msg.html">BOOST_PP_ASSERT_MSG</a>( \
  48. BOOST_PP_EQUAL(__LINE__, 9), \
  49. "incorrect line numbering detected" \
  50. )
  51. </pre></div>
  52. <hr size="1">
  53. <div style="margin-left: 0px;">
  54. <i>© Copyright <a href="http://www.housemarque.com" target="_top">Housemarque Oy</a> 2002</i>
  55. </br><i>© Copyright Paul Mensonides 2002</i>
  56. </div>
  57. <div style="margin-left: 0px;">
  58. <p><small>Distributed under the Boost Software License, Version 1.0. (See
  59. accompanying file <a href="../../../../LICENSE_1_0.txt">LICENSE_1_0.txt</a> or
  60. copy at <a href=
  61. "http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a>)</small></p>
  62. </div>
  63. </body>
  64. </html>