mirror of
https://github.com/boostorg/iterator.git
synced 2025-05-11 05:23:52 +00:00
Trim trailing spaces.
This commit is contained in:
parent
75ba1a50c9
commit
d175ba2450
@ -24,7 +24,7 @@ struct node_base
|
|||||||
|
|
||||||
virtual void print(std::ostream& s) const = 0;
|
virtual void print(std::ostream& s) const = 0;
|
||||||
virtual void double_me() = 0;
|
virtual void double_me() = 0;
|
||||||
|
|
||||||
void append(node_base* p)
|
void append(node_base* p)
|
||||||
{
|
{
|
||||||
if (m_next)
|
if (m_next)
|
||||||
@ -32,7 +32,7 @@ struct node_base
|
|||||||
else
|
else
|
||||||
m_next = p;
|
m_next = p;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
node_base* m_next;
|
node_base* m_next;
|
||||||
};
|
};
|
||||||
@ -52,9 +52,9 @@ struct node : node_base
|
|||||||
|
|
||||||
void print(std::ostream& s) const { s << this->m_value; }
|
void print(std::ostream& s) const { s << this->m_value; }
|
||||||
void double_me() { m_value += m_value; }
|
void double_me() { m_value += m_value; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
T m_value;
|
T m_value;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // NODE_DWA2004110_HPP
|
#endif // NODE_DWA2004110_HPP
|
||||||
|
@ -28,10 +28,10 @@ class node_iterator
|
|||||||
|
|
||||||
void increment()
|
void increment()
|
||||||
{ m_node = m_node->next(); }
|
{ m_node = m_node->next(); }
|
||||||
|
|
||||||
bool equal(node_iterator const& other) const
|
bool equal(node_iterator const& other) const
|
||||||
{ return this->m_node == other.m_node; }
|
{ return this->m_node == other.m_node; }
|
||||||
|
|
||||||
node_base& dereference() const
|
node_base& dereference() const
|
||||||
{ return *m_node; }
|
{ return *m_node; }
|
||||||
|
|
||||||
|
@ -38,15 +38,15 @@ class node_iter
|
|||||||
boost::is_convertible<OtherValue*,Value*>
|
boost::is_convertible<OtherValue*,Value*>
|
||||||
, enabler
|
, enabler
|
||||||
>::type = enabler()
|
>::type = enabler()
|
||||||
# endif
|
# endif
|
||||||
)
|
)
|
||||||
: m_node(other.m_node) {}
|
: m_node(other.m_node) {}
|
||||||
|
|
||||||
|
|
||||||
# if !BOOST_WORKAROUND(__GNUC__, == 2)
|
# if !BOOST_WORKAROUND(__GNUC__, == 2)
|
||||||
private: // GCC2 can't grant friendship to template member functions
|
private: // GCC2 can't grant friendship to template member functions
|
||||||
friend class boost::iterator_core_access;
|
friend class boost::iterator_core_access;
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
template <class OtherValue>
|
template <class OtherValue>
|
||||||
bool equal(node_iter<OtherValue> const& other) const
|
bool equal(node_iter<OtherValue> const& other) const
|
||||||
@ -63,7 +63,7 @@ class node_iter
|
|||||||
# else
|
# else
|
||||||
private:
|
private:
|
||||||
template <class> friend class node_iter;
|
template <class> friend class node_iter;
|
||||||
# endif
|
# endif
|
||||||
Value* m_node;
|
Value* m_node;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ class node_iter
|
|||||||
typedef boost::iterator_adaptor<
|
typedef boost::iterator_adaptor<
|
||||||
node_iter<Value>, Value*, boost::use_default, boost::forward_traversal_tag
|
node_iter<Value>, Value*, boost::use_default, boost::forward_traversal_tag
|
||||||
> super_t;
|
> super_t;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
node_iter()
|
node_iter()
|
||||||
: super_t(0) {}
|
: super_t(0) {}
|
||||||
@ -43,14 +43,14 @@ class node_iter
|
|||||||
boost::is_convertible<OtherValue*,Value*>
|
boost::is_convertible<OtherValue*,Value*>
|
||||||
, enabler
|
, enabler
|
||||||
>::type = enabler()
|
>::type = enabler()
|
||||||
# endif
|
# endif
|
||||||
)
|
)
|
||||||
: super_t(other.base()) {}
|
: super_t(other.base()) {}
|
||||||
|
|
||||||
# if !BOOST_WORKAROUND(__GNUC__, == 2)
|
# if !BOOST_WORKAROUND(__GNUC__, == 2)
|
||||||
private: // GCC2 can't grant friendship to template member functions
|
private: // GCC2 can't grant friendship to template member functions
|
||||||
friend class boost::iterator_core_access;
|
friend class boost::iterator_core_access;
|
||||||
# endif
|
# endif
|
||||||
void increment() { this->base_reference() = this->base()->next(); }
|
void increment() { this->base_reference() = this->base()->next(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -18,9 +18,9 @@
|
|||||||
|
|
||||||
#ifdef BOOST_ITERATOR_CONFIG_DEF
|
#ifdef BOOST_ITERATOR_CONFIG_DEF
|
||||||
# error you have nested config_def #inclusion.
|
# error you have nested config_def #inclusion.
|
||||||
#else
|
#else
|
||||||
# define BOOST_ITERATOR_CONFIG_DEF
|
# define BOOST_ITERATOR_CONFIG_DEF
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// We enable this always now. Otherwise, the simple case in
|
// We enable this always now. Otherwise, the simple case in
|
||||||
// libs/iterator/test/constant_iterator_arrow.cpp fails to compile
|
// libs/iterator/test/constant_iterator_arrow.cpp fails to compile
|
||||||
@ -50,7 +50,7 @@
|
|||||||
|| (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))
|
||||||
|
|
||||||
# define BOOST_NO_LVALUE_RETURN_DETECTION
|
# define BOOST_NO_LVALUE_RETURN_DETECTION
|
||||||
|
|
||||||
# if 0 // test code
|
# if 0 // test code
|
||||||
@ -79,7 +79,7 @@
|
|||||||
|
|
||||||
int z2[(lvalue_deref_helper<v*>::value == 1) ? 1 : -1];
|
int z2[(lvalue_deref_helper<v*>::value == 1) ? 1 : -1];
|
||||||
int z[(lvalue_deref_helper<value_iterator>::value) == 1 ? -1 : 1 ];
|
int z[(lvalue_deref_helper<value_iterator>::value) == 1 ? -1 : 1 ];
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -112,7 +112,7 @@
|
|||||||
|
|
||||||
#if !defined(BOOST_MSVC) && (defined(BOOST_NO_SFINAE) || defined(BOOST_NO_IS_CONVERTIBLE) || defined(BOOST_NO_IS_CONVERTIBLE_TEMPLATE))
|
#if !defined(BOOST_MSVC) && (defined(BOOST_NO_SFINAE) || defined(BOOST_NO_IS_CONVERTIBLE) || defined(BOOST_NO_IS_CONVERTIBLE_TEMPLATE))
|
||||||
# define BOOST_NO_STRICT_ITERATOR_INTEROPERABILITY
|
# define BOOST_NO_STRICT_ITERATOR_INTEROPERABILITY
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
|
# if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
|
||||||
|
|
||||||
@ -123,6 +123,6 @@
|
|||||||
// instantiation stack backtrace. They may be due in part to the fact
|
// instantiation stack backtrace. They may be due in part to the fact
|
||||||
// that it drops cv-qualification willy-nilly in templates.
|
// that it drops cv-qualification willy-nilly in templates.
|
||||||
# define BOOST_NO_ONE_WAY_ITERATOR_INTEROP
|
# define BOOST_NO_ONE_WAY_ITERATOR_INTEROP
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
// no include guard; multiple inclusion intended
|
// no include guard; multiple inclusion intended
|
||||||
|
@ -21,4 +21,4 @@
|
|||||||
# undef BOOST_ITERATOR_CONFIG_DEF
|
# undef BOOST_ITERATOR_CONFIG_DEF
|
||||||
#else
|
#else
|
||||||
# error missing or nested #include config_def
|
# error missing or nested #include config_def
|
||||||
#endif
|
#endif
|
||||||
|
@ -87,11 +87,11 @@ void readable_iterator_test(const Iterator i1, T v)
|
|||||||
|
|
||||||
# if !BOOST_WORKAROUND(__MWERKS__, <= 0x2407)
|
# if !BOOST_WORKAROUND(__MWERKS__, <= 0x2407)
|
||||||
readable_iterator_traversal_test(i1, v, detail::is_postfix_incrementable<Iterator>());
|
readable_iterator_traversal_test(i1, v, detail::is_postfix_incrementable<Iterator>());
|
||||||
|
|
||||||
// I think we don't really need this as it checks the same things as
|
// I think we don't really need this as it checks the same things as
|
||||||
// the above code.
|
// the above code.
|
||||||
BOOST_STATIC_ASSERT(is_readable_iterator<Iterator>::value);
|
BOOST_STATIC_ASSERT(is_readable_iterator<Iterator>::value);
|
||||||
# endif
|
# endif
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class Iterator, class T>
|
template <class Iterator, class T>
|
||||||
@ -106,7 +106,7 @@ void writable_iterator_test(Iterator i, T v, T v2)
|
|||||||
detail::is_incrementable<Iterator>
|
detail::is_incrementable<Iterator>
|
||||||
, detail::is_postfix_incrementable<Iterator>
|
, detail::is_postfix_incrementable<Iterator>
|
||||||
>());
|
>());
|
||||||
# endif
|
# endif
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class Iterator>
|
template <class Iterator>
|
||||||
@ -131,7 +131,7 @@ void constant_lvalue_iterator_test(Iterator i, T v1)
|
|||||||
# ifndef BOOST_NO_LVALUE_RETURN_DETECTION
|
# ifndef BOOST_NO_LVALUE_RETURN_DETECTION
|
||||||
BOOST_STATIC_ASSERT(is_lvalue_iterator<Iterator>::value);
|
BOOST_STATIC_ASSERT(is_lvalue_iterator<Iterator>::value);
|
||||||
BOOST_STATIC_ASSERT(!is_non_const_lvalue_iterator<Iterator>::value);
|
BOOST_STATIC_ASSERT(!is_non_const_lvalue_iterator<Iterator>::value);
|
||||||
# endif
|
# endif
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class Iterator, class T>
|
template <class Iterator, class T>
|
||||||
@ -143,17 +143,17 @@ void non_const_lvalue_iterator_test(Iterator i, T v1, T v2)
|
|||||||
BOOST_STATIC_ASSERT((is_same<value_type&, reference>::value));
|
BOOST_STATIC_ASSERT((is_same<value_type&, reference>::value));
|
||||||
T& v3 = *i2;
|
T& v3 = *i2;
|
||||||
BOOST_TEST(v1 == v3);
|
BOOST_TEST(v1 == v3);
|
||||||
|
|
||||||
// A non-const lvalue iterator is not neccessarily writable, but we
|
// A non-const lvalue iterator is not neccessarily writable, but we
|
||||||
// are assuming the value_type is assignable here
|
// are assuming the value_type is assignable here
|
||||||
*i = v2;
|
*i = v2;
|
||||||
|
|
||||||
T& v4 = *i2;
|
T& v4 = *i2;
|
||||||
BOOST_TEST(v2 == v4);
|
BOOST_TEST(v2 == v4);
|
||||||
# ifndef BOOST_NO_LVALUE_RETURN_DETECTION
|
# ifndef BOOST_NO_LVALUE_RETURN_DETECTION
|
||||||
BOOST_STATIC_ASSERT(is_lvalue_iterator<Iterator>::value);
|
BOOST_STATIC_ASSERT(is_lvalue_iterator<Iterator>::value);
|
||||||
BOOST_STATIC_ASSERT(is_non_const_lvalue_iterator<Iterator>::value);
|
BOOST_STATIC_ASSERT(is_non_const_lvalue_iterator<Iterator>::value);
|
||||||
# endif
|
# endif
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class Iterator, class T>
|
template <class Iterator, class T>
|
||||||
@ -248,7 +248,7 @@ void random_access_readable_iterator_test(Iterator i, int N, TrueVals vals)
|
|||||||
BOOST_TEST(*i == vals[N - 1 - c]);
|
BOOST_TEST(*i == vals[N - 1 - c]);
|
||||||
typename std::iterator_traits<Iterator>::value_type x = j[N - 1 - c];
|
typename std::iterator_traits<Iterator>::value_type x = j[N - 1 - c];
|
||||||
BOOST_TEST(*i == x);
|
BOOST_TEST(*i == x);
|
||||||
Iterator q = k - c;
|
Iterator q = k - c;
|
||||||
BOOST_TEST(*i == *q);
|
BOOST_TEST(*i == *q);
|
||||||
BOOST_TEST(i > j);
|
BOOST_TEST(i > j);
|
||||||
BOOST_TEST(i >= j);
|
BOOST_TEST(i >= j);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user