Compare commits

..

3 Commits

Author SHA1 Message Date
262c03e7a7 This commit was manufactured by cvs2svn to create tag
'Version_1_33_1'.

[SVN r31916]
2005-12-05 14:04:06 +00:00
9448463d8a Improved local documentation build.
[SVN r30479]
2005-08-05 11:44:32 +00:00
86f3f74461 This commit was manufactured by cvs2svn to create branch 'RC_1_33_0'.
[SVN r30300]
2005-07-28 18:22:24 +00:00
9 changed files with 44 additions and 30 deletions

27
Jamfile Normal file
View File

@ -0,0 +1,27 @@
# copyright John Maddock 2003
subproject libs/static_assert ;
# bring in the rules for testing
import testing ;
test-suite static_assert :
[ run static_assert_test.cpp ]
# [ run static_assert_example_1.cpp ]
[ run static_assert_example_2.cpp ]
[ run static_assert_example_3.cpp ]
[ compile-fail static_assert_test_fail_1.cpp ]
[ compile-fail static_assert_test_fail_2.cpp ]
[ compile-fail static_assert_test_fail_3.cpp ]
[ compile-fail static_assert_test_fail_4.cpp ]
[ compile-fail static_assert_test_fail_5.cpp ]
[ compile-fail static_assert_test_fail_6.cpp ]
[ compile-fail static_assert_test_fail_7.cpp ]
[ compile-fail static_assert_test_fail_8.cpp ]
[ compile-fail static_assert_test_fail_10.cpp ]
;

View File

@ -1,7 +1,4 @@
# copyright John Maddock 2003
# Use, modification and distribution are subject to the
# Boost Software License, Version 1.0. (See accompanying file
# LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
# bring in the rules for testing
import testing ;
@ -28,4 +25,3 @@ test-suite static_assert :

View File

@ -17,4 +17,13 @@ boostbook standalone
install html : ../../../doc/html/boostbook.css ;
install ../ : ../../../boost.png ;
if ! $(gWARNING_DONE)
{
ECHO ;
ECHO This Jamfile is for testing the Static Assert documentation build only ;
ECHO If you want to update your distributed documentation then please build ;
ECHO from the boost-path/doc directory ;
ECHO ;
gWARNING_DONE = "true" ;
}

View File

@ -49,12 +49,11 @@ be an unsigned type. We can verify this at compile time as follows:
#include <climits>
#include <cwchar>
#include <limits>
#include <boost/static_assert.hpp>
namespace my_conditions {
BOOST_STATIC_ASSERT(std::numeric_limits<int>::digits >= 32);
BOOST_STATIC_ASSERT(sizeof(int) * CHAR_BIT >= 32);
BOOST_STATIC_ASSERT(WCHAR_MIN >= 0);
} // namespace my_conditions
@ -62,7 +61,7 @@ be an unsigned type. We can verify this at compile time as follows:
The use of the namespace my_conditions here requires some comment.
The macro `BOOST_STATIC_ASSERT` works by generating an typedef declaration,
and since the typedef must have a name, the macro generates one automatically by
mangling a stub name with the value of `__LINE__`. When `BOOST_STATIC_ASSERT` is
mangling a stub name with the value of __LINE__. When `BOOST_STATIC_ASSERT` is
used at either class or function scope then each use of `BOOST_STATIC_ASSERT`
is guaranteed to produce a name unique to that scope (provided you only use
the macro once on each line). However when used in a header at namespace
@ -129,8 +128,8 @@ using something like this:
class myclass
{
private:
BOOST_STATIC_ASSERT((std::numeric_limits<UnsignedInt>::digits >= 16)
&& std::numeric_limits<UnsignedInt>::is_specialized
BOOST_STATIC_ASSERT(sizeof(UnsignedInt) * CHAR_BIT >= 16);
BOOST_STATIC_ASSERT(std::numeric_limits<UnsignedInt>::is_specialized
&& std::numeric_limits<UnsignedInt>::is_integer
&& !std::numeric_limits<UnsignedInt>::is_signed);
public:
@ -217,5 +216,3 @@ working at namespace, function, and class scope outweighed the ugliness of a mac
]
[endsect]

View File

@ -28,10 +28,6 @@
# define BOOST_SA_GCC_WORKAROUND
#endif
#ifdef BOOST_HAS_STATIC_ASSERT
# define BOOST_STATIC_ASSERT( B ) static_assert(B, #B)
#else
namespace boost{
// HP aCC cannot deal with missing names for template value parameters
@ -115,7 +111,7 @@ template<int x> struct static_assert_test{};
enum { BOOST_JOIN(boost_static_assert_enum_, __LINE__) \
= sizeof(::boost::STATIC_ASSERTION_FAILURE< (bool)( B ) >) }
#endif
#endif // ndef BOOST_HAS_STATIC_ASSERT
#endif // BOOST_STATIC_ASSERT_HPP

View File

@ -9,10 +9,6 @@
or view the online version at
<a href="http://www.boost.org/regression-logs/cs-win32_metacomm/doc/html/boost_staticassert.html">
http://www.boost.org/regression-logs/cs-win32_metacomm/doc/html/boost_staticassert.html</a>
<P>Copyright&nbsp;John Maddock 2006</P>
<P>Distributed under the Boost Software License, Version 1.0. (See accompanying file <A href="../../LICENSE_1_0.txt">
LICENSE_1_0.txt</A> or copy at <A href="http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</A>).</P>
</body>
</html>

View File

@ -9,10 +9,6 @@
or view the online version at
<a href="http://www.boost.org/regression-logs/cs-win32_metacomm/doc/html/boost_staticassert.html">
http://www.boost.org/regression-logs/cs-win32_metacomm/doc/html/boost_staticassert.html</a>
<P>Copyright&nbsp;John Maddock 2006</P>
<P>Distributed under the Boost Software License, Version 1.0. (See accompanying file <A href="../../LICENSE_1_0.txt">
LICENSE_1_0.txt</A> or copy at <A href="http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</A>).</P>
</body>
</html>

View File

@ -7,7 +7,6 @@
#include <climits>
#include <cwchar>
#include <limits>
#include <boost/static_assert.hpp>
#if !defined(WCHAR_MIN)
@ -17,7 +16,7 @@
namespace boost{
namespace my_conditions {
BOOST_STATIC_ASSERT(std::numeric_limits<int>::digits >= 32);
BOOST_STATIC_ASSERT(sizeof(int) * CHAR_BIT >= 32);
BOOST_STATIC_ASSERT(WCHAR_MIN >= 0);
} // namespace my_conditions
@ -31,4 +30,3 @@ int main()

View File

@ -13,8 +13,8 @@ template <class UnsignedInt>
class myclass
{
private:
BOOST_STATIC_ASSERT((std::numeric_limits<UnsignedInt>::digits >= 16)
&& std::numeric_limits<UnsignedInt>::is_specialized
BOOST_STATIC_ASSERT(sizeof(UnsignedInt) * CHAR_BIT >= 16);
BOOST_STATIC_ASSERT(std::numeric_limits<UnsignedInt>::is_specialized
&& std::numeric_limits<UnsignedInt>::is_integer
&& !std::numeric_limits<UnsignedInt>::is_signed);
public:
@ -30,4 +30,3 @@ int main()
return 0;
}