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
+17 -6
View File
@@ -62,11 +62,22 @@ namespace boost
};
//
// Add const qualification for iterators which are not writable
//
template<class Value, class AccessCategory>
struct const_qualified :
struct const_qualified_ref :
mpl::if_< is_tag< writable_iterator_tag, AccessCategory >,
Value,
Value const >
Value&,
Value const& >
{};
// The apparent duplication here works around a Borland problem
template<class Value, class AccessCategory>
struct const_qualified_ptr :
mpl::if_< is_tag< writable_iterator_tag, AccessCategory >,
Value*,
Value const* >
{};
//
@@ -84,7 +95,7 @@ namespace boost
, Difference
, typename const_qualified<Value, AccessCategory>::type*
, typename const_qualified_ptr<Value, AccessCategory>::type
// The use_default support is needed for iterator_adaptor.
// For practical reasons iterator_adaptor needs to specify
@@ -93,7 +104,7 @@ namespace boost
// is your default parameter".
, typename mpl::if_<
is_same<Reference, use_default>
, typename const_qualified<Value, AccessCategory>::type&
, typename const_qualified_ref<Value, AccessCategory>::type
, Reference
>::type
>
@@ -333,7 +344,7 @@ namespace boost
, class Value
, class AccessCategory
, class TraversalCategory
, class Reference = typename detail::const_qualified<Value, AccessCategory>::type&
, class Reference = typename detail::const_qualified_ref<Value, AccessCategory>::type
, class Difference = std::ptrdiff_t
>
class iterator_facade