Compare commits

...

13 Commits

Author SHA1 Message Date
4156b6d1db v2, v3, integration branch
[SVN r62649]
2010-06-09 11:34:33 +00:00
80c6340833 Use BOOST_NO_STATIC_ASSERT
[SVN r59698]
2010-02-16 12:45:53 +00:00
138c5bde91 Fix gcc warning.
[SVN r57495]
2009-11-08 18:59:24 +00:00
5d9274a683 rm cmake from trunk. I'm not entirely sure this is necessary to satisfy the inspect script, but I'm not taking any chances, and it is easy to put back
[SVN r56942]
2009-10-17 02:07:38 +00:00
87ecd7d39f Copyrights on CMakeLists.txt to keep them from clogging up the inspect
reports.  This is essentially the same commit as r55095 on the release
branch.



[SVN r55159]
2009-07-26 00:49:56 +00:00
62461d8848 Add PDF generation options to fix external links to point to the web site.
Added a few more Boostbook based libs that were missed first time around.
Fixed PDF naming issues.

[SVN r51284]
2009-02-17 10:05:58 +00:00
a7e33291eb Fix up PDF generation options.
[SVN r50910]
2009-01-30 18:20:49 +00:00
413e7eda07 Fix inclusion of incorrect header.
Fixes #2537.

[SVN r50371]
2008-12-23 12:03:43 +00:00
a9a9f0591b Updating dependency information for modularized libraries.
[SVN r49628]
2008-11-07 17:05:27 +00:00
effe841116 Continuing merge of CMake build system files into trunk with the encouragement of Doug Gregor
[SVN r49510]
2008-11-01 13:15:41 +00:00
8cfe5d77c0 Fix a PDF link that I missed before.
[SVN r47364]
2008-07-12 19:32:15 +00:00
8b819d5c6c Changed BOOST_STATIC_ASSERT for GCC to suppress warnings about old C style casts.
[SVN r43988]
2008-04-01 17:53:56 +00:00
bc5065e495 Added link to PDF docs.
[SVN r43357]
2008-02-21 16:49:59 +00:00
5 changed files with 55 additions and 12 deletions

View File

@ -5,6 +5,8 @@
using quickbook ;
path-constant boost-images : ../../../doc/src/images ;
xml static_assert : static_assert.qbk ;
boostbook standalone
:
@ -12,9 +14,31 @@ boostbook standalone
:
<xsl:param>nav.layout=none
<xsl:param>navig.graphics=0
# PDF Options:
# TOC Generation: this is needed for FOP-0.9 and later:
<xsl:param>fop1.extensions=0
# Or enable this if you're using XEP:
<xsl:param>xep.extensions=1
# TOC generation: this is needed for FOP 0.2, but must not be set to zero for FOP-0.9!
<xsl:param>fop.extensions=0
# No indent on body text:
<xsl:param>body.start.indent=0pt
# Margin size:
<xsl:param>page.margin.inner=0.5in
# Margin size:
<xsl:param>page.margin.outer=0.5in
# Yes, we want graphics for admonishments:
<xsl:param>admon.graphics=1
# Set this one for PDF generation *only*:
# default pnd graphics are awful in PDF form,
# better use SVG's instead:
<format>pdf:<xsl:param>admon.graphics.extension=".svg"
<format>pdf:<xsl:param>admon.graphics.path=$(boost-images)/
<format>pdf:<xsl:param>boost.url.prefix=http://www.boost.org/doc/libs/release/doc/html
;
install html : ../../../doc/html/boostbook.css ;
install ../ : ../../../boost.png ;

View File

