Bug fix and associated unit tests

[SVN r1185]
This commit is contained in:
Dave Abrahams
2003-04-25 15:18:49 +00:00
parent 3c78ef32c3
commit 1ab474b853
3 changed files with 38 additions and 1 deletions

View File

@@ -124,8 +124,8 @@ namespace boost
readable_lvalue_iterator_tag readable_lvalue_iterator_tag
, typename access_category_tag<Category,Reference>::type , typename access_category_tag<Category,Reference>::type
> >
, operator_arrow_proxy<Value>
, Pointer , Pointer
, operator_arrow_proxy<Value>
> >
{ {
}; };

View File

@@ -1,5 +1,6 @@
SEARCH on testing.jam = $(BOOST_BUILD_PATH) ; SEARCH on testing.jam = $(BOOST_BUILD_PATH) ;
include testing.jam ; include testing.jam ;
run unit_tests.cpp ;
run concept_tests.cpp ; run concept_tests.cpp ;
run iterator_adaptor_cc.cpp ; run iterator_adaptor_cc.cpp ;
run iterator_adaptor_test.cpp ; run iterator_adaptor_test.cpp ;

36
test/unit_tests.cpp Executable file
View File

@@ -0,0 +1,36 @@
// Copyright David Abrahams 2003. Permission to copy, use,
// modify, sell and distribute this software is granted provided this
// copyright notice appears in all copies. This software is provided
// "as is" without express or implied warranty, and with no claim as
// to its suitability for any purpose.
#include <boost/iterator/iterator_adaptor.hpp>
struct X { int a; };
#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
namespace boost { namespace detail {
template<> struct iterator_traits<X*>
: ptr_iter_traits<X> {};
}}
#endif
struct Xiter : boost::iterator_adaptor<Xiter,X*>
{
Xiter();
Xiter(X* p) : boost::iterator_adaptor<Xiter, X*>(p) {}
};
void take_xptr(X*) {}
void operator_arrow_test()
{
// check that the operator-> result is a pointer for lvalue iterators
X x;
take_xptr(Xiter(&x).operator->());
}
int main()
{
operator_arrow_test();
return 0;
}