forked from boostorg/utility
Compare commits
12 Commits
boost-1.28
...
svn-branch
Author | SHA1 | Date | |
---|---|---|---|
|
cfb38f7097 | ||
|
4ba6a96822 | ||
|
1ea4140d56 | ||
|
351d4ecb15 | ||
|
7fbf84dcc6 | ||
|
3ff49b272d | ||
|
5b52e3d418 | ||
|
8c0eb498d3 | ||
|
48a81ef7ea | ||
|
f7610c9b26 | ||
|
1755eaf019 | ||
|
6b8b218efb |
@@ -103,7 +103,7 @@ void random_sorted_sequence(T& seq)
|
|||||||
sort_by_value(seq);
|
sort_by_value(seq);
|
||||||
}
|
}
|
||||||
|
|
||||||
# if defined(BOOST_MSVC) && !defined(__SGI_STL_PORT)
|
# if defined(BOOST_MSVC) && BOOST_MSVC < 1300 && !defined(__SGI_STL_PORT)
|
||||||
// VC6's standard lib doesn't have a template member function for list::sort()
|
// VC6's standard lib doesn't have a template member function for list::sort()
|
||||||
template <>
|
template <>
|
||||||
void random_sorted_sequence(std::list<std::string>& result)
|
void random_sorted_sequence(std::list<std::string>& result)
|
||||||
|
@@ -329,7 +329,7 @@ void compressed_pair_array_tester<T1, T2>::test(first_param_type p1, second_para
|
|||||||
BOOST_TEST(sizeof(T2) == sizeof(cp1.second()));
|
BOOST_TEST(sizeof(T2) == sizeof(cp1.second()));
|
||||||
}
|
}
|
||||||
|
|
||||||
int test_main(int, char **)
|
int test_main(int, char *[])
|
||||||
{
|
{
|
||||||
// declare some variables to pass to the tester:
|
// declare some variables to pass to the tester:
|
||||||
non_empty1 ne1(2);
|
non_empty1 ne1(2);
|
||||||
|
@@ -35,13 +35,15 @@ int main(int, char*[])
|
|||||||
|
|
||||||
std::vector<std::vector<int>::iterator> pointers;
|
std::vector<std::vector<int>::iterator> pointers;
|
||||||
|
|
||||||
// VC6 gets an internal compiler error on this
|
|
||||||
#if !defined(BOOST_MSVC) || (BOOST_MSVC > 1200)
|
|
||||||
// Use counting iterator to fill in the array of pointers.
|
// Use counting iterator to fill in the array of pointers.
|
||||||
|
// causes an ICE with MSVC6
|
||||||
|
#if !defined(BOOST_MSVC) || (BOOST_MSVC > 1200)
|
||||||
std::copy(boost::make_counting_iterator(numbers.begin()),
|
std::copy(boost::make_counting_iterator(numbers.begin()),
|
||||||
boost::make_counting_iterator(numbers.end()),
|
boost::make_counting_iterator(numbers.end()),
|
||||||
std::back_inserter(pointers));
|
std::back_inserter(pointers));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(BOOST_MSVC) || (BOOST_MSVC > 1300)
|
||||||
// Use indirect iterator to print out numbers by accessing
|
// Use indirect iterator to print out numbers by accessing
|
||||||
// them through the array of pointers.
|
// them through the array of pointers.
|
||||||
std::cout << "indirectly printing out the numbers from 0 to "
|
std::cout << "indirectly printing out the numbers from 0 to "
|
||||||
|
@@ -247,7 +247,7 @@ int main()
|
|||||||
|
|
||||||
// wrapping an iterator or non-built-in integer type causes an INTERNAL
|
// wrapping an iterator or non-built-in integer type causes an INTERNAL
|
||||||
// COMPILER ERROR in MSVC without STLport. I'm clueless as to why.
|
// COMPILER ERROR in MSVC without STLport. I'm clueless as to why.
|
||||||
#if !defined(BOOST_MSVC) || defined(__SGI_STL_PORT)
|
#if !defined(BOOST_MSVC) || BOOST_MSVC > 1200 || defined(__SGI_STL_PORT)
|
||||||
// Test user-defined type.
|
// Test user-defined type.
|
||||||
test_integer<my_int1>();
|
test_integer<my_int1>();
|
||||||
test_integer<my_int2>();
|
test_integer<my_int2>();
|
||||||
|
@@ -22,7 +22,7 @@ int main()
|
|||||||
int numbers_[] = { 0, -1, 4, -3, 5, 8, -2 };
|
int numbers_[] = { 0, -1, 4, -3, 5, 8, -2 };
|
||||||
const int N = sizeof(numbers_)/sizeof(int);
|
const int N = sizeof(numbers_)/sizeof(int);
|
||||||
|
|
||||||
#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
#ifdef BOOST_NO_STD_ITERATOR_TRAITS
|
||||||
// Assume there won't be proper iterator traits for pointers. This
|
// Assume there won't be proper iterator traits for pointers. This
|
||||||
// is just a wrapper for int* which has the right traits.
|
// is just a wrapper for int* which has the right traits.
|
||||||
typedef boost::iterator_adaptor<int*, boost::default_iterator_policies, int> base_iterator;
|
typedef boost::iterator_adaptor<int*, boost::default_iterator_policies, int> base_iterator;
|
||||||
|
@@ -168,7 +168,7 @@ public:
|
|||||||
compressed_pair_1(const ::boost::compressed_pair<T1,T2>& x)
|
compressed_pair_1(const ::boost::compressed_pair<T1,T2>& x)
|
||||||
: T2(x.second()), _first(x.first()) {}
|
: T2(x.second()), _first(x.first()) {}
|
||||||
|
|
||||||
#ifdef BOOST_MSVC
|
#if defined(BOOST_MSVC) && BOOST_MSVC <= 1300
|
||||||
// Total weirdness. If the assignment to _first is moved after
|
// Total weirdness. If the assignment to _first is moved after
|
||||||
// the call to the inherited operator=, then this breaks graph/test/graph.cpp
|
// the call to the inherited operator=, then this breaks graph/test/graph.cpp
|
||||||
// by way of iterator_adaptor.
|
// by way of iterator_adaptor.
|
||||||
|
@@ -51,7 +51,7 @@ int main(int, char*[])
|
|||||||
|
|
||||||
// Example of using make_indirect_iterator()
|
// Example of using make_indirect_iterator()
|
||||||
|
|
||||||
#ifndef BOOST_MSVC
|
#if !defined(BOOST_MSVC) || BOOST_MSVC > 1300
|
||||||
std::copy(boost::make_indirect_iterator(pointers_to_chars),
|
std::copy(boost::make_indirect_iterator(pointers_to_chars),
|
||||||
boost::make_indirect_iterator(pointers_to_chars + N),
|
boost::make_indirect_iterator(pointers_to_chars + N),
|
||||||
std::ostream_iterator<char>(std::cout, ","));
|
std::ostream_iterator<char>(std::cout, ","));
|
||||||
|
@@ -31,7 +31,7 @@ typedef std::set<storage::iterator> iterator_set;
|
|||||||
void more_indirect_iterator_tests()
|
void more_indirect_iterator_tests()
|
||||||
{
|
{
|
||||||
// For some reason all heck breaks loose in the compiler under these conditions.
|
// For some reason all heck breaks loose in the compiler under these conditions.
|
||||||
#if !defined(BOOST_MSVC) || !defined(__STL_DEBUG)
|
#if !defined(BOOST_MSVC) || BOOST_MSVC > 1200 || !defined(__STL_DEBUG)
|
||||||
storage store(1000);
|
storage store(1000);
|
||||||
std::generate(store.begin(), store.end(), rand);
|
std::generate(store.begin(), store.end(), rand);
|
||||||
|
|
||||||
@@ -46,7 +46,7 @@ void more_indirect_iterator_tests()
|
|||||||
|
|
||||||
typedef boost::indirect_iterator_pair_generator<
|
typedef boost::indirect_iterator_pair_generator<
|
||||||
pointer_deque::iterator
|
pointer_deque::iterator
|
||||||
#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
#ifdef BOOST_NO_STD_ITERATOR_TRAITS
|
||||||
, int
|
, int
|
||||||
#endif
|
#endif
|
||||||
> IndirectDeque;
|
> IndirectDeque;
|
||||||
@@ -75,7 +75,7 @@ void more_indirect_iterator_tests()
|
|||||||
|
|
||||||
typedef boost::indirect_iterator_generator<
|
typedef boost::indirect_iterator_generator<
|
||||||
iterator_set::iterator
|
iterator_set::iterator
|
||||||
#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
#ifdef BOOST_NO_STD_ITERATOR_TRAITS
|
||||||
, int
|
, int
|
||||||
#endif
|
#endif
|
||||||
>::type indirect_set_iterator;
|
>::type indirect_set_iterator;
|
||||||
@@ -117,7 +117,7 @@ main()
|
|||||||
ptr[k] = array + k;
|
ptr[k] = array + k;
|
||||||
|
|
||||||
typedef boost::indirect_iterator_generator<dummyT**
|
typedef boost::indirect_iterator_generator<dummyT**
|
||||||
#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
#ifdef BOOST_NO_STD_ITERATOR_TRAITS
|
||||||
, dummyT
|
, dummyT
|
||||||
#endif
|
#endif
|
||||||
>::type indirect_iterator;
|
>::type indirect_iterator;
|
||||||
@@ -127,7 +127,7 @@ main()
|
|||||||
indirect_iterator i(ptr);
|
indirect_iterator i(ptr);
|
||||||
boost::random_access_iterator_test(i, N, array);
|
boost::random_access_iterator_test(i, N, array);
|
||||||
|
|
||||||
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
#ifndef BOOST_NO_STD_ITERATOR_TRAITS
|
||||||
boost::random_access_iterator_test(boost::make_indirect_iterator(ptr), N, array);
|
boost::random_access_iterator_test(boost::make_indirect_iterator(ptr), N, array);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -139,7 +139,7 @@ main()
|
|||||||
|
|
||||||
dummyT*const* const_ptr = ptr;
|
dummyT*const* const_ptr = ptr;
|
||||||
|
|
||||||
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
#ifndef BOOST_NO_STD_ITERATOR_TRAITS
|
||||||
boost::random_access_iterator_test(boost::make_indirect_iterator(const_ptr), N, array);
|
boost::random_access_iterator_test(boost::make_indirect_iterator(const_ptr), N, array);
|
||||||
#endif
|
#endif
|
||||||
boost::const_nonconst_iterator_test(i, ++j);
|
boost::const_nonconst_iterator_test(i, ++j);
|
||||||
|
@@ -133,7 +133,7 @@ main()
|
|||||||
boost::function_requires<
|
boost::function_requires<
|
||||||
boost::RandomAccessIteratorPoliciesConcept<
|
boost::RandomAccessIteratorPoliciesConcept<
|
||||||
boost::default_iterator_policies,
|
boost::default_iterator_policies,
|
||||||
boost::iterator_adaptor<int*, boost::default_iterator_policies>,
|
boost::iterator_adaptor<storage::iterator, boost::default_iterator_policies>,
|
||||||
boost::iterator<std::random_access_iterator_tag, int, std::ptrdiff_t,
|
boost::iterator<std::random_access_iterator_tag, int, std::ptrdiff_t,
|
||||||
int*, int&>
|
int*, int&>
|
||||||
> >();
|
> >();
|
||||||
@@ -156,7 +156,7 @@ main()
|
|||||||
boost::default_iterator_policies,
|
boost::default_iterator_policies,
|
||||||
boost::value_type_is<const int> > Iter1;
|
boost::value_type_is<const int> > Iter1;
|
||||||
BOOST_STATIC_ASSERT((boost::is_same<Iter1::value_type, int>::value));
|
BOOST_STATIC_ASSERT((boost::is_same<Iter1::value_type, int>::value));
|
||||||
#if defined(__BORLANDC__) || defined(BOOST_MSVC)
|
#if defined(__BORLANDC__) || defined(BOOST_MSVC) && BOOST_MSVC <= 1300
|
||||||
// We currently don't know how to workaround this bug.
|
// We currently don't know how to workaround this bug.
|
||||||
BOOST_STATIC_ASSERT((boost::is_same<Iter1::reference, int&>::value));
|
BOOST_STATIC_ASSERT((boost::is_same<Iter1::reference, int&>::value));
|
||||||
BOOST_STATIC_ASSERT((boost::is_same<Iter1::pointer, int*>::value));
|
BOOST_STATIC_ASSERT((boost::is_same<Iter1::pointer, int*>::value));
|
||||||
@@ -224,7 +224,7 @@ main()
|
|||||||
std::reverse(reversed, reversed + N);
|
std::reverse(reversed, reversed + N);
|
||||||
|
|
||||||
typedef boost::reverse_iterator_generator<dummyT*
|
typedef boost::reverse_iterator_generator<dummyT*
|
||||||
#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) || defined(BOOST_NO_STD_ITERATOR_TRAITS)
|
||||||
, dummyT
|
, dummyT
|
||||||
#endif
|
#endif
|
||||||
>::type reverse_iterator;
|
>::type reverse_iterator;
|
||||||
@@ -232,12 +232,12 @@ main()
|
|||||||
reverse_iterator i(reversed + N);
|
reverse_iterator i(reversed + N);
|
||||||
boost::random_access_iterator_test(i, N, array);
|
boost::random_access_iterator_test(i, N, array);
|
||||||
|
|
||||||
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_STD_ITERATOR_TRAITS)
|
||||||
boost::random_access_iterator_test(boost::make_reverse_iterator(reversed + N), N, array);
|
boost::random_access_iterator_test(boost::make_reverse_iterator(reversed + N), N, array);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef boost::reverse_iterator_generator<const dummyT*
|
typedef boost::reverse_iterator_generator<const dummyT*
|
||||||
#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) || defined(BOOST_NO_STD_ITERATOR_TRAITS)
|
||||||
, dummyT, const dummyT&, const dummyT
|
, dummyT, const dummyT&, const dummyT
|
||||||
#endif
|
#endif
|
||||||
>::type const_reverse_iterator;
|
>::type const_reverse_iterator;
|
||||||
@@ -247,7 +247,7 @@ main()
|
|||||||
|
|
||||||
const dummyT* const_reversed = reversed;
|
const dummyT* const_reversed = reversed;
|
||||||
|
|
||||||
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_STD_ITERATOR_TRAITS)
|
||||||
boost::random_access_iterator_test(boost::make_reverse_iterator(const_reversed + N), N, array);
|
boost::random_access_iterator_test(boost::make_reverse_iterator(const_reversed + N), N, array);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -282,7 +282,7 @@ main()
|
|||||||
|
|
||||||
// Many compilers' builtin deque iterators don't interoperate well, though
|
// Many compilers' builtin deque iterators don't interoperate well, though
|
||||||
// STLport fixes that problem.
|
// STLport fixes that problem.
|
||||||
#if defined(__SGI_STL_PORT) || !defined(__GNUC__) && !defined(__BORLANDC__) && !defined(BOOST_MSVC)
|
#if defined(__SGI_STL_PORT) || !defined(__GNUC__) && !defined(__BORLANDC__) && (!defined(BOOST_MSVC) || BOOST_MSVC > 1200)
|
||||||
boost::const_nonconst_iterator_test(i, ++j);
|
boost::const_nonconst_iterator_test(i, ++j);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -300,7 +300,7 @@ main()
|
|||||||
typedef boost::detail::non_bidirectional_category<dummyT*>::type category;
|
typedef boost::detail::non_bidirectional_category<dummyT*>::type category;
|
||||||
|
|
||||||
typedef boost::filter_iterator_generator<one_or_four, dummyT*
|
typedef boost::filter_iterator_generator<one_or_four, dummyT*
|
||||||
#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) || defined(BOOST_NO_STD_ITERATOR_TRAITS)
|
||||||
, dummyT
|
, dummyT
|
||||||
#endif
|
#endif
|
||||||
>::type filter_iter;
|
>::type filter_iter;
|
||||||
@@ -327,7 +327,7 @@ main()
|
|||||||
// On compilers not supporting partial specialization, we can do more type
|
// On compilers not supporting partial specialization, we can do more type
|
||||||
// deduction with deque iterators than with pointers... unless the library
|
// deduction with deque iterators than with pointers... unless the library
|
||||||
// is broken ;-(
|
// is broken ;-(
|
||||||
#if !defined(BOOST_MSVC) || defined(__SGI_STL_PORT)
|
#if !defined(BOOST_MSVC) || BOOST_MSVC > 1200 || defined(__SGI_STL_PORT)
|
||||||
std::deque<dummyT> array2;
|
std::deque<dummyT> array2;
|
||||||
std::copy(array+0, array+N, std::back_inserter(array2));
|
std::copy(array+0, array+N, std::back_inserter(array2));
|
||||||
boost::forward_iterator_test(
|
boost::forward_iterator_test(
|
||||||
@@ -339,7 +339,7 @@ main()
|
|||||||
dummyT(1), dummyT(4));
|
dummyT(1), dummyT(4));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(BOOST_MSVC) // This just freaks MSVC out completely
|
#if !defined(BOOST_MSVC) || BOOST_MSVC > 1200 // This just freaks MSVC out completely
|
||||||
boost::forward_iterator_test(
|
boost::forward_iterator_test(
|
||||||
boost::make_filter_iterator<one_or_four>(
|
boost::make_filter_iterator<one_or_four>(
|
||||||
boost::make_reverse_iterator(array2.end()),
|
boost::make_reverse_iterator(array2.end()),
|
||||||
@@ -348,7 +348,7 @@ main()
|
|||||||
dummyT(4), dummyT(1));
|
dummyT(4), dummyT(1));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_STD_ITERATOR_TRAITS)
|
||||||
boost::forward_iterator_test(
|
boost::forward_iterator_test(
|
||||||
boost::make_filter_iterator(array+0, array+N, one_or_four()),
|
boost::make_filter_iterator(array+0, array+N, one_or_four()),
|
||||||
dummyT(1), dummyT(4));
|
dummyT(1), dummyT(4));
|
||||||
|
@@ -184,7 +184,7 @@ struct iterator_adaptor;
|
|||||||
|
|
||||||
<p>Although <tt>iterator_adaptor</tt> takes seven template parameters,
|
<p>Although <tt>iterator_adaptor</tt> takes seven template parameters,
|
||||||
defaults have been carefully chosen to minimize the number of parameters
|
defaults have been carefully chosen to minimize the number of parameters
|
||||||
you must supply in most cases, especially if <tt>BaseType</tt> is an
|
you must supply in most cases, especially if <tt>Base</tt> is an
|
||||||
iterator.
|
iterator.
|
||||||
|
|
||||||
<table border="1" summary="iterator_adaptor template parameters">
|
<table border="1" summary="iterator_adaptor template parameters">
|
||||||
@@ -193,17 +193,26 @@ struct iterator_adaptor;
|
|||||||
|
|
||||||
<th>Description
|
<th>Description
|
||||||
|
|
||||||
<tr>
|
<th>Requirements
|
||||||
<td><tt>BaseType</tt>
|
|
||||||
|
|
||||||
<td>The type being wrapped.
|
<tr>
|
||||||
|
<td><tt>Base</tt>
|
||||||
|
|
||||||
|
<td>The data type on which the resulting iterator is based. Do
|
||||||
|
not be misled by the name "Base": this is not a base
|
||||||
|
class.
|
||||||
|
|
||||||
|
<td>
|
||||||
|
<a href="http://www.sgi.com/tech/stl/Assignable.html">Assignable</a>,
|
||||||
|
<a href="http://www.sgi.com/tech/stl/DefaultConstructible.html">Default Constructible</a>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><tt>Policies</tt>
|
<td><tt>Policies</tt>
|
||||||
|
|
||||||
<td>A <a href="../../more/generic_programming.html#policy">policy
|
<td>A <a href="../../more/generic_programming.html#policy">policy
|
||||||
class</a> that supplies core functionality to the resulting iterator. A
|
class</a> that supplies core functionality to the resulting iterator.
|
||||||
detailed description can be found <a href="#policies">below</a>.
|
|
||||||
|
<td>See table <a href="#policies">below</a>.
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><tt>Value</tt>
|
<td><tt>Value</tt>
|
||||||
@@ -214,7 +223,7 @@ struct iterator_adaptor;
|
|||||||
"#1">[1]</a>. If the <tt>value_type</tt> you wish to use is an abstract
|
"#1">[1]</a>. If the <tt>value_type</tt> you wish to use is an abstract
|
||||||
base class see note <a href="#5">[5]</a>.<br>
|
base class see note <a href="#5">[5]</a>.<br>
|
||||||
<b>Default:</b>
|
<b>Default:</b>
|
||||||
<tt>std::iterator_traits<BaseType>::value_type</tt> <a href=
|
<tt>std::iterator_traits<Base>::value_type</tt> <a href=
|
||||||
"#2">[2]</a>
|
"#2">[2]</a>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
@@ -224,29 +233,52 @@ struct iterator_adaptor;
|
|||||||
particular, the result type of <tt>operator*()</tt>.<br>
|
particular, the result type of <tt>operator*()</tt>.<br>
|
||||||
<b>Default:</b> If <tt>Value</tt> is supplied, <tt>Value&</tt> is
|
<b>Default:</b> If <tt>Value</tt> is supplied, <tt>Value&</tt> is
|
||||||
used. Otherwise
|
used. Otherwise
|
||||||
<tt>std::iterator_traits<BaseType>::reference</tt> is used. <a href="#7">[7]</a>
|
<tt>std::iterator_traits<Base>::reference</tt> is used. <a href="#7">[7]</a>
|
||||||
|
|
||||||
|
<td><a
|
||||||
|
href="http://www.sgi.com/tech/stl/ForwardIterator.html">ForwardIterators</a>,
|
||||||
|
<a
|
||||||
|
href="http://www.sgi.com/tech/stl/BidirectionalIterator.html">BidirectionalIterators</a>,
|
||||||
|
and <a
|
||||||
|
href="http://www.sgi.com/tech/stl/RandomAccessIterator.html">RandomAccessIterators</a>
|
||||||
|
require that Reference is a true reference type (e.g. not a proxy).
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><tt>Pointer</tt>
|
<td><tt>Pointer</tt>
|
||||||
|
|
||||||
<td>The <tt>pointer</tt> type of the resulting iterator, and in
|
<td>The <tt>pointer</tt> type of the resulting iterator, and in
|
||||||
particular, the result type of <tt>operator->()</tt>.<br>
|
particular, the result type of <tt>operator->()</tt>.<br>
|
||||||
<b>Default:</b> If <tt>Value</tt> was supplied, then <tt>Value*</tt>,
|
<b>Default:</b> If <tt>Value</tt> was not supplied, <tt>std::iterator_traits<Base>::pointer</tt>. <a
|
||||||
otherwise <tt>std::iterator_traits<BaseType>::pointer</tt>. <a href="#7">[7]</a>
|
href="#7">[7]</a> Otherwise, if <code>iterator_category</code> is
|
||||||
|
<code>input_iterator</code>, then a class yielding
|
||||||
|
<tt>Value*</tt> when <code>operator->()</code> is applied.
|
||||||
|
Otherwise, <tt>Value*</tt>.
|
||||||
|
|
||||||
|
<td><code>value_type*</code> or a
|
||||||
|
class which yields <code>value_type*</code> when
|
||||||
|
<code>operator->()</code> is applied.
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><tt>Category</tt>
|
<td><tt>Category</tt>
|
||||||
|
|
||||||
<td>The <tt>iterator_category</tt> type for the resulting iterator.<br>
|
<td>The <tt>iterator_category</tt> type for the resulting iterator.<br>
|
||||||
<b>Default:</b>
|
<b>Default:</b>
|
||||||
<tt>std::iterator_traits<BaseType>::iterator_category</tt>
|
<tt>std::iterator_traits<Base>::iterator_category</tt>
|
||||||
|
|
||||||
|
<td>One of
|
||||||
|
<code>std::input_iterator_tag</code>,
|
||||||
|
<code>std::output_iterator_tag</code>,
|
||||||
|
<code>std::forward_iterator_tag</code>,
|
||||||
|
<code>std::bidirectional_iterator_tag</code>, or
|
||||||
|
<code>std::random_access_iterator_tag</code>.
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><tt>Distance</tt>
|
<td><tt>Distance</tt>
|
||||||
|
|
||||||
<td>The <tt>difference_type</tt> for the resulting iterator.<br>
|
<td>The <tt>difference_type</tt> for the resulting iterator.<br>
|
||||||
<b>Default:</b>
|
<b>Default:</b>
|
||||||
<tt>std::iterator_traits<BaseType>::difference_type</tt>
|
<tt>std::iterator_traits<Base>::difference_type</tt>
|
||||||
|
<td>A signed integral type
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><tt>NamedParam</tt>
|
<td><tt>NamedParam</tt>
|
||||||
@@ -498,6 +530,15 @@ struct <a name="default_iterator_policies">default_iterator_policies</a>
|
|||||||
Return a reference to the base object. This is to give the policies object
|
Return a reference to the base object. This is to give the policies object
|
||||||
access to the base object. See <a href="#policies">above</a> for policies
|
access to the base object. See <a href="#policies">above</a> for policies
|
||||||
iterator_adaptor interaction.<a href="#8">[8]</a>
|
iterator_adaptor interaction.<a href="#8">[8]</a>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td><tt>const Policies& policies() const;</tt>
|
||||||
|
<br><br>
|
||||||
|
Return a const reference to the policies object.
|
||||||
|
|
||||||
|
<tr> <td><tt>Policies& policies();</tt>
|
||||||
|
<br><br>
|
||||||
|
Return a reference to the policies object.
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<h3><a name="example">Example</a></h3>
|
<h3><a name="example">Example</a></h3>
|
||||||
@@ -515,7 +556,7 @@ struct <a name="default_iterator_policies">default_iterator_policies</a>
|
|||||||
argument and that we'll need to be able to deduce the <tt>result_type</tt>
|
argument and that we'll need to be able to deduce the <tt>result_type</tt>
|
||||||
of the function so we can use it for the adapted iterator's
|
of the function so we can use it for the adapted iterator's
|
||||||
<tt>value_type</tt>. <a href=
|
<tt>value_type</tt>. <a href=
|
||||||
"http://www.sgi.com/Technology/STL/AdaptableUnaryFunction.html">AdaptableUnaryFunction</a>
|
"http://www.sgi.com/tech/stl/AdaptableUnaryFunction.html">AdaptableUnaryFunction</a>
|
||||||
is the <a href="../../more/generic_programming.html#concept">Concept</a>
|
is the <a href="../../more/generic_programming.html#concept">Concept</a>
|
||||||
that fulfills those requirements.
|
that fulfills those requirements.
|
||||||
|
|
||||||
|
@@ -347,7 +347,7 @@ void test(Number* = 0)
|
|||||||
|
|
||||||
// factoring out difference_type for the assert below confused Borland :(
|
// factoring out difference_type for the assert below confused Borland :(
|
||||||
typedef boost::detail::is_signed<
|
typedef boost::detail::is_signed<
|
||||||
#ifndef BOOST_MSVC
|
#if !defined(BOOST_MSVC) || BOOST_MSVC > 1300
|
||||||
typename
|
typename
|
||||||
#endif
|
#endif
|
||||||
boost::detail::numeric_traits<Number>::difference_type
|
boost::detail::numeric_traits<Number>::difference_type
|
||||||
|
@@ -12,7 +12,7 @@ int main(int, char*[])
|
|||||||
{
|
{
|
||||||
char letters_[] = "hello world!";
|
char letters_[] = "hello world!";
|
||||||
const int N = sizeof(letters_)/sizeof(char) - 1;
|
const int N = sizeof(letters_)/sizeof(char) - 1;
|
||||||
#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
#ifdef BOOST_NO_STD_ITERATOR_TRAITS
|
||||||
// Assume there won't be proper iterator traits for pointers. This
|
// Assume there won't be proper iterator traits for pointers. This
|
||||||
// is just a wrapper for char* which has the right traits.
|
// is just a wrapper for char* which has the right traits.
|
||||||
typedef boost::iterator_adaptor<char*, boost::default_iterator_policies, char> base_iterator;
|
typedef boost::iterator_adaptor<char*, boost::default_iterator_policies, char> base_iterator;
|
||||||
|
Reference in New Issue
Block a user