static_warning.html 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!--
  4. (C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
  5. Use, modification and distribution is subject to the Boost Software
  6. License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  7. http://www.boost.org/LICENSE_1_0.txt)
  8. -->
  9. <head>
  10. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  11. <link rel="stylesheet" type="text/css" href="../../../boost.css">
  12. <link rel="stylesheet" type="text/css" href="style.css">
  13. <title>Serialization - BOOST_STATIC_WARNING</title>
  14. </head>
  15. <body link="#0000ff" vlink="#800080">
  16. <table border="0" cellpadding="7" cellspacing="0" width="100%" summary="header">
  17. <tr>
  18. <td valign="top" width="300">
  19. <h3><a href="../../../index.htm"><img height="86" width="277" alt="C++ Boost" src="../../../boost.png" border="0"></a></h3>
  20. </td>
  21. <td valign="top">
  22. <h1 align="center">Serialization</h1>
  23. <h2 align="center"><code>BOOST_STATIC_WARNING</code></h2>
  24. </td>
  25. </tr>
  26. </table>
  27. <hr>
  28. The header <code>&lt;boost/serialization/static_warning.hpp&gt;</code> supplies a single macro
  29. <code style="white-space: normal">BOOST_STATIC_WARNING(x)</code>, which generates a compile time warning message if
  30. the integral-constant-expression x is not true.
  31. <p>
  32. Note that if the condition is true, then the macro will generate neither
  33. code nor data - and the macro can also be used at either namespace,
  34. class or function scope. When used in a template, the expression x
  35. will be evaluated at the time the template is instantiated; this is
  36. particularly useful for validating template parameters.
  37. <p>
  38. It is intended that the functioning of <code style="white-space: normal">BOOST_STATIC_WARNING(x)</code>
  39. be identical to that of <code style="white-space: normal">BOOST_STATIC_ASSERT(x)</code>
  40. except that rather than resulting in a compilation error, it will result in
  41. a compiler warning. In all other respects it should be the same. So
  42. for more information on using <code style="white-space: normal">BOOST_STATIC_WARNING(x)</code>
  43. consult the documentation for <code style="white-space: normal">BOOST_STATIC_ASSERT(x)</code>
  44. <a href="../../../doc/html/boost_staticassert.html">here</a>.
  45. <hr>
  46. <p><i>&copy; Copyright <a href="http://www.rrsd.com">Robert Ramey</a> 2002-2004.
  47. Distributed under the Boost Software License, Version 1.0. (See
  48. accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  49. </i></p>
  50. </body>
  51. </html>