mirror of
https://github.com/boostorg/iterator.git
synced 2025-07-02 15:31:02 +02:00
Compare commits
34 Commits
svn-branch
...
svn-branch
Author | SHA1 | Date | |
---|---|---|---|
6bfb6ff582 | |||
df4b9402bd | |||
8174963a45 | |||
86e183c75e | |||
a94c9d0db2 | |||
8a73dcd052 | |||
8496571204 | |||
bafe0703a6 | |||
b05b38810c | |||
edf17ba001 | |||
ee9f140fae | |||
762e603013 | |||
6eeeb23332 | |||
07482538ed | |||
d17e8dae9b | |||
5e1bc30db9 | |||
e8389d5f49 | |||
332f18cf9f | |||
7aea7b7881 | |||
3e6796ab91 | |||
893b5c0e25 | |||
41c334d718 | |||
05336f45c4 | |||
90299982a6 | |||
93b54c15c8 | |||
25f9acabac | |||
bb2ffadade | |||
b6aa32721f | |||
8f41e88f85 | |||
58b56fbabb | |||
9a4b0b576d | |||
c948483ec1 | |||
a31a89ae7d | |||
b8ccd48fa3 |
1007
include/boost/iterator_adaptors.hpp
Normal file
1007
include/boost/iterator_adaptors.hpp
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,59 +0,0 @@
|
||||
// (C) Copyright David Abrahams and Jeremy Siek 2000-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:
|
||||
// 04 Jan 2001 Factored counting_iterator stuff into
|
||||
// boost/counting_iterator.hpp (David Abrahams)
|
||||
|
||||
#ifndef BOOST_INTEGER_RANGE_HPP_
|
||||
#define BOOST_INTEGER_RANGE_HPP_
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/counting_iterator.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
//=============================================================================
|
||||
// Counting Iterator and Integer Range Class
|
||||
|
||||
template <class IntegerType>
|
||||
struct integer_range {
|
||||
typedef typename counting_iterator_generator<IntegerType>::type iterator;
|
||||
|
||||
typedef iterator const_iterator;
|
||||
typedef IntegerType value_type;
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
typedef IntegerType reference;
|
||||
typedef IntegerType const_reference;
|
||||
typedef const IntegerType* pointer;
|
||||
typedef const IntegerType* const_pointer;
|
||||
typedef IntegerType size_type;
|
||||
|
||||
integer_range(IntegerType start, IntegerType finish)
|
||||
: m_start(start), m_finish(finish) { }
|
||||
|
||||
iterator begin() const { return iterator(m_start); }
|
||||
iterator end() const { return iterator(m_finish); }
|
||||
size_type size() const { return m_finish - m_start; }
|
||||
bool empty() const { return m_finish == m_start; }
|
||||
void swap(integer_range& x) {
|
||||
std::swap(m_start, x.m_start);
|
||||
std::swap(m_finish, x.m_finish);
|
||||
}
|
||||
protected:
|
||||
IntegerType m_start, m_finish;
|
||||
};
|
||||
|
||||
template <class IntegerType>
|
||||
inline integer_range<IntegerType>
|
||||
make_integer_range(IntegerType first, IntegerType last)
|
||||
{
|
||||
return integer_range<IntegerType>(first, last);
|
||||
}
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_INTEGER_RANGE_HPP_
|
Reference in New Issue
Block a user