Compare commits

...

6 Commits

Author SHA1 Message Date
a48a917943 + creating a branch for a xpressive extension that allows nesting
of regular expressions


[SVN r38759]
2007-08-19 15:07:44 +00:00
1663a635aa Fix C++0x helper macros
[SVN r37178]
2007-03-14 09:20:38 +00:00
b9a3b24aef remove dead file.
[SVN r36552]
2006-12-31 17:27:27 +00:00
a0dac351fb Preliminary C++0x support
[SVN r36149]
2006-11-22 15:58:39 +00:00
c68b2114de Added trivial docs change, based on user suggestion, and brought example code into synch.
[SVN r34874]
2006-08-11 18:14:13 +00:00
48b6934f7f Added license info.
[SVN r34585]
2006-07-17 10:49:22 +00:00
8 changed files with 30 additions and 37 deletions

29
Jamfile
View File

@ -1,29 +0,0 @@
# 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_9.cpp ]
[ compile-fail static_assert_test_fail_10.cpp ]
;

View File

@ -1,4 +1,7 @@
# 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 ;
@ -25,3 +28,4 @@ test-suite static_assert :

View File

@ -49,11 +49,12 @@ 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(sizeof(int) * CHAR_BIT >= 32);
BOOST_STATIC_ASSERT(std::numeric_limits<int>::digits >= 32);
BOOST_STATIC_ASSERT(WCHAR_MIN >= 0);
} // namespace my_conditions
@ -61,7 +62,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
@ -128,8 +129,8 @@ using something like this:
class myclass
{
private:
BOOST_STATIC_ASSERT(sizeof(UnsignedInt) * CHAR_BIT >= 16);
BOOST_STATIC_ASSERT(std::numeric_limits<UnsignedInt>::is_specialized
BOOST_STATIC_ASSERT((std::numeric_limits<UnsignedInt>::digits >= 16)
&& std::numeric_limits<UnsignedInt>::is_specialized
&& std::numeric_limits<UnsignedInt>::is_integer
&& !std::numeric_limits<UnsignedInt>::is_signed);
public:
@ -216,3 +217,5 @@ working at namespace, function, and class scope outweighed the ugliness of a mac
]
[endsect]

View File

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

View File

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