@ -15,6 +15,10 @@
[last-revision $Date$]
]
This manual is also available in
[@http://svn.boost.org/svn/boost/sandbox/pdf/static_assert/release/static_assert.pdf
printer friendly PDF format].
[section:intro Overview and Tutorial]
The header `<boost/static_assert.hpp>` supplies a single macro `BOOST_STATIC_ASSERT(x)`,
@ -94,12 +98,17 @@ the user that the template is being misused.
#include <boost/type_traits.hpp>
template <class RandomAccessIterator >
RandomAccessIterator foo(RandomAccessIterator from, RandomAccessIterator to)
RandomAccessIterator foo(RandomAccessIterator from,
RandomAccessIterator to)
{
// this template can only be used with
// random access iterators...
typedef typename std::iterator_traits< RandomAccessIterator >::iterator_category cat;
BOOST_STATIC_ASSERT((boost::is_convertible<cat, const std::random_access_iterator_tag&>::value));
typedef typename std::iterator_traits<
RandomAccessIterator >::iterator_category cat;
BOOST_STATIC_ASSERT(
(boost::is_convertible<
cat,
const std::random_access_iterator_tag&>::value));
//
// detail goes here...
return from;
@ -122,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>

View File

@ -28,7 +28,17 @@
# define BOOST_SA_GCC_WORKAROUND
#endif
#ifdef BOOST_HAS_STATIC_ASSERT
//
// If the compiler issues warnings about old C style casts,
// then enable this:
//
#if defined(__GNUC__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 4)))
# define BOOST_STATIC_ASSERT_BOOL_CAST( x ) ((x) == 0 ? false : true)
#else
# define BOOST_STATIC_ASSERT_BOOL_CAST(x) (bool)(x)
#endif
#ifndef BOOST_NO_STATIC_ASSERT
# define BOOST_STATIC_ASSERT( B ) static_assert(B, #B)
#else
@ -78,14 +88,14 @@ template<int x> struct static_assert_test{};
#elif defined(BOOST_MSVC)
#define BOOST_STATIC_ASSERT( B ) \
typedef ::boost::static_assert_test<\
sizeof(::boost::STATIC_ASSERTION_FAILURE< (bool)( B ) >)>\
sizeof(::boost::STATIC_ASSERTION_FAILURE< BOOST_STATIC_ASSERT_BOOL_CAST ( B ) >)>\
BOOST_JOIN(boost_static_assert_typedef_, __COUNTER__)
#elif defined(BOOST_INTEL_CXX_VERSION) || defined(BOOST_SA_GCC_WORKAROUND)
// agurt 15/sep/02: a special care is needed to force Intel C++ issue an error
// instead of warning in case of failure
# define BOOST_STATIC_ASSERT( B ) \
typedef char BOOST_JOIN(boost_static_assert_typedef_, __LINE__) \
[ ::boost::STATIC_ASSERTION_FAILURE< (bool)( B ) >::value ]
[ ::boost::STATIC_ASSERTION_FAILURE< BOOST_STATIC_ASSERT_BOOL_CAST( B ) >::value ]
#elif defined(__sgi)
// special version for SGI MIPSpro compiler
#define BOOST_STATIC_ASSERT( B ) \
@ -100,12 +110,12 @@ template<int x> struct static_assert_test{};
#define BOOST_STATIC_ASSERT( B ) \
BOOST_STATIC_CONSTANT(int, \
BOOST_JOIN(boost_static_assert_test_, __LINE__) = \
sizeof(::boost::STATIC_ASSERTION_FAILURE< (bool)( B ) >) )
sizeof(::boost::STATIC_ASSERTION_FAILURE< BOOST_STATIC_ASSERT_BOOL_CAST( B ) >) )
#else
// generic version
#define BOOST_STATIC_ASSERT( B ) \
typedef ::boost::static_assert_test<\
sizeof(::boost::STATIC_ASSERTION_FAILURE< (bool)( B ) >)>\
sizeof(::boost::STATIC_ASSERTION_FAILURE< BOOST_STATIC_ASSERT_BOOL_CAST( B ) >)>\
BOOST_JOIN(boost_static_assert_typedef_, __LINE__)
#endif
@ -115,7 +125,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 // defined(BOOST_NO_STATIC_ASSERT)
#endif // BOOST_STATIC_ASSERT_HPP

View File

@ -12,7 +12,7 @@
#include <boost/type_traits.hpp>
template <class RandomAccessIterator >
RandomAccessIterator foo(RandomAccessIterator from, RandomAccessIterator to)
RandomAccessIterator foo(RandomAccessIterator from, RandomAccessIterator /*to*/)
{
// this template can only be used with
// random access iterators...

View File

@ -5,7 +5,7 @@
// See http://www.boost.org for most recent version including documentation.
#include <climits>
#include <limits>
#include <boost/limits.hpp>
#include <boost/static_assert.hpp>