mirror of
https://github.com/boostorg/iterator.git
synced 2025-06-27 13:01:39 +02:00
Compare commits
10 Commits
svn-branch
...
svn-branch
Author | SHA1 | Date | |
---|---|---|---|
b498667808 | |||
ac522bc9e1 | |||
4c60e26bf8 | |||
d11c7a3ec4 | |||
76fd8e27fb | |||
f2433c63d5 | |||
55c08b706c | |||
835498603d | |||
b0ec5a759b | |||
e06c4b3279 |
@ -16,5 +16,7 @@ boostbook standalone
|
|||||||
<xsl:param>toc.max.depth=3
|
<xsl:param>toc.max.depth=3
|
||||||
<xsl:param>toc.section.depth=3
|
<xsl:param>toc.section.depth=3
|
||||||
<xsl:param>chunk.section.depth=4
|
<xsl:param>chunk.section.depth=4
|
||||||
|
<format>pdf:<xsl:param>boost.url.prefix=http://www.boost.org/doc/libs/release/libs/iterator/doc
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) \
|
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) \
|
||||||
|| BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x531)) \
|
|| BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x5A0)) \
|
||||||
|| (BOOST_WORKAROUND(BOOST_INTEL_CXX_VERSION, <= 700) && defined(_MSC_VER)) \
|
|| (BOOST_WORKAROUND(BOOST_INTEL_CXX_VERSION, <= 700) && defined(_MSC_VER)) \
|
||||||
|| BOOST_WORKAROUND(__DECCXX_VER, BOOST_TESTED_AT(60590042)) \
|
|| BOOST_WORKAROUND(__DECCXX_VER, BOOST_TESTED_AT(60590042)) \
|
||||||
|| BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x590))
|
|| BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x590))
|
||||||
|
@ -110,7 +110,7 @@ namespace boost
|
|||||||
private:
|
private:
|
||||||
typename super_t::reference dereference() const
|
typename super_t::reference dereference() const
|
||||||
{
|
{
|
||||||
# if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551))
|
# if BOOST_WORKAROUND(__BORLANDC__, < 0x5A0 )
|
||||||
return const_cast<super_t::reference>(**this->base());
|
return const_cast<super_t::reference>(**this->base());
|
||||||
# else
|
# else
|
||||||
return **this->base();
|
return **this->base();
|
||||||
|
@ -24,9 +24,14 @@
|
|||||||
|
|
||||||
#ifdef BOOST_ITERATOR_REF_CONSTNESS_KILLS_WRITABILITY
|
#ifdef BOOST_ITERATOR_REF_CONSTNESS_KILLS_WRITABILITY
|
||||||
# include <boost/type_traits/remove_reference.hpp>
|
# include <boost/type_traits/remove_reference.hpp>
|
||||||
#else
|
|
||||||
|
# if BOOST_WORKAROUND(__CODEGEARC__, BOOST_TESTED_AT(0x610))
|
||||||
|
# include <boost/type_traits/add_reference.hpp>
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#else
|
||||||
# include <boost/type_traits/add_reference.hpp>
|
# include <boost/type_traits/add_reference.hpp>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <boost/iterator/detail/config_def.hpp>
|
#include <boost/iterator/detail/config_def.hpp>
|
||||||
|
|
||||||
|
@ -105,6 +105,7 @@ namespace boost
|
|||||||
|
|
||||||
typedef typename remove_const<ValueParam>::type value_type;
|
typedef typename remove_const<ValueParam>::type value_type;
|
||||||
|
|
||||||
|
// Not the real associated pointer type
|
||||||
typedef typename mpl::eval_if<
|
typedef typename mpl::eval_if<
|
||||||
boost::detail::iterator_writability_disabled<ValueParam,Reference>
|
boost::detail::iterator_writability_disabled<ValueParam,Reference>
|
||||||
, add_pointer<const value_type>
|
, add_pointer<const value_type>
|
||||||
@ -470,8 +471,7 @@ namespace boost
|
|||||||
//
|
//
|
||||||
class iterator_core_access
|
class iterator_core_access
|
||||||
{
|
{
|
||||||
# if defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS) \
|
# if defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS)
|
||||||
|| BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551))
|
|
||||||
// Tasteless as this may seem, making all members public allows member templates
|
// Tasteless as this may seem, making all members public allows member templates
|
||||||
// to work in the absence of member template friends.
|
// to work in the absence of member template friends.
|
||||||
public:
|
public:
|
||||||
@ -618,6 +618,12 @@ namespace boost
|
|||||||
Value, CategoryOrTraversal, Reference, Difference
|
Value, CategoryOrTraversal, Reference, Difference
|
||||||
> associated_types;
|
> associated_types;
|
||||||
|
|
||||||
|
typedef boost::detail::operator_arrow_result<
|
||||||
|
typename associated_types::value_type
|
||||||
|
, Reference
|
||||||
|
, typename associated_types::pointer
|
||||||
|
> pointer_;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// For use by derived classes
|
// For use by derived classes
|
||||||
typedef iterator_facade<Derived,Value,CategoryOrTraversal,Reference,Difference> iterator_facade_;
|
typedef iterator_facade<Derived,Value,CategoryOrTraversal,Reference,Difference> iterator_facade_;
|
||||||
@ -627,7 +633,9 @@ namespace boost
|
|||||||
typedef typename associated_types::value_type value_type;
|
typedef typename associated_types::value_type value_type;
|
||||||
typedef Reference reference;
|
typedef Reference reference;
|
||||||
typedef Difference difference_type;
|
typedef Difference difference_type;
|
||||||
typedef typename associated_types::pointer pointer;
|
|
||||||
|
typedef typename pointer_::type pointer;
|
||||||
|
|
||||||
typedef typename associated_types::iterator_category iterator_category;
|
typedef typename associated_types::iterator_category iterator_category;
|
||||||
|
|
||||||
reference operator*() const
|
reference operator*() const
|
||||||
@ -635,18 +643,9 @@ namespace boost
|
|||||||
return iterator_core_access::dereference(this->derived());
|
return iterator_core_access::dereference(this->derived());
|
||||||
}
|
}
|
||||||
|
|
||||||
typename boost::detail::operator_arrow_result<
|
pointer operator->() const
|
||||||
value_type
|
|
||||||
, reference
|
|
||||||
, pointer
|
|
||||||
>::type
|
|
||||||
operator->() const
|
|
||||||
{
|
{
|
||||||
return boost::detail::operator_arrow_result<
|
return pointer_::make(*this->derived());
|
||||||
value_type
|
|
||||||
, reference
|
|
||||||
, pointer
|
|
||||||
>::make(*this->derived());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
typename boost::detail::operator_brackets_result<Derived,Value,reference>::type
|
typename boost::detail::operator_brackets_result<Derived,Value,reference>::type
|
||||||
|
@ -357,7 +357,7 @@ namespace boost {
|
|||||||
{
|
{
|
||||||
typedef typename tuple_impl_specific::tuple_meta_transform<
|
typedef typename tuple_impl_specific::tuple_meta_transform<
|
||||||
IteratorTuple
|
IteratorTuple
|
||||||
, iterator_traversal<>
|
, pure_traversal_tag<iterator_traversal<> >
|
||||||
>::type tuple_of_traversal_tags;
|
>::type tuple_of_traversal_tags;
|
||||||
|
|
||||||
typedef typename tuple_impl_specific::tuple_meta_accumulate<
|
typedef typename tuple_impl_specific::tuple_meta_accumulate<
|
||||||
|
@ -87,6 +87,10 @@ struct input_iter
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template <class T, class U>
|
||||||
|
void same_type(U const&)
|
||||||
|
{ BOOST_MPL_ASSERT((boost::is_same<T,U>)); }
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
int state = 0;
|
int state = 0;
|
||||||
@ -101,6 +105,8 @@ int main()
|
|||||||
input_iter p;
|
input_iter p;
|
||||||
(*p).mutator();
|
(*p).mutator();
|
||||||
p->mutator();
|
p->mutator();
|
||||||
|
|
||||||
|
same_type<input_iter::pointer>(p.operator->());
|
||||||
|
|
||||||
return boost::report_errors();
|
return boost::report_errors();
|
||||||
}
|
}
|
||||||
|
@ -46,6 +46,7 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <set>
|
#include <set>
|
||||||
|
#include <string>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <boost/tuple/tuple.hpp>
|
#include <boost/tuple/tuple.hpp>
|
||||||
#include <boost/iterator/transform_iterator.hpp>
|
#include <boost/iterator/transform_iterator.hpp>
|
||||||
@ -60,6 +61,27 @@ struct pure_traversal
|
|||||||
typename boost::iterator_traversal<It>::type
|
typename boost::iterator_traversal<It>::type
|
||||||
>
|
>
|
||||||
{};
|
{};
|
||||||
|
|
||||||
|
|
||||||
|
/// Tests for https://svn.boost.org/trac/boost/ticket/1517
|
||||||
|
int to_value(int const &v)
|
||||||
|
{
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
|
||||||
|
void category_test()
|
||||||
|
{
|
||||||
|
std::list<int> rng1;
|
||||||
|
std::string rng2;
|
||||||
|
|
||||||
|
boost::make_zip_iterator(
|
||||||
|
boost::make_tuple(
|
||||||
|
boost::make_transform_iterator(rng1.begin(), &to_value), // BidirectionalInput
|
||||||
|
rng2.begin() // RandomAccess
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
///
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
@ -70,6 +92,8 @@ struct pure_traversal
|
|||||||
int main( void )
|
int main( void )
|
||||||
{
|
{
|
||||||
|
|
||||||
|
category_test();
|
||||||
|
|
||||||
std::cout << "\n"
|
std::cout << "\n"
|
||||||
<< "***********************************************\n"
|
<< "***********************************************\n"
|
||||||
<< "* *\n"
|
<< "* *\n"
|
||||||
|
Reference in New Issue
Block a user