Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions include/boost/iterator/detail/facade_iterator_category.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,14 @@
# include <boost/mpl/if.hpp>
# include <boost/mpl/eval_if.hpp>
# include <boost/mpl/identity.hpp>
# include <boost/mpl/assert.hpp>

# include <boost/static_assert.hpp>

# include <boost/type_traits/is_same.hpp>
# include <boost/type_traits/is_const.hpp>
# include <boost/type_traits/is_reference.hpp>
# include <boost/type_traits/is_convertible.hpp>

# include <boost/type_traits/is_same.hpp>

# include <boost/iterator/detail/config_def.hpp> // try to keep this last

# ifdef BOOST_ITERATOR_REF_CONSTNESS_KILLS_WRITABILITY
Expand Down Expand Up @@ -139,17 +138,17 @@ struct iterator_category_with_traversal
// Make sure this isn't used to build any categories where
// convertibility to Traversal is redundant. Should just use the
// Category element in that case.
BOOST_MPL_ASSERT_NOT((
is_convertible<
BOOST_STATIC_ASSERT((
!is_convertible<
typename iterator_category_to_traversal<Category>::type
, Traversal
>));
>::value));

BOOST_MPL_ASSERT((is_iterator_category<Category>));
BOOST_MPL_ASSERT_NOT((is_iterator_category<Traversal>));
BOOST_MPL_ASSERT_NOT((is_iterator_traversal<Category>));
BOOST_STATIC_ASSERT(is_iterator_category<Category>::value);
BOOST_STATIC_ASSERT(!is_iterator_category<Traversal>::value);
BOOST_STATIC_ASSERT(!is_iterator_traversal<Category>::value);
# if !BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1310))
BOOST_MPL_ASSERT((is_iterator_traversal<Traversal>));
BOOST_STATIC_ASSERT(is_iterator_traversal<Traversal>::value);
# endif
};

Expand All @@ -158,7 +157,7 @@ struct iterator_category_with_traversal
template <class Traversal, class ValueParam, class Reference>
struct facade_iterator_category_impl
{
BOOST_MPL_ASSERT_NOT((is_iterator_category<Traversal>));
BOOST_STATIC_ASSERT(!is_iterator_category<Traversal>::value);

typedef typename iterator_facade_default_category<
Traversal,ValueParam,Reference
Expand Down
4 changes: 2 additions & 2 deletions include/boost/iterator/iterator_concepts.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ namespace boost_concepts
{
typedef typename std::iterator_traits<Iterator>::difference_type difference_type;

BOOST_MPL_ASSERT((boost::is_integral<difference_type>));
BOOST_MPL_ASSERT_RELATION(std::numeric_limits<difference_type>::is_signed, ==, true);
BOOST_STATIC_ASSERT(boost::is_integral<difference_type>::value);
BOOST_STATIC_ASSERT(std::numeric_limits<difference_type>::is_signed);

BOOST_CONCEPT_ASSERT((
boost::Convertible<
Expand Down
2 changes: 1 addition & 1 deletion test/iterator_facade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ struct iterator_with_proxy_reference

template <class T, class U>
void same_type(U const&)
{ BOOST_MPL_ASSERT((boost::is_same<T,U>)); }
{ BOOST_STATIC_ASSERT((boost::is_same<T,U>::value)); }

template <class I, class A>
struct abstract_iterator
Expand Down
8 changes: 4 additions & 4 deletions test/static_assert_same.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
#ifndef STATIC_ASSERT_SAME_DWA2003530_HPP
# define STATIC_ASSERT_SAME_DWA2003530_HPP

#include <boost/mpl/assert.hpp>
# include <boost/type_traits/is_same.hpp>
#include <boost/static_assert.hpp>
#include <boost/type_traits/is_same.hpp>

#define STATIC_ASSERT_SAME( T1,T2 ) BOOST_MPL_ASSERT((::boost::is_same< T1, T2 >))
#define STATIC_ASSERT_SAME( T1,T2 ) BOOST_STATIC_ASSERT((::boost::is_same< T1, T2 >::value))

template <class T1, class T2>
struct static_assert_same
{
BOOST_MPL_ASSERT((::boost::is_same< T1, T2 >));
STATIC_ASSERT_SAME(T1, T2);
enum { value = 1 };
};

Expand Down