|
|
|
@ -16,7 +16,7 @@
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
This manual is also available in
|
|
|
|
|
[@http:svn.boost.org/svn/boost/sandbox/pdf/static_assert/release/static_assert.pdf
|
|
|
|
|
[@http://svn.boost.org/svn/boost/sandbox/pdf/static_assert/release/static_assert.pdf
|
|
|
|
|
printer friendly PDF format].
|
|
|
|
|
|
|
|
|
|
[section:intro Overview and Tutorial]
|
|
|
|
@ -131,7 +131,7 @@ Suppose we have a template-class that requires an unsigned integral type with
|
|
|
|
|
at least 16-bits of precision as a template argument, we can achieve this
|
|
|
|
|
using something like this:
|
|
|
|
|
|
|
|
|
|
#include <climits>
|
|
|
|
|
#include <limits>
|
|
|
|
|
#include <boost/static_assert.hpp>
|
|
|
|
|
|
|
|
|
|
template <class UnsignedInt>
|
|
|
|
@ -209,19 +209,19 @@ working at namespace, function, and class scope outweighed the ugliness of a mac
|
|
|
|
|
[table Test programs provided with static_assert
|
|
|
|
|
[[Test Program][Expected to Compile][Description]]
|
|
|
|
|
|
|
|
|
|
[[[@/libs/static_assert/static_assert_test.cpp static_assert_test.cpp]] [Yes] [Illustrates usage, and should always compile, really just tests compiler compatibility.]]
|
|
|
|
|
[[[@/libs/static_assert/static_assert_example_1.cpp static_assert_example_1.cpp]] [Platform dependent.] [Namespace scope test program, may compile depending upon the platform. ]]
|
|
|
|
|
[[[@/libs/static_assert/static_assert_example_2.cpp static_assert_example_2.cpp]] [Yes] [Function scope test program. ]]
|
|
|
|
|
[[[@/libs/static_assert/static_assert_example_3.cpp static_assert_example_3.cpp]] [Yes] [Class scope test program. ]]
|
|
|
|
|
[[[@/libs/static_assert/static_assert_test_fail_1.cpp static_assert_test_fail_1.cpp]] [No] [Illustrates failure at namespace scope. ]]
|
|
|
|
|
[[[@/libs/static_assert/static_assert_test_fail_2.cpp static_assert_test_fail_2.cpp]] [No] [Illustrates failure at non-template function scope. ]]
|
|
|
|
|
[[[@/libs/static_assert/static_assert_test_fail_3.cpp static_assert_test_fail_3.cpp]] [No] [Illustrates failure at non-template class scope. ]]
|
|
|
|
|
[[[@/libs/static_assert/static_assert_test_fail_4.cpp static_assert_test_fail_4.cpp]] [No] [Illustrates failure at non-template class scope. ]]
|
|
|
|
|
[[[@/libs/static_assert/static_assert_test_fail_5.cpp static_assert_test_fail_5.cpp]] [No] [Illustrates failure at template class scope. ]]
|
|
|
|
|
[[[@/libs/static_assert/static_assert_test_fail_6.cpp static_assert_test_fail_6.cpp]] [No] [Illustrates failure at template class member function scope. ]]
|
|
|
|
|
[[[@/libs/static_assert/static_assert_test_fail_7.cpp static_assert_test_fail_7.cpp]] [No] [Illustrates failure of class scope example. ]]
|
|
|
|
|
[[[@/libs/static_assert/static_assert_test_fail_8.cpp static_assert_test_fail_8.cpp]] [No] [Illustrates failure of function scope example. ]]
|
|
|
|
|
[[[@/libs/static_assert/static_assert_test_fail_9.cpp static_assert_test_fail_9.cpp]] [No] [Illustrates failure of function scope example (part 2). ]]
|
|
|
|
|
[[[@../../libs/static_assert/static_assert_test.cpp static_assert_test.cpp]] [Yes] [Illustrates usage, and should always compile, really just tests compiler compatibility.]]
|
|
|
|
|
[[[@../../libs/static_assert/static_assert_example_1.cpp static_assert_example_1.cpp]] [Platform dependent.] [Namespace scope test program, may compile depending upon the platform. ]]
|
|
|
|
|
[[[@../../libs/static_assert/static_assert_example_2.cpp static_assert_example_2.cpp]] [Yes] [Function scope test program. ]]
|
|
|
|
|
[[[@../../libs/static_assert/static_assert_example_3.cpp static_assert_example_3.cpp]] [Yes] [Class scope test program. ]]
|
|
|
|
|
[[[@../../libs/static_assert/static_assert_test_fail_1.cpp static_assert_test_fail_1.cpp]] [No] [Illustrates failure at namespace scope. ]]
|
|
|
|
|
[[[@../../libs/static_assert/static_assert_test_fail_2.cpp static_assert_test_fail_2.cpp]] [No] [Illustrates failure at non-template function scope. ]]
|
|
|
|
|
[[[@../../libs/static_assert/static_assert_test_fail_3.cpp static_assert_test_fail_3.cpp]] [No] [Illustrates failure at non-template class scope. ]]
|
|
|
|
|
[[[@../../libs/static_assert/static_assert_test_fail_4.cpp static_assert_test_fail_4.cpp]] [No] [Illustrates failure at non-template class scope. ]]
|
|
|
|
|
[[[@../../libs/static_assert/static_assert_test_fail_5.cpp static_assert_test_fail_5.cpp]] [No] [Illustrates failure at template class scope. ]]
|
|
|
|
|
[[[@../../libs/static_assert/static_assert_test_fail_6.cpp static_assert_test_fail_6.cpp]] [No] [Illustrates failure at template class member function scope. ]]
|
|
|
|
|
[[[@../../libs/static_assert/static_assert_test_fail_7.cpp static_assert_test_fail_7.cpp]] [No] [Illustrates failure of class scope example. ]]
|
|
|
|
|
[[[@../../libs/static_assert/static_assert_test_fail_8.cpp static_assert_test_fail_8.cpp]] [No] [Illustrates failure of function scope example. ]]
|
|
|
|
|
[[[@../../libs/static_assert/static_assert_test_fail_9.cpp static_assert_test_fail_9.cpp]] [No] [Illustrates failure of function scope example (part 2). ]]
|
|
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|