From 750f40c2fd69a1cbf783583ae32f51b1caf2156d Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Fri, 12 Oct 2001 21:58:50 +0000 Subject: [PATCH] removed less() function from policies policies now operate on whole adaptors rather than Base types [SVN r11377] --- iterator_adaptor_test.cpp | 3 +- iterator_traits_test.cpp | 66 ++++++++++++++++++++++----------------- 2 files changed, 40 insertions(+), 29 deletions(-) diff --git a/iterator_adaptor_test.cpp b/iterator_adaptor_test.cpp index 03f44aa..67058f3 100644 --- a/iterator_adaptor_test.cpp +++ b/iterator_adaptor_test.cpp @@ -111,7 +111,8 @@ main() // implementation match up. boost::function_requires< boost::RandomAccessIteratorPoliciesConcept< - boost::default_iterator_policies, int*, + boost::default_iterator_policies, + boost::iterator_adaptor, boost::iterator > >(); diff --git a/iterator_traits_test.cpp b/iterator_traits_test.cpp index 716a411..5609a13 100644 --- a/iterator_traits_test.cpp +++ b/iterator_traits_test.cpp @@ -7,6 +7,7 @@ // See http://www.boost.org for most recent version including documentation. // Revision History +// 12 Oct 2001 Put static asserts in functions for MWERSK (Dave Abrahams) // 04 Mar 2001 Patches for Intel C++ (Dave Abrahams) // 19 Feb 2001 Take advantage of improved iterator_traits to do more tests // on MSVC. Reordered some #ifdefs for coherency. @@ -84,35 +85,41 @@ template struct non_portable_tests { - // Unfortunately, the VC6 standard library doesn't supply these :( - BOOST_STATIC_ASSERT(( - boost::is_same< - typename boost::detail::iterator_traits::pointer, - pointer - >::value)); - - BOOST_STATIC_ASSERT(( - boost::is_same< - typename boost::detail::iterator_traits::reference, - reference - >::value)); + non_portable_tests() + { + // Unfortunately, the VC6 standard library doesn't supply these :( + BOOST_STATIC_ASSERT(( + boost::is_same< + typename boost::detail::iterator_traits::pointer, + pointer + >::value)); + + BOOST_STATIC_ASSERT(( + boost::is_same< + typename boost::detail::iterator_traits::reference, + reference + >::value)); + } }; template struct portable_tests { - BOOST_STATIC_ASSERT(( - boost::is_same< - typename boost::detail::iterator_traits::difference_type, - difference_type - >::value)); - - BOOST_STATIC_ASSERT(( - boost::is_same< - typename boost::detail::iterator_traits::iterator_category, - category - >::value)); + portable_tests() + { + BOOST_STATIC_ASSERT(( + boost::is_same< + typename boost::detail::iterator_traits::difference_type, + difference_type + >::value)); + + BOOST_STATIC_ASSERT(( + boost::is_same< + typename boost::detail::iterator_traits::iterator_category, + category + >::value)); + } }; // Test iterator_traits @@ -121,11 +128,14 @@ template { - BOOST_STATIC_ASSERT(( - boost::is_same< - typename boost::detail::iterator_traits::value_type, - value_type - >::value)); + input_iterator_test() + { + BOOST_STATIC_ASSERT(( + boost::is_same< + typename boost::detail::iterator_traits::value_type, + value_type + >::value)); + } }; template