mirror of
https://github.com/boostorg/range.git
synced 2025-06-29 05:51:09 +02:00
Compare commits
61 Commits
svn-branch
...
boost-1.51
Author | SHA1 | Date | |
---|---|---|---|
125c04d8fa | |||
dc46fc13ab | |||
2f3d82be9f | |||
47e478d099 | |||
126e6861d7 | |||
d490a84c8d | |||
10af4fc1e0 | |||
f8bb8aafbf | |||
c6a6a46db4 | |||
cc8a1413cb | |||
1131136d4a | |||
3cd6a7277f | |||
19a2090ef8 | |||
67f457ade1 | |||
7315e2c14e | |||
cafea6aea5 | |||
6d46ce412f | |||
674be9dfa0 | |||
65b22bfa38 | |||
fb8994f51c | |||
26c095d022 | |||
ca2328ed87 | |||
794fd3e226 | |||
88001ada37 | |||
91d62c2c1a | |||
f9eeb5d447 | |||
a47f15a98f | |||
dfc30e334d | |||
13b748a228 | |||
eea32403ef | |||
29b2053f5c | |||
29fa877949 | |||
a39946c55d | |||
90f4eca5cd | |||
c8c808b04e | |||
deefb61ec6 | |||
12d904a5e4 | |||
26b096f65d | |||
a85afbe470 | |||
e7902d439b | |||
b4f99d66b5 | |||
d1c2c5ce3f | |||
062e820882 | |||
4d381e8564 | |||
fd00cc129f | |||
8291ce67fc | |||
dbfa1df088 | |||
5afec2b74f | |||
a33d5c22c5 | |||
901266b76a | |||
25e932149c | |||
c54e15d374 | |||
fd448ffa31 | |||
21b558fe5e | |||
33c8f3e3ec | |||
523f8a5926 | |||
3bd0d886c4 | |||
e46eae8144 | |||
12cf02586c | |||
ee024f588b | |||
8e715b3810 |
@ -11,7 +11,7 @@
|
|||||||
#include <boost/range/algorithm/copy.hpp>
|
#include <boost/range/algorithm/copy.hpp>
|
||||||
#include <boost/assign.hpp>
|
#include <boost/assign.hpp>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <functinoal>
|
#include <functional>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
@ -41,5 +41,5 @@ int main(int argc, const char* argv[])
|
|||||||
display_element_and_index( input | indexed(0) );
|
display_element_and_index( input | indexed(0) );
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
]
|
}
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
//
|
//
|
||||||
#include <boost/range/adaptor/transformed.hpp>
|
#include <boost/range/adaptor/transformed.hpp>
|
||||||
#include <boost/range/algorithm/copy.hpp>
|
#include <boost/range/algorithm/copy.hpp>
|
||||||
#include <boost/range/assign.hpp>
|
#include <boost/assign.hpp>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
@ -128,7 +128,7 @@
|
|||||||
]
|
]
|
||||||
[
|
[
|
||||||
[`size(x)`]
|
[`size(x)`]
|
||||||
[`range_difference<X>::type`]
|
[`range_size<X>::type`]
|
||||||
[`range_calculate_size(x)` which by default is `boost::end(x) - boost::begin(x)`. Users may supply alternative implementations by implementing `range_calculate_size(x)` so that it will be found via ADL]
|
[`range_calculate_size(x)` which by default is `boost::end(x) - boost::begin(x)`. Users may supply alternative implementations by implementing `range_calculate_size(x)` so that it will be found via ADL]
|
||||||
[constant time]
|
[constant time]
|
||||||
]
|
]
|
||||||
|
@ -5,6 +5,12 @@
|
|||||||
/]
|
/]
|
||||||
[section:upgrade Upgrade version of Boost.Range]
|
[section:upgrade Upgrade version of Boost.Range]
|
||||||
|
|
||||||
|
[section:upgrade_from_1_49 Upgrade from version 1.49]
|
||||||
|
|
||||||
|
# __size__ now returns the type Rng::size_type if the range has size_type;
|
||||||
|
otherwise range_size<Rng>::type is used. This is the distance type promoted to
|
||||||
|
an unsigned type.
|
||||||
|
|
||||||
[section:upgrade_from_1_45 Upgrade from version 1.45]
|
[section:upgrade_from_1_45 Upgrade from version 1.45]
|
||||||
|
|
||||||
# __size__ in addition to supporting __random_access_range__ now also supports extensibility via calls to the unqualified `range_calculate_size(rng)` function.
|
# __size__ in addition to supporting __random_access_range__ now also supports extensibility via calls to the unqualified `range_calculate_size(rng)` function.
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
# pragma once
|
# pragma once
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(_MSC_VER) && (_MSC_VER == 1300)
|
#if _MSC_VER == 1300 // experiment
|
||||||
|
|
||||||
#include <boost/range/detail/collection_traits.hpp>
|
#include <boost/range/detail/collection_traits.hpp>
|
||||||
#include <boost/range/iterator_range.hpp>
|
#include <boost/range/iterator_range.hpp>
|
||||||
@ -28,6 +28,6 @@
|
|||||||
#include <boost/range/iterator_range.hpp>
|
#include <boost/range/iterator_range.hpp>
|
||||||
#include <boost/range/sub_range.hpp>
|
#include <boost/range/sub_range.hpp>
|
||||||
|
|
||||||
#endif // _MSC_VER == 1300
|
#endif // _MSC_VER == 1300 // experiment
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -143,10 +143,6 @@ namespace boost
|
|||||||
skip_iter(boost::end(r), boost::end(r), p))
|
skip_iter(boost::end(r), boost::end(r), p))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
|
||||||
P m_pred;
|
|
||||||
R* m_range;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template< class T >
|
template< class T >
|
||||||
|
0
include/boost/range/adaptor/argument_fwd.hpp
Executable file → Normal file
0
include/boost/range/adaptor/argument_fwd.hpp
Executable file → Normal file
0
include/boost/range/adaptor/copied.hpp
Executable file → Normal file
0
include/boost/range/adaptor/copied.hpp
Executable file → Normal file
@ -44,24 +44,6 @@
|
|||||||
return range_adaptor <const Range>(rng); \
|
return range_adaptor <const Range>(rng); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define BOOST_DEFINE_RANGE_ADAPTOR_1( adaptor_name, range_adaptor, adaptor_class ) \
|
|
||||||
template<typename Range> range_adaptor <Range> \
|
|
||||||
operator|(Range& rng, const adaptor_name & args) \
|
|
||||||
{ \
|
|
||||||
return range_adaptor <Range>(rng, args.arg1); \
|
|
||||||
} \
|
|
||||||
template<typename Range> range_adaptor <const Range> \
|
|
||||||
operator|(const Range& rng, const adaptor_name & args) \
|
|
||||||
{ \
|
|
||||||
return range_adaptor <Range>(rng, args.arg1); \
|
|
||||||
} \
|
|
||||||
template<typename Range, typename Arg1> \
|
|
||||||
range_adaptor<Range> \
|
|
||||||
make_##adaptor_name(Range& rng, Arg1 arg1) \
|
|
||||||
{ \
|
|
||||||
return range_adaptor<Range>(rng, arg1); \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define BOOST_DEFINE_RANGE_ADAPTOR_1( adaptor_name, range_adaptor, arg1_type ) \
|
#define BOOST_DEFINE_RANGE_ADAPTOR_1( adaptor_name, range_adaptor, arg1_type ) \
|
||||||
struct adaptor_name \
|
struct adaptor_name \
|
||||||
{ \
|
{ \
|
||||||
|
0
include/boost/range/adaptor/filtered.hpp
Executable file → Normal file
0
include/boost/range/adaptor/filtered.hpp
Executable file → Normal file
0
include/boost/range/adaptor/indexed.hpp
Executable file → Normal file
0
include/boost/range/adaptor/indexed.hpp
Executable file → Normal file
0
include/boost/range/adaptor/map.hpp
Executable file → Normal file
0
include/boost/range/adaptor/map.hpp
Executable file → Normal file
0
include/boost/range/adaptor/reversed.hpp
Executable file → Normal file
0
include/boost/range/adaptor/reversed.hpp
Executable file → Normal file
0
include/boost/range/adaptor/sliced.hpp
Executable file → Normal file
0
include/boost/range/adaptor/sliced.hpp
Executable file → Normal file
43
include/boost/range/adaptor/strided.hpp
Executable file → Normal file
43
include/boost/range/adaptor/strided.hpp
Executable file → Normal file
@ -176,6 +176,7 @@ namespace boost
|
|||||||
strided_iterator()
|
strided_iterator()
|
||||||
: m_first()
|
: m_first()
|
||||||
, m_last()
|
, m_last()
|
||||||
|
, m_index(0)
|
||||||
, m_stride()
|
, m_stride()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -184,6 +185,7 @@ namespace boost
|
|||||||
: super_t(it)
|
: super_t(it)
|
||||||
, m_first(first)
|
, m_first(first)
|
||||||
, m_last(last)
|
, m_last(last)
|
||||||
|
, m_index(stride ? (it - first) / stride : 0)
|
||||||
, m_stride(stride)
|
, m_stride(stride)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -194,6 +196,7 @@ namespace boost
|
|||||||
: super_t(other.base())
|
: super_t(other.base())
|
||||||
, m_first(other.base_begin())
|
, m_first(other.base_begin())
|
||||||
, m_last(other.base_end())
|
, m_last(other.base_end())
|
||||||
|
, m_index(other.get_index())
|
||||||
, m_stride(other.get_stride())
|
, m_stride(other.get_stride())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -201,44 +204,37 @@ namespace boost
|
|||||||
base_iterator base_begin() const { return m_first; }
|
base_iterator base_begin() const { return m_first; }
|
||||||
base_iterator base_end() const { return m_last; }
|
base_iterator base_end() const { return m_last; }
|
||||||
difference_type get_stride() const { return m_stride; }
|
difference_type get_stride() const { return m_stride; }
|
||||||
|
difference_type get_index() const { return m_index; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void increment()
|
void increment()
|
||||||
{
|
{
|
||||||
base_iterator& it = this->base_reference();
|
m_index += m_stride;
|
||||||
if ((m_last - it) > m_stride)
|
if (m_index < (m_last - m_first))
|
||||||
it += m_stride;
|
this->base_reference() = m_first + m_index;
|
||||||
else
|
else
|
||||||
it = m_last;
|
this->base_reference() = m_last;
|
||||||
}
|
}
|
||||||
|
|
||||||
void decrement()
|
void decrement()
|
||||||
{
|
{
|
||||||
base_iterator& it = this->base_reference();
|
m_index -= m_stride;
|
||||||
if ((it - m_first) > m_stride)
|
if (m_index >= 0)
|
||||||
it -= m_stride;
|
this->base_reference() = m_first + m_index;
|
||||||
else
|
else
|
||||||
it = m_first;
|
this->base_reference() = m_first;
|
||||||
}
|
}
|
||||||
|
|
||||||
void advance(difference_type offset)
|
void advance(difference_type offset)
|
||||||
{
|
{
|
||||||
base_iterator& it = this->base_reference();
|
|
||||||
offset *= m_stride;
|
offset *= m_stride;
|
||||||
if (offset >= 0)
|
m_index += offset;
|
||||||
{
|
if (m_index < 0)
|
||||||
if ((m_last - it) > offset)
|
this->base_reference() = m_first;
|
||||||
it += offset;
|
else if (m_index > (m_last - m_first))
|
||||||
|
this->base_reference() = m_last;
|
||||||
else
|
else
|
||||||
it = m_last;
|
this->base_reference() = m_first + m_index;
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if ((m_first - it) > offset)
|
|
||||||
it += offset;
|
|
||||||
else
|
|
||||||
it = m_first;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class OtherIterator>
|
template<class OtherIterator>
|
||||||
@ -252,12 +248,13 @@ namespace boost
|
|||||||
|
|
||||||
bool equal(const strided_iterator& other) const
|
bool equal(const strided_iterator& other) const
|
||||||
{
|
{
|
||||||
return other.base() == this->base();
|
return this->base() == other.base();
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
base_iterator m_first;
|
base_iterator m_first;
|
||||||
base_iterator m_last;
|
base_iterator m_last;
|
||||||
|
difference_type m_index;
|
||||||
difference_type m_stride;
|
difference_type m_stride;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
0
include/boost/range/adaptor/tokenized.hpp
Executable file → Normal file
0
include/boost/range/adaptor/tokenized.hpp
Executable file → Normal file
4
include/boost/range/adaptor/transformed.hpp
Executable file → Normal file
4
include/boost/range/adaptor/transformed.hpp
Executable file → Normal file
@ -42,8 +42,8 @@ namespace boost
|
|||||||
typedef R source_range_type;
|
typedef R source_range_type;
|
||||||
|
|
||||||
transformed_range( F f, R& r )
|
transformed_range( F f, R& r )
|
||||||
: base( make_transform_iterator( boost::begin(r), f ),
|
: base( boost::make_transform_iterator( boost::begin(r), f ),
|
||||||
make_transform_iterator( boost::end(r), f ) )
|
boost::make_transform_iterator( boost::end(r), f ) )
|
||||||
|
|
||||||
{ }
|
{ }
|
||||||
};
|
};
|
||||||
|
0
include/boost/range/adaptor/uniqued.hpp
Executable file → Normal file
0
include/boost/range/adaptor/uniqued.hpp
Executable file → Normal file
0
include/boost/range/adaptors.hpp
Executable file → Normal file
0
include/boost/range/adaptors.hpp
Executable file → Normal file
0
include/boost/range/algorithm.hpp
Executable file → Normal file
0
include/boost/range/algorithm.hpp
Executable file → Normal file
0
include/boost/range/algorithm/adjacent_find.hpp
Executable file → Normal file
0
include/boost/range/algorithm/adjacent_find.hpp
Executable file → Normal file
0
include/boost/range/algorithm/binary_search.hpp
Executable file → Normal file
0
include/boost/range/algorithm/binary_search.hpp
Executable file → Normal file
0
include/boost/range/algorithm/copy_backward.hpp
Executable file → Normal file
0
include/boost/range/algorithm/copy_backward.hpp
Executable file → Normal file
0
include/boost/range/algorithm/count.hpp
Executable file → Normal file
0
include/boost/range/algorithm/count.hpp
Executable file → Normal file
0
include/boost/range/algorithm/count_if.hpp
Executable file → Normal file
0
include/boost/range/algorithm/count_if.hpp
Executable file → Normal file
20
include/boost/range/algorithm/equal.hpp
Executable file → Normal file
20
include/boost/range/algorithm/equal.hpp
Executable file → Normal file
@ -31,7 +31,7 @@ namespace boost
|
|||||||
IteratorCategoryTag1,
|
IteratorCategoryTag1,
|
||||||
IteratorCategoryTag2 )
|
IteratorCategoryTag2 )
|
||||||
{
|
{
|
||||||
do
|
while (true)
|
||||||
{
|
{
|
||||||
// If we have reached the end of the left range then this is
|
// If we have reached the end of the left range then this is
|
||||||
// the end of the loop. They are equal if and only if we have
|
// the end of the loop. They are equal if and only if we have
|
||||||
@ -46,7 +46,12 @@ namespace boost
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
// continue looping if and only if the values are equal
|
// continue looping if and only if the values are equal
|
||||||
} while(*first1++ == *first2++);
|
if (*first1 != *first2)
|
||||||
|
break;
|
||||||
|
|
||||||
|
++first1;
|
||||||
|
++first2;
|
||||||
|
}
|
||||||
|
|
||||||
// Reaching this line in the algorithm indicates that a value
|
// Reaching this line in the algorithm indicates that a value
|
||||||
// inequality has been detected.
|
// inequality has been detected.
|
||||||
@ -66,7 +71,7 @@ namespace boost
|
|||||||
IteratorCategoryTag1,
|
IteratorCategoryTag1,
|
||||||
IteratorCategoryTag2 )
|
IteratorCategoryTag2 )
|
||||||
{
|
{
|
||||||
do
|
while (true)
|
||||||
{
|
{
|
||||||
// If we have reached the end of the left range then this is
|
// If we have reached the end of the left range then this is
|
||||||
// the end of the loop. They are equal if and only if we have
|
// the end of the loop. They are equal if and only if we have
|
||||||
@ -81,7 +86,12 @@ namespace boost
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
// continue looping if and only if the values are equal
|
// continue looping if and only if the values are equal
|
||||||
} while(pred(*first1++, *first2++));
|
if (!pred(*first1, *first2))
|
||||||
|
break;
|
||||||
|
|
||||||
|
++first1;
|
||||||
|
++first2;
|
||||||
|
}
|
||||||
|
|
||||||
// Reaching this line in the algorithm indicates that a value
|
// Reaching this line in the algorithm indicates that a value
|
||||||
// inequality has been detected.
|
// inequality has been detected.
|
||||||
@ -182,7 +192,7 @@ namespace boost
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace range
|
} // namespace range
|
||||||
using range::equal;
|
using ::boost::range::equal;
|
||||||
} // namespace boost
|
} // namespace boost
|
||||||
|
|
||||||
#endif // include guard
|
#endif // include guard
|
||||||
|
0
include/boost/range/algorithm/equal_range.hpp
Executable file → Normal file
0
include/boost/range/algorithm/equal_range.hpp
Executable file → Normal file
0
include/boost/range/algorithm/fill.hpp
Executable file → Normal file
0
include/boost/range/algorithm/fill.hpp
Executable file → Normal file
0
include/boost/range/algorithm/fill_n.hpp
Executable file → Normal file
0
include/boost/range/algorithm/fill_n.hpp
Executable file → Normal file
0
include/boost/range/algorithm/find.hpp
Executable file → Normal file
0
include/boost/range/algorithm/find.hpp
Executable file → Normal file
0
include/boost/range/algorithm/find_end.hpp
Executable file → Normal file
0
include/boost/range/algorithm/find_end.hpp
Executable file → Normal file
0
include/boost/range/algorithm/find_first_of.hpp
Executable file → Normal file
0
include/boost/range/algorithm/find_first_of.hpp
Executable file → Normal file
0
include/boost/range/algorithm/find_if.hpp
Executable file → Normal file
0
include/boost/range/algorithm/find_if.hpp
Executable file → Normal file
65
include/boost/range/algorithm/for_each.hpp
Executable file → Normal file
65
include/boost/range/algorithm/for_each.hpp
Executable file → Normal file
@ -13,13 +13,52 @@
|
|||||||
#include <boost/range/begin.hpp>
|
#include <boost/range/begin.hpp>
|
||||||
#include <boost/range/end.hpp>
|
#include <boost/range/end.hpp>
|
||||||
#include <boost/range/concepts.hpp>
|
#include <boost/range/concepts.hpp>
|
||||||
|
#include <boost/ref.hpp>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
|
#if BOOST_WORKAROUND(BOOST_MSVC, == 1600)
|
||||||
|
#include <xutility>
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace boost
|
namespace boost
|
||||||
{
|
{
|
||||||
namespace range
|
namespace range
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#if BOOST_WORKAROUND(BOOST_MSVC, == 1600)
|
||||||
|
namespace for_each_detail
|
||||||
|
{
|
||||||
|
template<typename Iterator, typename UnaryFunction>
|
||||||
|
inline UnaryFunction
|
||||||
|
for_each_impl(Iterator first, Iterator last, UnaryFunction fun,
|
||||||
|
typename enable_if<
|
||||||
|
is_reference_wrapper<UnaryFunction>,
|
||||||
|
void
|
||||||
|
>::type* = 0)
|
||||||
|
{
|
||||||
|
typedef typename std::_Get_unchecked_type<Iterator>::type
|
||||||
|
unchecked_iterator;
|
||||||
|
|
||||||
|
unchecked_iterator unchecked_last = std::_Unchecked(last);
|
||||||
|
for (unchecked_iterator unchecked_first = std::_Unchecked(first); first != last; ++first)
|
||||||
|
fun.get()(*unchecked_first);
|
||||||
|
|
||||||
|
return fun;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename Iterator, typename UnaryFunction>
|
||||||
|
inline UnaryFunction
|
||||||
|
for_each_impl(Iterator first, Iterator last, UnaryFunction fn,
|
||||||
|
typename disable_if<
|
||||||
|
is_reference_wrapper<UnaryFunction>,
|
||||||
|
void
|
||||||
|
>::type* = 0)
|
||||||
|
{
|
||||||
|
return std::for_each<Iterator, UnaryFunction>(first, last, fn);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/// \brief template function for_each
|
/// \brief template function for_each
|
||||||
///
|
///
|
||||||
/// range-based version of the for_each std algorithm
|
/// range-based version of the for_each std algorithm
|
||||||
@ -30,7 +69,18 @@ template< class SinglePassRange, class UnaryFunction >
|
|||||||
inline UnaryFunction for_each(SinglePassRange & rng, UnaryFunction fun)
|
inline UnaryFunction for_each(SinglePassRange & rng, UnaryFunction fun)
|
||||||
{
|
{
|
||||||
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange> ));
|
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange> ));
|
||||||
return std::for_each(boost::begin(rng),boost::end(rng),fun);
|
|
||||||
|
#if BOOST_WORKAROUND(BOOST_MSVC, == 1600)
|
||||||
|
return for_each_detail::for_each_impl<
|
||||||
|
typename range_iterator<SinglePassRange>::type,
|
||||||
|
UnaryFunction
|
||||||
|
>(boost::begin(rng), boost::end(rng), fun);
|
||||||
|
#else
|
||||||
|
return std::for_each<
|
||||||
|
BOOST_DEDUCED_TYPENAME range_iterator<SinglePassRange>::type,
|
||||||
|
UnaryFunction
|
||||||
|
>(boost::begin(rng),boost::end(rng),fun);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/// \overload
|
/// \overload
|
||||||
@ -38,7 +88,18 @@ template< class SinglePassRange, class UnaryFunction >
|
|||||||
inline UnaryFunction for_each(const SinglePassRange& rng, UnaryFunction fun)
|
inline UnaryFunction for_each(const SinglePassRange& rng, UnaryFunction fun)
|
||||||
{
|
{
|
||||||
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange> ));
|
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange> ));
|
||||||
return std::for_each(boost::begin(rng), boost::end(rng), fun);
|
|
||||||
|
#if BOOST_WORKAROUND(BOOST_MSVC, == 1600)
|
||||||
|
return for_each_detail::for_each_impl<
|
||||||
|
typename range_iterator<const SinglePassRange>::type,
|
||||||
|
UnaryFunction
|
||||||
|
>(boost::begin(rng), boost::end(rng), fun);
|
||||||
|
#else
|
||||||
|
return std::for_each<
|
||||||
|
BOOST_DEDUCED_TYPENAME range_iterator<const SinglePassRange>::type,
|
||||||
|
UnaryFunction
|
||||||
|
>(boost::begin(rng), boost::end(rng), fun);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace range
|
} // namespace range
|
||||||
|
0
include/boost/range/algorithm/generate.hpp
Executable file → Normal file
0
include/boost/range/algorithm/generate.hpp
Executable file → Normal file
0
include/boost/range/algorithm/heap_algorithm.hpp
Executable file → Normal file
0
include/boost/range/algorithm/heap_algorithm.hpp
Executable file → Normal file
0
include/boost/range/algorithm/inplace_merge.hpp
Executable file → Normal file
0
include/boost/range/algorithm/inplace_merge.hpp
Executable file → Normal file
0
include/boost/range/algorithm/lexicographical_compare.hpp
Executable file → Normal file
0
include/boost/range/algorithm/lexicographical_compare.hpp
Executable file → Normal file
0
include/boost/range/algorithm/lower_bound.hpp
Executable file → Normal file
0
include/boost/range/algorithm/lower_bound.hpp
Executable file → Normal file
0
include/boost/range/algorithm/max_element.hpp
Executable file → Normal file
0
include/boost/range/algorithm/max_element.hpp
Executable file → Normal file
0
include/boost/range/algorithm/merge.hpp
Executable file → Normal file
0
include/boost/range/algorithm/merge.hpp
Executable file → Normal file
0
include/boost/range/algorithm/min_element.hpp
Executable file → Normal file
0
include/boost/range/algorithm/min_element.hpp
Executable file → Normal file
0
include/boost/range/algorithm/mismatch.hpp
Executable file → Normal file
0
include/boost/range/algorithm/mismatch.hpp
Executable file → Normal file
0
include/boost/range/algorithm/nth_element.hpp
Executable file → Normal file
0
include/boost/range/algorithm/nth_element.hpp
Executable file → Normal file
0
include/boost/range/algorithm/partial_sort.hpp
Executable file → Normal file
0
include/boost/range/algorithm/partial_sort.hpp
Executable file → Normal file
0
include/boost/range/algorithm/partial_sort_copy.hpp
Executable file → Normal file
0
include/boost/range/algorithm/partial_sort_copy.hpp
Executable file → Normal file
0
include/boost/range/algorithm/partition.hpp
Executable file → Normal file
0
include/boost/range/algorithm/partition.hpp
Executable file → Normal file
0
include/boost/range/algorithm/permutation.hpp
Executable file → Normal file
0
include/boost/range/algorithm/permutation.hpp
Executable file → Normal file
0
include/boost/range/algorithm/random_shuffle.hpp
Executable file → Normal file
0
include/boost/range/algorithm/random_shuffle.hpp
Executable file → Normal file
0
include/boost/range/algorithm/remove.hpp
Executable file → Normal file
0
include/boost/range/algorithm/remove.hpp
Executable file → Normal file
0
include/boost/range/algorithm/remove_copy.hpp
Executable file → Normal file
0
include/boost/range/algorithm/remove_copy.hpp
Executable file → Normal file
0
include/boost/range/algorithm/remove_copy_if.hpp
Executable file → Normal file
0
include/boost/range/algorithm/remove_copy_if.hpp
Executable file → Normal file
0
include/boost/range/algorithm/remove_if.hpp
Executable file → Normal file
0
include/boost/range/algorithm/remove_if.hpp
Executable file → Normal file
0
include/boost/range/algorithm/replace.hpp
Executable file → Normal file
0
include/boost/range/algorithm/replace.hpp
Executable file → Normal file
0
include/boost/range/algorithm/replace_copy.hpp
Executable file → Normal file
0
include/boost/range/algorithm/replace_copy.hpp
Executable file → Normal file
0
include/boost/range/algorithm/replace_copy_if.hpp
Executable file → Normal file
0
include/boost/range/algorithm/replace_copy_if.hpp
Executable file → Normal file
0
include/boost/range/algorithm/replace_if.hpp
Executable file → Normal file
0
include/boost/range/algorithm/replace_if.hpp
Executable file → Normal file
0
include/boost/range/algorithm/reverse.hpp
Executable file → Normal file
0
include/boost/range/algorithm/reverse.hpp
Executable file → Normal file
0
include/boost/range/algorithm/reverse_copy.hpp
Executable file → Normal file
0
include/boost/range/algorithm/reverse_copy.hpp
Executable file → Normal file
0
include/boost/range/algorithm/rotate.hpp
Executable file → Normal file
0
include/boost/range/algorithm/rotate.hpp
Executable file → Normal file
0
include/boost/range/algorithm/rotate_copy.hpp
Executable file → Normal file
0
include/boost/range/algorithm/rotate_copy.hpp
Executable file → Normal file
0
include/boost/range/algorithm/search.hpp
Executable file → Normal file
0
include/boost/range/algorithm/search.hpp
Executable file → Normal file
0
include/boost/range/algorithm/search_n.hpp
Executable file → Normal file
0
include/boost/range/algorithm/search_n.hpp
Executable file → Normal file
0
include/boost/range/algorithm/set_algorithm.hpp
Executable file → Normal file
0
include/boost/range/algorithm/set_algorithm.hpp
Executable file → Normal file
0
include/boost/range/algorithm/sort.hpp
Executable file → Normal file
0
include/boost/range/algorithm/sort.hpp
Executable file → Normal file
0
include/boost/range/algorithm/stable_partition.hpp
Executable file → Normal file
0
include/boost/range/algorithm/stable_partition.hpp
Executable file → Normal file
0
include/boost/range/algorithm/stable_sort.hpp
Executable file → Normal file
0
include/boost/range/algorithm/stable_sort.hpp
Executable file → Normal file
0
include/boost/range/algorithm/swap_ranges.hpp
Executable file → Normal file
0
include/boost/range/algorithm/swap_ranges.hpp
Executable file → Normal file
0
include/boost/range/algorithm/transform.hpp
Executable file → Normal file
0
include/boost/range/algorithm/transform.hpp
Executable file → Normal file
0
include/boost/range/algorithm/unique.hpp
Executable file → Normal file
0
include/boost/range/algorithm/unique.hpp
Executable file → Normal file
0
include/boost/range/algorithm/unique_copy.hpp
Executable file → Normal file
0
include/boost/range/algorithm/unique_copy.hpp
Executable file → Normal file
0
include/boost/range/algorithm/upper_bound.hpp
Executable file → Normal file
0
include/boost/range/algorithm/upper_bound.hpp
Executable file → Normal file
0
include/boost/range/algorithm_ext.hpp
Executable file → Normal file
0
include/boost/range/algorithm_ext.hpp
Executable file → Normal file
8
include/boost/range/algorithm_ext/copy_n.hpp
Executable file → Normal file
8
include/boost/range/algorithm_ext/copy_n.hpp
Executable file → Normal file
@ -30,15 +30,15 @@ namespace boost
|
|||||||
///
|
///
|
||||||
/// \pre SinglePassRange is a model of the SinglePassRangeConcept
|
/// \pre SinglePassRange is a model of the SinglePassRangeConcept
|
||||||
/// \pre OutputIterator is a model of the OutputIteratorConcept
|
/// \pre OutputIterator is a model of the OutputIteratorConcept
|
||||||
/// \pre 0 <= n < distance(rng)
|
/// \pre 0 <= n <= distance(rng)
|
||||||
template< class SinglePassRange, class Size, class OutputIterator >
|
template< class SinglePassRange, class Size, class OutputIterator >
|
||||||
inline OutputIterator copy_n(const SinglePassRange& rng, Size n, OutputIterator out)
|
inline OutputIterator copy_n(const SinglePassRange& rng, Size n, OutputIterator out)
|
||||||
{
|
{
|
||||||
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange> ));
|
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange> ));
|
||||||
BOOST_ASSERT( n < static_cast<Size>(boost::distance(rng)) );
|
BOOST_ASSERT( n <= static_cast<Size>(::boost::distance(rng)) );
|
||||||
BOOST_ASSERT( n >= static_cast<Size>(0) );
|
BOOST_ASSERT( n >= static_cast<Size>(0) );
|
||||||
|
|
||||||
BOOST_DEDUCED_TYPENAME range_iterator<const SinglePassRange>::type source = boost::begin(rng);
|
BOOST_DEDUCED_TYPENAME range_iterator<const SinglePassRange>::type source = ::boost::begin(rng);
|
||||||
|
|
||||||
for (Size i = 0; i < n; ++i, ++out, ++source)
|
for (Size i = 0; i < n; ++i, ++out, ++source)
|
||||||
*out = *source;
|
*out = *source;
|
||||||
@ -47,7 +47,7 @@ inline OutputIterator copy_n(const SinglePassRange& rng, Size n, OutputIterator
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace range
|
} // namespace range
|
||||||
using range::copy_n;
|
using ::boost::range::copy_n;
|
||||||
} // namespace boost
|
} // namespace boost
|
||||||
|
|
||||||
#endif // include guard
|
#endif // include guard
|
||||||
|
0
include/boost/range/algorithm_ext/erase.hpp
Executable file → Normal file
0
include/boost/range/algorithm_ext/erase.hpp
Executable file → Normal file
0
include/boost/range/algorithm_ext/for_each.hpp
Executable file → Normal file
0
include/boost/range/algorithm_ext/for_each.hpp
Executable file → Normal file
0
include/boost/range/algorithm_ext/insert.hpp
Executable file → Normal file
0
include/boost/range/algorithm_ext/insert.hpp
Executable file → Normal file
0
include/boost/range/algorithm_ext/is_sorted.hpp
Executable file → Normal file
0
include/boost/range/algorithm_ext/is_sorted.hpp
Executable file → Normal file
0
include/boost/range/algorithm_ext/overwrite.hpp
Executable file → Normal file
0
include/boost/range/algorithm_ext/overwrite.hpp
Executable file → Normal file
0
include/boost/range/algorithm_ext/push_back.hpp
Executable file → Normal file
0
include/boost/range/algorithm_ext/push_back.hpp
Executable file → Normal file
0
include/boost/range/algorithm_ext/push_front.hpp
Executable file → Normal file
0
include/boost/range/algorithm_ext/push_front.hpp
Executable file → Normal file
@ -15,6 +15,7 @@
|
|||||||
#include <boost/iterator/iterator_facade.hpp>
|
#include <boost/iterator/iterator_facade.hpp>
|
||||||
#include <boost/iterator/iterator_adaptor.hpp>
|
#include <boost/iterator/iterator_adaptor.hpp>
|
||||||
#include <boost/range/detail/any_iterator.hpp>
|
#include <boost/range/detail/any_iterator.hpp>
|
||||||
|
#include <boost/range/concepts.hpp>
|
||||||
#include <boost/range/reference.hpp>
|
#include <boost/range/reference.hpp>
|
||||||
#include <boost/range/value_type.hpp>
|
#include <boost/range/value_type.hpp>
|
||||||
#include <boost/range/iterator_range_core.hpp>
|
#include <boost/range/iterator_range_core.hpp>
|
||||||
|
0
include/boost/range/as_array.hpp
Executable file → Normal file
0
include/boost/range/as_array.hpp
Executable file → Normal file
@ -74,7 +74,7 @@ namespace boost
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
template< class T >
|
template< class T >
|
||||||
inline long is_char_ptr( T /* r */ )
|
inline long is_char_ptr( const T& /* r */ )
|
||||||
{
|
{
|
||||||
return 0L;
|
return 0L;
|
||||||
}
|
}
|
||||||
|
0
include/boost/range/category.hpp
Executable file → Normal file
0
include/boost/range/category.hpp
Executable file → Normal file
0
include/boost/range/combine.hpp
Executable file → Normal file
0
include/boost/range/combine.hpp
Executable file → Normal file
0
include/boost/range/config.hpp
Executable file → Normal file
0
include/boost/range/config.hpp
Executable file → Normal file
0
include/boost/range/const_reverse_iterator.hpp
Executable file → Normal file
0
include/boost/range/const_reverse_iterator.hpp
Executable file → Normal file
1
include/boost/range/counting_range.hpp
Executable file → Normal file
1
include/boost/range/counting_range.hpp
Executable file → Normal file
@ -18,7 +18,6 @@
|
|||||||
#include <boost/range/iterator_range_core.hpp>
|
#include <boost/range/iterator_range_core.hpp>
|
||||||
#include <boost/range/value_type.hpp>
|
#include <boost/range/value_type.hpp>
|
||||||
#include <boost/iterator/counting_iterator.hpp>
|
#include <boost/iterator/counting_iterator.hpp>
|
||||||
#include <boost/utility.hpp>
|
|
||||||
|
|
||||||
namespace boost
|
namespace boost
|
||||||
{
|
{
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
#define BOOST_RANGE_DETAIL_ANY_ITERATOR_HPP_INCLUDED
|
#define BOOST_RANGE_DETAIL_ANY_ITERATOR_HPP_INCLUDED
|
||||||
|
|
||||||
#include <boost/cast.hpp>
|
#include <boost/cast.hpp>
|
||||||
#include <boost/utility.hpp>
|
|
||||||
#include <boost/mpl/and.hpp>
|
#include <boost/mpl/and.hpp>
|
||||||
#include <boost/mpl/or.hpp>
|
#include <boost/mpl/or.hpp>
|
||||||
#include <boost/mpl/not.hpp>
|
#include <boost/mpl/not.hpp>
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
#include <boost/array.hpp>
|
#include <boost/array.hpp>
|
||||||
#include <boost/assert.hpp>
|
#include <boost/assert.hpp>
|
||||||
#include <boost/static_assert.hpp>
|
#include <boost/static_assert.hpp>
|
||||||
#include <boost/utility.hpp>
|
#include <boost/noncopyable.hpp>
|
||||||
|
|
||||||
namespace boost
|
namespace boost
|
||||||
{
|
{
|
||||||
|
0
include/boost/range/detail/collection_traits.hpp
Executable file → Normal file
0
include/boost/range/detail/collection_traits.hpp
Executable file → Normal file
0
include/boost/range/detail/collection_traits_detail.hpp
Executable file → Normal file
0
include/boost/range/detail/collection_traits_detail.hpp
Executable file → Normal file
0
include/boost/range/detail/common.hpp
Executable file → Normal file
0
include/boost/range/detail/common.hpp
Executable file → Normal file
0
include/boost/range/detail/const_iterator.hpp
Executable file → Normal file
0
include/boost/range/detail/const_iterator.hpp
Executable file → Normal file
16
include/boost/range/detail/demote_iterator_traversal_tag.hpp
Executable file → Normal file
16
include/boost/range/detail/demote_iterator_traversal_tag.hpp
Executable file → Normal file
@ -5,6 +5,9 @@
|
|||||||
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
// http://www.boost.org/LICENSE_1_0.txt)
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
//
|
//
|
||||||
|
// Acknowledgements:
|
||||||
|
// aschoedl supplied a fix to supply the level of interoperability I had
|
||||||
|
// originally intended, but failed to implement.
|
||||||
//
|
//
|
||||||
// For more information, see http://www.boost.org/libs/range/
|
// For more information, see http://www.boost.org/libs/range/
|
||||||
//
|
//
|
||||||
@ -19,12 +22,12 @@ namespace boost
|
|||||||
{
|
{
|
||||||
|
|
||||||
template<class IteratorTraversalTag1, class IteratorTraversalTag2>
|
template<class IteratorTraversalTag1, class IteratorTraversalTag2>
|
||||||
struct demote_iterator_traversal_tag
|
struct inner_demote_iterator_traversal_tag
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
#define BOOST_DEMOTE_TRAVERSAL_TAG( Tag1, Tag2, ResultTag ) \
|
#define BOOST_DEMOTE_TRAVERSAL_TAG( Tag1, Tag2, ResultTag ) \
|
||||||
template<> struct demote_iterator_traversal_tag< Tag1 , Tag2 > \
|
template<> struct inner_demote_iterator_traversal_tag< Tag1 , Tag2 > \
|
||||||
{ \
|
{ \
|
||||||
typedef ResultTag type; \
|
typedef ResultTag type; \
|
||||||
};
|
};
|
||||||
@ -73,6 +76,15 @@ BOOST_DEMOTE_TRAVERSAL_TAG( random_access_traversal_tag, random_access_traversal
|
|||||||
|
|
||||||
#undef BOOST_DEMOTE_TRAVERSAL_TAG
|
#undef BOOST_DEMOTE_TRAVERSAL_TAG
|
||||||
|
|
||||||
|
template<class IteratorTraversalTag1, class IteratorTraversalTag2>
|
||||||
|
struct demote_iterator_traversal_tag
|
||||||
|
: inner_demote_iterator_traversal_tag<
|
||||||
|
typename boost::detail::pure_traversal_tag< IteratorTraversalTag1 >::type,
|
||||||
|
typename boost::detail::pure_traversal_tag< IteratorTraversalTag2 >::type
|
||||||
|
>
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
} // namespace range_detail
|
} // namespace range_detail
|
||||||
} // namespace boost
|
} // namespace boost
|
||||||
|
|
||||||
|
4
include/boost/range/detail/detail_str.hpp
Executable file → Normal file
4
include/boost/range/detail/detail_str.hpp
Executable file → Normal file
@ -134,8 +134,8 @@ namespace boost
|
|||||||
|
|
||||||
#include <boost/range/detail/begin.hpp>
|
#include <boost/range/detail/begin.hpp>
|
||||||
#include <boost/range/detail/end.hpp>
|
#include <boost/range/detail/end.hpp>
|
||||||
#include <boost/range/detail/size_type>
|
#include <boost/range/detail/size_type.hpp>
|
||||||
#include <boost/range/detail/value_type>
|
#include <boost/range/detail/value_type.hpp>
|
||||||
#include <boost/range/detail/common.hpp>
|
#include <boost/range/detail/common.hpp>
|
||||||
|
|
||||||
namespace boost
|
namespace boost
|
||||||
|
0
include/boost/range/detail/difference_type.hpp
Executable file → Normal file
0
include/boost/range/detail/difference_type.hpp
Executable file → Normal file
0
include/boost/range/detail/empty.hpp
Executable file → Normal file
0
include/boost/range/detail/empty.hpp
Executable file → Normal file
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user