merged from trunk

[SVN r21516]
This commit is contained in:
Dave Abrahams
2004-01-06 17:36:30 +00:00
parent f5d1feb76e
commit cf068fba24
7 changed files with 92 additions and 163 deletions
+8 -1
View File
@@ -18,7 +18,13 @@ test-suite iterator
# compilation problems.
[ run is_convertible_fail.cpp ]
[ run zip_iterator_test.cpp ]
[ run zip_iterator_test.cpp
: : :
# stlport's debug mode generates long symbols which overwhelm
# vc6
<msvc-stlport><*><runtime-build>release
]
# These tests should work for just about everything.
[ compile is_lvalue_iterator.cpp ]
@@ -31,6 +37,7 @@ test-suite iterator
[ compile iterator_archetype_cc.cpp ]
[ run transform_iterator_test.cpp ]
[ run indirect_iterator_test.cpp ]
[ compile indirect_iterator_member_types.cpp ]
[ run filter_iterator_test.cpp ]
[ run reverse_iterator_test.cpp ]
[ run counting_iterator_test.cpp ]
+15 -4
View File
@@ -26,6 +26,8 @@
#include <boost/shared_ptr.hpp>
#include <boost/utility.hpp>
#include <boost/mpl/aux_/has_xxx.hpp>
#include <boost/type_traits/broken_compiler_spec.hpp>
#include <vector>
#include <stdlib.h>
@@ -43,6 +45,9 @@
#endif
template <class T> struct see_type;
template <int I> struct see_val;
struct my_iterator_tag : public std::random_access_iterator_tag { };
using boost::dummyT;
@@ -136,6 +141,10 @@ void more_indirect_iterator_tests()
assert(std::equal(db, de, store.begin()));
}
// element_type detector; defaults to true so the test passes when
// has_xxx isn't implemented
BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(has_element_type, element_type, true)
int
main()
{
@@ -143,6 +152,10 @@ main()
dummyT(3), dummyT(4), dummyT(5) };
const int N = sizeof(array)/sizeof(dummyT);
# if BOOST_WORKAROUND(BOOST_MSVC, == 1200)
boost::shared_ptr<dummyT> zz((dummyT*)0); // Why? I don't know, but it suppresses a bad instantiation.
# endif
typedef std::vector<boost::shared_ptr<dummyT> > shared_t;
shared_t shared;
@@ -151,9 +164,8 @@ main()
typedef boost::indirect_iterator<shared_t::iterator> iter_t;
BOOST_STATIC_ASSERT(
boost::detail::has_element_type<
boost::shared_ptr<dummyT>
// std::iterator_traits<shared_t::iterator>::value_type
has_element_type<
boost::detail::iterator_traits<shared_t::iterator>::value_type
>::value
);
@@ -195,7 +207,6 @@ main()
const_indirect_iterator j(ptr);
boost::random_access_iterator_test(j, N, array);
dummyT const*const* const_ptr = ptr;
boost::random_access_iterator_test(boost::make_indirect_iterator(const_ptr), N, array);
+5
View File
@@ -7,6 +7,7 @@
# define STATIC_ASSERT_SAME_DWA2003530_HPP
# include <boost/type.hpp>
# include <boost/static_assert.hpp>
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
template <class T, class U>
@@ -32,4 +33,8 @@ struct static_assert_same
{};
#endif
#define STATIC_ASSERT_SAME( T1,T2 ) \
enum { BOOST_JOIN(boost_static_assert_enum_, __LINE__) \
= static_assert_same<T1,T2>::value }
#endif // STATIC_ASSERT_SAME_DWA2003530_HPP
+1
View File
@@ -46,6 +46,7 @@
#include <vector>
#include <list>
#include <set>
#include <functional>
#include <boost/tuple/tuple.hpp>
#include <boost/iterator/transform_iterator.hpp>
#include <boost/iterator/is_readable_iterator.hpp>