Compare commits

..

1 Commits

Author SHA1 Message Date
c0b05f7642 Branch for development of boost.system related changes
[SVN r40931]
2007-11-08 14:20:16 +00:00

View File

@ -15,10 +15,6 @@
[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)`,
@ -98,17 +94,12 @@ 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;