iterator_archetypes.hpp, iterator_concepts.hpp -

incrementable_iterator_tag -> incrementable_traversal_tag
   single_pass_iterator_tag -> single_pass_traversal_tag

iterator_categories.hpp -

   added writability stripping to new_category_to_access for iterator

   adaptors based on iterators with new-style tags

   ReturnTag->AccessTag / returns->access

   Fixed a bug which would rule out user-defined access/traversal tags
   - we weren't accounting for tag convertibility without public
   inheritance.

iterator_facade.hpp -

   Workaround for a Borland const-dropping bug.

detail/categories.hpp -

   fixed is_tag so it doesn't rely on inheritance for detection

concept_tests.cpp -

   added new tests, use static_assert_same for better feedback on failure

iterator_adaptor_test.cpp

   workarounds for CWPro7, use static_assert_same for better feedback on failure
   wiped out #if 0 section

unit_tests.cpp -

   factored static_assert_same into a separate file


[SVN r1296]
This commit is contained in:
Dave Abrahams
2003-05-31 02:44:39 +00:00
parent e2b58d1eea
commit 65fe9a13e5
9 changed files with 306 additions and 157 deletions
+3 -20
View File
@@ -5,7 +5,7 @@
// to its suitability for any purpose.
#include <boost/iterator/iterator_adaptor.hpp>
#include <boost/static_assert.hpp>
#include <boost/type.hpp>
#include "static_assert_same.hpp"
struct X { int a; };
@@ -30,25 +30,6 @@ void operator_arrow_test()
take_xptr(Xiter(&x).operator->());
}
template <class T, class U>
struct static_assert_same
#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
{
template <class V>
static int check(V, V);
enum { value = sizeof(check(boost::type<T>(), boost::type<U>())) };
}
#endif
;
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
template <class T>
struct static_assert_same<T,T>
{
enum { value };
};
#endif
template <class T, class U, class Min>
struct static_assert_min_cat
: static_assert_same<
@@ -109,6 +90,8 @@ void category_test()
test = static_assert_min_cat<
std::output_iterator_tag,std::random_access_iterator_tag, std::output_iterator_tag
>::value;
(void)test;
}
int main()