mirror of
https://github.com/boostorg/iterator.git
synced 2025-06-30 22:41:10 +02:00
Compare commits
51 Commits
boost-1.20
...
svn-branch
Author | SHA1 | Date | |
---|---|---|---|
edcea5d276 | |||
81e3df2b36 | |||
ac05307515 | |||
552a1e6785 | |||
134b8b51aa | |||
efecfd17b9 | |||
799158841e | |||
582ebfd054 | |||
42e4db1539 | |||
d7023154a3 | |||
9582b2223c | |||
d7908fb81f | |||
e48cdcb94f | |||
0846ad5fd0 | |||
84663ff2e2 | |||
6de1934420 | |||
a110b9fd27 | |||
eb06c122d1 | |||
cbbe851adb | |||
f6cc2e520f | |||
4e29b5aa29 | |||
d924f56ad8 | |||
f27fd095f7 | |||
d22edf735a | |||
af8dd117d5 | |||
149d07cda0 | |||
e9d9bdbb10 | |||
8d8f828da5 | |||
fc15f5f710 | |||
ef66d28b19 | |||
0c8d74863f | |||
1c73f1f2ae | |||
ee20a630dd | |||
c2472221ef | |||
bf45977491 | |||
1988994bd3 | |||
5482763a93 | |||
2c2a3eab21 | |||
dca20fae75 | |||
e3aaf2cc91 | |||
ea4c7c7dd9 | |||
fd6ba58d5e | |||
268e70faa1 | |||
170b44763d | |||
b2701f9f78 | |||
ad4c5ab089 | |||
c585adde71 | |||
c5f24d0d72 | |||
dbb99b1cf3 | |||
be44a4714b | |||
e9f24023d4 |
@ -1,282 +0,0 @@
|
||||
#ifndef BOOST_ITERATOR_CONCEPTS_HPP
|
||||
#define BOOST_ITERATOR_CONCEPTS_HPP
|
||||
|
||||
#include <boost/concept_check.hpp>
|
||||
#include <boost/iterator_traits.hpp>
|
||||
|
||||
namespace boost_concepts {
|
||||
// Used a different namespace here (instead of "boost") so that the
|
||||
// concept descriptions do not take for granted the names in
|
||||
// namespace boost.
|
||||
|
||||
|
||||
//===========================================================================
|
||||
|
||||
template <typename Iterator>
|
||||
class ReadableIteratorConcept {
|
||||
public:
|
||||
typedef typename boost::iterator_traits<Iterator>::value_type value_type;
|
||||
typedef typename boost::iterator_traits<Iterator>::reference reference;
|
||||
typedef typename boost::iterator_traits<Iterator>::return_category
|
||||
return_category;
|
||||
|
||||
void constraints() {
|
||||
boost::function_requires< boost::SGIAssignableConcept<Iterator> >();
|
||||
boost::function_requires< boost::EqualityComparableConcept<Iterator> >();
|
||||
boost::function_requires< boost::DefaultConstructibleConcept<Iterator> >();
|
||||
|
||||
boost::function_requires<
|
||||
boost::ConvertibleConcept<return_category, boost::readable_iterator_tag> >();
|
||||
|
||||
reference r = *i; // or perhaps read(x)
|
||||
value_type v(r);
|
||||
boost::ignore_unused_variable_warning(v);
|
||||
}
|
||||
Iterator i;
|
||||
};
|
||||
|
||||
template <typename Iterator, typename ValueType>
|
||||
class WritableIteratorConcept {
|
||||
public:
|
||||
typedef typename boost::iterator_traits<Iterator>::return_category
|
||||
return_category;
|
||||
|
||||
void constraints() {
|
||||
boost::function_requires< boost::SGIAssignableConcept<Iterator> >();
|
||||
boost::function_requires< boost::EqualityComparableConcept<Iterator> >();
|
||||
boost::function_requires< boost::DefaultConstructibleConcept<Iterator> >();
|
||||
|
||||
boost::function_requires<
|
||||
boost::ConvertibleConcept<return_category, boost::writable_iterator_tag> >();
|
||||
|
||||
*i = v; // an alternative could be something like write(x, v)
|
||||
}
|
||||
ValueType v;
|
||||
Iterator i;
|
||||
};
|
||||
|
||||
template <typename Iterator>
|
||||
class ConstantLvalueIteratorConcept {
|
||||
public:
|
||||
typedef typename boost::iterator_traits<Iterator>::value_type value_type;
|
||||
typedef typename boost::iterator_traits<Iterator>::reference reference;
|
||||
typedef typename boost::iterator_traits<Iterator>::return_category
|
||||
return_category;
|
||||
|
||||
void constraints() {
|
||||
boost::function_requires< ReadableIteratorConcept<Iterator> >();
|
||||
|
||||
boost::function_requires<
|
||||
boost::ConvertibleConcept<return_category,
|
||||
boost::constant_lvalue_iterator_tag> >();
|
||||
|
||||
typedef typename boost::require_same<reference, const value_type&>::type req;
|
||||
|
||||
reference v = *i;
|
||||
boost::ignore_unused_variable_warning(v);
|
||||
}
|
||||
Iterator i;
|
||||
};
|
||||
|
||||
template <typename Iterator>
|
||||
class MutableLvalueIteratorConcept {
|
||||
public:
|
||||
typedef typename boost::iterator_traits<Iterator>::value_type value_type;
|
||||
typedef typename boost::iterator_traits<Iterator>::reference reference;
|
||||
typedef typename boost::iterator_traits<Iterator>::return_category
|
||||
return_category;
|
||||
|
||||
void constraints() {
|
||||
boost::function_requires< ReadableIteratorConcept<Iterator> >();
|
||||
boost::function_requires< WritableIteratorConcept<Iterator, value_type> >();
|
||||
|
||||
boost::function_requires<
|
||||
boost::ConvertibleConcept<return_category,
|
||||
boost::constant_lvalue_iterator_tag> >();
|
||||
|
||||
typedef typename boost::require_same<reference, value_type&>::type req;
|
||||
|
||||
reference v = *i;
|
||||
boost::ignore_unused_variable_warning(v);
|
||||
}
|
||||
Iterator i;
|
||||
};
|
||||
|
||||
//===========================================================================
|
||||
|
||||
template <typename Iterator>
|
||||
class SinglePassIteratorConcept {
|
||||
public:
|
||||
typedef typename boost::iterator_traits<Iterator>::motion_category
|
||||
motion_category;
|
||||
typedef typename boost::iterator_traits<Iterator>::difference_type
|
||||
difference_type;
|
||||
|
||||
void constraints() {
|
||||
boost::function_requires< boost::SGIAssignableConcept<Iterator> >();
|
||||
boost::function_requires< boost::EqualityComparableConcept<Iterator> >();
|
||||
boost::function_requires< boost::DefaultConstructibleConcept<Iterator> >();
|
||||
|
||||
boost::function_requires<
|
||||
boost::ConvertibleConcept<motion_category,
|
||||
boost::single_pass_iterator_tag> >();
|
||||
|
||||
// difference_type must be a signed integral type
|
||||
|
||||
++i;
|
||||
(void)i++;
|
||||
}
|
||||
|
||||
Iterator i;
|
||||
};
|
||||
|
||||
template <typename Iterator>
|
||||
class ForwardIteratorConcept {
|
||||
public:
|
||||
typedef typename boost::iterator_traits<Iterator>::motion_category
|
||||
motion_category;
|
||||
|
||||
void constraints() {
|
||||
boost::function_requires< SinglePassIteratorConcept<Iterator> >();
|
||||
|
||||
boost::function_requires<
|
||||
boost::ConvertibleConcept<motion_category,
|
||||
boost::forward_iterator_tag> >();
|
||||
}
|
||||
};
|
||||
|
||||
template <typename Iterator>
|
||||
class BidirectionalIteratorConcept {
|
||||
public:
|
||||
typedef typename boost::iterator_traits<Iterator>::motion_category
|
||||
motion_category;
|
||||
|
||||
void constraints() {
|
||||
boost::function_requires< ForwardIteratorConcept<Iterator> >();
|
||||
|
||||
boost::function_requires<
|
||||
boost::ConvertibleConcept<motion_category,
|
||||
boost::bidirectional_iterator_tag> >();
|
||||
|
||||
--i;
|
||||
(void)i--;
|
||||
}
|
||||
Iterator i;
|
||||
};
|
||||
|
||||
template <typename Iterator>
|
||||
class RandomAccessIteratorConcept {
|
||||
public:
|
||||
typedef typename boost::iterator_traits<Iterator>::motion_category
|
||||
motion_category;
|
||||
typedef typename boost::iterator_traits<Iterator>::difference_type
|
||||
difference_type;
|
||||
|
||||
void constraints() {
|
||||
boost::function_requires< BidirectionalIteratorConcept<Iterator> >();
|
||||
|
||||
boost::function_requires<
|
||||
boost::ConvertibleConcept<motion_category,
|
||||
boost::random_access_iterator_tag> >();
|
||||
|
||||
i += n;
|
||||
i = i + n;
|
||||
i = n + i;
|
||||
i -= n;
|
||||
i = i - n;
|
||||
n = i - j;
|
||||
}
|
||||
difference_type n;
|
||||
Iterator i, j;
|
||||
};
|
||||
|
||||
//===========================================================================
|
||||
|
||||
template <typename Iterator>
|
||||
class ReadableRandomAccessIteratorConcept {
|
||||
public:
|
||||
typedef typename boost::iterator_traits<Iterator>::value_type value_type;
|
||||
typedef typename boost::iterator_traits<Iterator>::reference reference;
|
||||
typedef typename boost::iterator_traits<Iterator>::difference_type
|
||||
difference_type;
|
||||
|
||||
void constraints() {
|
||||
boost::function_requires< RandomAccessIteratorConcept<Iterator> >();
|
||||
boost::function_requires< ReadableIteratorConcept<Iterator> >();
|
||||
|
||||
reference r = i[n];
|
||||
value_type v(r);
|
||||
boost::ignore_unused_variable_warning(v);
|
||||
}
|
||||
difference_type n;
|
||||
Iterator i;
|
||||
};
|
||||
|
||||
template <typename Iterator>
|
||||
class WritableRandomAccessIteratorConcept {
|
||||
public:
|
||||
typedef typename boost::iterator_traits<Iterator>::value_type value_type;
|
||||
typedef typename boost::iterator_traits<Iterator>::difference_type
|
||||
difference_type;
|
||||
|
||||
void constraints() {
|
||||
boost::function_requires< RandomAccessIteratorConcept<Iterator> >();
|
||||
boost::function_requires< WritableIteratorConcept<Iterator, value_type> >();
|
||||
|
||||
i[n] = v;
|
||||
boost::ignore_unused_variable_warning(v);
|
||||
}
|
||||
difference_type n;
|
||||
value_type v;
|
||||
Iterator i;
|
||||
};
|
||||
|
||||
template <typename Iterator>
|
||||
class ConstantLvalueRandomAccessIteratorConcept {
|
||||
public:
|
||||
typedef typename boost::iterator_traits<Iterator>::value_type value_type;
|
||||
typedef typename boost::iterator_traits<Iterator>::reference reference;
|
||||
typedef typename boost::iterator_traits<Iterator>::difference_type
|
||||
difference_type;
|
||||
|
||||
void constraints() {
|
||||
boost::function_requires< RandomAccessIteratorConcept<Iterator> >();
|
||||
boost::function_requires< ReadableIteratorConcept<Iterator> >();
|
||||
|
||||
typedef typename boost::require_same<reference, const value_type&>::type req;
|
||||
|
||||
reference v = i[n];
|
||||
boost::ignore_unused_variable_warning(v);
|
||||
}
|
||||
difference_type n;
|
||||
value_type v;
|
||||
Iterator i;
|
||||
};
|
||||
|
||||
template <typename Iterator>
|
||||
class MutableLvalueRandomAccessIteratorConcept {
|
||||
public:
|
||||
typedef typename boost::iterator_traits<Iterator>::value_type value_type;
|
||||
typedef typename boost::iterator_traits<Iterator>::reference reference;
|
||||
typedef typename boost::iterator_traits<Iterator>::difference_type
|
||||
difference_type;
|
||||
|
||||
void constraints() {
|
||||
boost::function_requires< RandomAccessIteratorConcept<Iterator> >();
|
||||
boost::function_requires< WritableIteratorConcept<Iterator, value_type> >();
|
||||
boost::function_requires< ReadableIteratorConcept<Iterator> >();
|
||||
|
||||
typedef typename boost::require_same<reference, value_type&>::type req;
|
||||
|
||||
reference v = i[n];
|
||||
boost::ignore_unused_variable_warning(v);
|
||||
}
|
||||
difference_type n;
|
||||
value_type v;
|
||||
Iterator i;
|
||||
};
|
||||
|
||||
} // namespace boost_concepts
|
||||
|
||||
|
||||
#endif // BOOST_ITERATOR_CONCEPTS_HPP
|
@ -1,60 +0,0 @@
|
||||
#ifndef BOOST_ITERATOR_TRAITS_HPP
|
||||
#define BOOST_ITERATOR_TRAITS_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/type_traits.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
template <typename Iterator>
|
||||
struct iterator_traits {
|
||||
typedef typename Iterator::value_type value_type;
|
||||
typedef typename Iterator::reference reference;
|
||||
typedef typename Iterator::pointer pointer;
|
||||
typedef typename Iterator::difference_type difference_type;
|
||||
typedef typename Iterator::return_category return_category;
|
||||
typedef typename Iterator::motion_category motion_category;
|
||||
};
|
||||
|
||||
// Motion Categories
|
||||
struct single_pass_iterator_tag { };
|
||||
struct forward_iterator_tag : public single_pass_iterator_tag { };
|
||||
struct bidirectional_iterator_tag : public forward_iterator_tag { };
|
||||
struct random_access_iterator_tag : public bidirectional_iterator_tag { };
|
||||
|
||||
// Return Type Categories
|
||||
struct readable_iterator_tag { };
|
||||
struct writable_iterator_tag { };
|
||||
struct mutable_lvalue_iterator_tag : virtual public writable_iterator_tag,
|
||||
virtual public readable_iterator_tag { };
|
||||
struct constant_lvalue_iterator_tag : public readable_iterator_tag { };
|
||||
|
||||
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
|
||||
namespace detail {
|
||||
template <bool IsConst>
|
||||
struct pointer_return_category {
|
||||
typedef constant_lvalue_iterator_tag type;
|
||||
};
|
||||
template <>
|
||||
struct pointer_return_category<false> {
|
||||
typedef mutable_lvalue_iterator_tag type;
|
||||
};
|
||||
} // namespace detail
|
||||
|
||||
template <typename T>
|
||||
struct iterator_traits<T*> {
|
||||
typedef T value_type;
|
||||
typedef T& reference;
|
||||
typedef T* pointer;
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
typedef typename detail::pointer_return_category<is_const<T>::value>::type
|
||||
return_category;
|
||||
typedef random_access_iterator_tag motion_category;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_ITERATOR_TRAITS_HPP
|
@ -1,13 +0,0 @@
|
||||
#include <boost/iterator_concepts.hpp>
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
boost::function_requires<
|
||||
boost_concepts::MutableLvalueRandomAccessIteratorConcept<int*> >();
|
||||
|
||||
boost::function_requires<
|
||||
boost_concepts::ConstantLvalueRandomAccessIteratorConcept<const int*> >();
|
||||
|
||||
return 0;
|
||||
}
|
@ -28,6 +28,14 @@
|
||||
// Incrementable.
|
||||
//
|
||||
// Revision History
|
||||
// 14 Feb 2001 Removed unnecessary typedefs from counting_iterator_traits
|
||||
// (Jeremy Siek)
|
||||
// 11 Feb 2001 Use BOOST_STATIC_CONSTANT (Dave Abrahams)
|
||||
// 11 Feb 2001 Clean up after John Maddocks's (finally effective!) Borland
|
||||
// fixes (David Abrahams).
|
||||
// 10 Feb 2001 Use new iterator_adaptor<> interface (David Abrahams)
|
||||
// 10 Feb 2001 Rolled in supposed Borland fixes from John Maddock, but not
|
||||
// seeing any improvement yet (David Abrahams)
|
||||
// 09 Feb 2001 Factored out is_numeric computation. Borland still
|
||||
// unhappy :( (David Abrahams)
|
||||
// 08 Feb 2001 Beginning of a failed attempt to appease Borland
|
||||
@ -126,15 +134,16 @@ namespace detail {
|
||||
struct is_numeric {
|
||||
// For a while, this wasn't true, but we rely on it below. This is a regression assert.
|
||||
BOOST_STATIC_ASSERT(::boost::is_integral<char>::value);
|
||||
enum { value =
|
||||
#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
|
||||
std::numeric_limits<T>::is_specialized
|
||||
#elif defined(__BORLANDC__)
|
||||
::boost::is_integral<T>::value
|
||||
#else
|
||||
boost::is_convertible<int,T>::value && boost::is_convertible<T,int>::value
|
||||
#endif
|
||||
};
|
||||
# ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
|
||||
BOOST_STATIC_CONSTANT(bool, value = std::numeric_limits<T>::is_specialized);
|
||||
# else
|
||||
# if !defined(__BORLANDC__)
|
||||
BOOST_STATIC_CONSTANT(bool, value = (
|
||||
boost::is_convertible<int,T>::value && boost::is_convertible<T,int>::value));
|
||||
# else
|
||||
BOOST_STATIC_CONSTANT(bool, value = ::boost::is_arithmetic<T>::value);
|
||||
# endif
|
||||
# endif
|
||||
};
|
||||
|
||||
// Compute the distance over arbitrary numeric and/or iterator types
|
||||
@ -152,14 +161,11 @@ namespace detail {
|
||||
template <class Incrementable>
|
||||
struct counting_iterator_traits {
|
||||
private:
|
||||
enum {numeric = detail::is_numeric<Incrementable>::value };
|
||||
typedef typename detail::counting_iterator_traits_select<(
|
||||
numeric
|
||||
)>::template traits<Incrementable> traits;
|
||||
typedef ::boost::detail::counting_iterator_traits_select<(
|
||||
::boost::detail::is_numeric<Incrementable>::value
|
||||
)> binder;
|
||||
typedef typename binder::template traits<Incrementable> traits;
|
||||
public:
|
||||
typedef Incrementable value_type;
|
||||
typedef const Incrementable& reference;
|
||||
typedef const value_type* pointer;
|
||||
typedef typename traits::difference_type difference_type;
|
||||
typedef typename traits::iterator_category iterator_category;
|
||||
};
|
||||
@ -182,9 +188,16 @@ struct counting_iterator_policies : public default_iterator_policies
|
||||
template <class Incrementable>
|
||||
struct counting_iterator_generator
|
||||
{
|
||||
typedef counting_iterator_traits<Incrementable> traits;
|
||||
|
||||
typedef iterator_adaptor<Incrementable,
|
||||
counting_iterator_policies<Incrementable>,
|
||||
counting_iterator_traits<Incrementable> > type;
|
||||
Incrementable,
|
||||
const Incrementable&,
|
||||
const Incrementable*,
|
||||
typename traits::iterator_category,
|
||||
typename traits::difference_type
|
||||
> type;
|
||||
};
|
||||
|
||||
// Manufacture a counting iterator for an arbitrary incrementable type
|
||||
@ -192,9 +205,8 @@ template <class Incrementable>
|
||||
inline typename counting_iterator_generator<Incrementable>::type
|
||||
make_counting_iterator(Incrementable x)
|
||||
{
|
||||
return iterator_adaptor<Incrementable,
|
||||
counting_iterator_policies<Incrementable>,
|
||||
counting_iterator_traits<Incrementable> >(x);
|
||||
typedef typename counting_iterator_generator<Incrementable>::type result_t;
|
||||
return result_t(x);
|
||||
}
|
||||
|
||||
|
||||
|
55
include/boost/function_output_iterator.hpp
Normal file
55
include/boost/function_output_iterator.hpp
Normal file
@ -0,0 +1,55 @@
|
||||
// (C) Copyright Jeremy Siek 2001. 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.
|
||||
|
||||
// Revision History:
|
||||
|
||||
// 27 Feb 2001 Jeremy Siek
|
||||
// Initial checkin.
|
||||
|
||||
#ifndef BOOST_FUNCTION_OUTPUT_ITERATOR_HPP
|
||||
#define BOOST_FUNCTION_OUTPUT_ITERATOR_HPP
|
||||
|
||||
#include <iterator>
|
||||
|
||||
namespace boost {
|
||||
|
||||
template <class UnaryFunction>
|
||||
class function_output_iterator {
|
||||
typedef function_output_iterator self;
|
||||
public:
|
||||
typedef std::output_iterator_tag iterator_category;
|
||||
typedef void value_type;
|
||||
typedef void difference_type;
|
||||
typedef void pointer;
|
||||
typedef void reference;
|
||||
|
||||
explicit function_output_iterator(const UnaryFunction& f = UnaryFunction())
|
||||
: m_f(f) {}
|
||||
|
||||
struct output_proxy {
|
||||
output_proxy(UnaryFunction& f) : m_f(f) { }
|
||||
template <class T> output_proxy& operator=(const T& value) {
|
||||
m_f(value);
|
||||
return *this;
|
||||
}
|
||||
UnaryFunction& m_f;
|
||||
};
|
||||
output_proxy operator*() { return output_proxy(m_f); }
|
||||
self& operator++() { return *this; }
|
||||
self& operator++(int) { return *this; }
|
||||
private:
|
||||
UnaryFunction m_f;
|
||||
};
|
||||
|
||||
template <class UnaryFunction>
|
||||
inline function_output_iterator<UnaryFunction>
|
||||
make_function_output_iterator(const UnaryFunction& f = UnaryFunction()) {
|
||||
return function_output_iterator<UnaryFunction>(f);
|
||||
}
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_FUNCTION_OUTPUT_ITERATOR_HPP
|
@ -5,8 +5,10 @@
|
||||
// for any purpose.
|
||||
//
|
||||
// Revision History:
|
||||
// 04 Feb 2001 Support for user-defined iterator categories (David Abrahams)
|
||||
// 30 Jan 2001 Initial Checkin (David Abrahams)
|
||||
// 11 Feb 2001 Use new iterator_adaptor interface, Fixes for Borland.
|
||||
// (Dave Abrahams)
|
||||
// 04 Feb 2001 Support for user-defined iterator categories (Dave Abrahams)
|
||||
// 30 Jan 2001 Initial Checkin (Dave Abrahams)
|
||||
|
||||
#ifndef BOOST_HALF_OPEN_RANGE_HPP_
|
||||
# define BOOST_HALF_OPEN_RANGE_HPP_
|
||||
@ -75,7 +77,7 @@ namespace detail {
|
||||
static const Incrementable choose(const Incrementable& start, const Incrementable& finish)
|
||||
{
|
||||
return finish_chooser<(
|
||||
boost::is_convertible<Category,std::random_access_iterator_tag>::value
|
||||
::boost::is_convertible<Category*,std::random_access_iterator_tag*>::value
|
||||
)>::template rebind<Incrementable>::choose(start, finish);
|
||||
}
|
||||
};
|
||||
@ -85,16 +87,18 @@ namespace detail {
|
||||
template <class Incrementable>
|
||||
struct half_open_range
|
||||
{
|
||||
typedef iterator_adaptor<Incrementable,
|
||||
counting_iterator_policies<Incrementable>,
|
||||
counting_iterator_traits<Incrementable> > iterator;
|
||||
typedef typename counting_iterator_generator<Incrementable>::type iterator;
|
||||
|
||||
private: // utility type definitions
|
||||
// Using iter_t prevents compiler confusion with boost::iterator
|
||||
typedef typename counting_iterator_generator<Incrementable>::type iter_t;
|
||||
|
||||
typedef std::less<Incrementable> less_value;
|
||||
typedef typename boost::detail::iterator_traits<iterator>::iterator_category category;
|
||||
typedef typename iter_t::iterator_category category;
|
||||
typedef half_open_range<Incrementable> self;
|
||||
|
||||
public:
|
||||
typedef iterator const_iterator;
|
||||
typedef iter_t const_iterator;
|
||||
typedef typename counting_iterator_traits<Incrementable>::value_type value_type;
|
||||
typedef typename counting_iterator_traits<Incrementable>::difference_type difference_type;
|
||||
typedef typename counting_iterator_traits<Incrementable>::reference reference;
|
||||
@ -130,7 +134,14 @@ struct half_open_range
|
||||
#endif
|
||||
)
|
||||
{}
|
||||
|
||||
|
||||
half_open_range& operator=(const self& x)
|
||||
{
|
||||
m_start = x.m_start;
|
||||
m_finish = x.m_finish;
|
||||
return *this;
|
||||
}
|
||||
|
||||
half_open_range& operator=(const std::pair<Incrementable,Incrementable>& x)
|
||||
{
|
||||
m_start = x.first;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -15,12 +15,14 @@
|
||||
# include <assert.h>
|
||||
# include <boost/type_traits.hpp>
|
||||
# include <boost/static_assert.hpp>
|
||||
# include <boost/concept_archetype.hpp> // for detail::dummy_constructor
|
||||
|
||||
namespace boost {
|
||||
|
||||
// use this for the value type
|
||||
struct dummyT {
|
||||
dummyT() { }
|
||||
dummyT(detail::dummy_constructor) { }
|
||||
dummyT(int x) : m_x(x) { }
|
||||
int foo() const { return m_x; }
|
||||
bool operator==(const dummyT& d) const { return m_x == d.m_x; }
|
||||
|
Reference in New Issue
Block a user