mirror of
https://github.com/boostorg/range.git
synced 2025-06-26 20:41:38 +02:00
Compare commits
1 Commits
svn-branch
...
svn-branch
Author | SHA1 | Date | |
---|---|---|---|
940b612e80 |
@ -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 <functional>
|
#include <functinoal>
|
||||||
#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/assign.hpp>
|
#include <boost/range/assign.hpp>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
@ -143,6 +143,10 @@ 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
Normal file → Executable file
0
include/boost/range/adaptor/argument_fwd.hpp
Normal file → Executable file
0
include/boost/range/adaptor/copied.hpp
Normal file → Executable file
0
include/boost/range/adaptor/copied.hpp
Normal file → Executable file
@ -44,6 +44,24 @@
|
|||||||
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
Normal file → Executable file
0
include/boost/range/adaptor/filtered.hpp
Normal file → Executable file
0
include/boost/range/adaptor/indexed.hpp
Normal file → Executable file
0
include/boost/range/adaptor/indexed.hpp
Normal file → Executable file
0
include/boost/range/adaptor/map.hpp
Normal file → Executable file
0
include/boost/range/adaptor/map.hpp
Normal file → Executable file
0
include/boost/range/adaptor/reversed.hpp
Normal file → Executable file
0
include/boost/range/adaptor/reversed.hpp
Normal file → Executable file
0
include/boost/range/adaptor/sliced.hpp
Normal file → Executable file
0
include/boost/range/adaptor/sliced.hpp
Normal file → Executable file
43
include/boost/range/adaptor/strided.hpp
Normal file → Executable file
43
include/boost/range/adaptor/strided.hpp
Normal file → Executable file
@ -176,7 +176,6 @@ namespace boost
|
|||||||
strided_iterator()
|
strided_iterator()
|
||||||
: m_first()
|
: m_first()
|
||||||
, m_last()
|
, m_last()
|
||||||
, m_index(0)
|
|
||||||
, m_stride()
|
, m_stride()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -185,7 +184,6 @@ 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)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -196,7 +194,6 @@ 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())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -204,37 +201,44 @@ 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()
|
||||||
{
|
{
|
||||||
m_index += m_stride;
|
base_iterator& it = this->base_reference();
|
||||||
if (m_index < (m_last - m_first))
|
if ((m_last - it) > m_stride)
|
||||||
this->base_reference() = m_first + m_index;
|
it += m_stride;
|
||||||
else
|
else
|
||||||
this->base_reference() = m_last;
|
it = m_last;
|
||||||
}
|
}
|
||||||
|
|
||||||
void decrement()
|
void decrement()
|
||||||
{
|
{
|
||||||
m_index -= m_stride;
|
base_iterator& it = this->base_reference();
|
||||||
if (m_index >= 0)
|
if ((it - m_first) > m_stride)
|
||||||
this->base_reference() = m_first + m_index;
|
it -= m_stride;
|
||||||
else
|
else
|
||||||
this->base_reference() = m_first;
|
it = m_first;
|
||||||
}
|
}
|
||||||
|
|
||||||
void advance(difference_type offset)
|
void advance(difference_type offset)
|
||||||
{
|
{
|
||||||
|
base_iterator& it = this->base_reference();
|
||||||
offset *= m_stride;
|
offset *= m_stride;
|
||||||
m_index += offset;
|
if (offset >= 0)
|
||||||
if (m_index < 0)
|
{
|
||||||
this->base_reference() = m_first;
|
if ((m_last - it) > offset)
|
||||||
else if (m_index > (m_last - m_first))
|
it += offset;
|
||||||
this->base_reference() = m_last;
|
else
|
||||||
|
it = m_last;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
this->base_reference() = m_first + m_index;
|
{
|
||||||
|
if ((m_first - it) > offset)
|
||||||
|
it += offset;
|
||||||
|
else
|
||||||
|
it = m_first;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class OtherIterator>
|
template<class OtherIterator>
|
||||||
@ -248,13 +252,12 @@ namespace boost
|
|||||||
|
|
||||||
bool equal(const strided_iterator& other) const
|
bool equal(const strided_iterator& other) const
|
||||||
{
|
{
|
||||||
return this->base() == other.base();
|
return other.base() == this->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
Normal file → Executable file
0
include/boost/range/adaptor/tokenized.hpp
Normal file → Executable file
4
include/boost/range/adaptor/transformed.hpp
Normal file → Executable file
4
include/boost/range/adaptor/transformed.hpp
Normal file → Executable 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( boost::make_transform_iterator( boost::begin(r), f ),
|
: base( make_transform_iterator( boost::begin(r), f ),
|
||||||
boost::make_transform_iterator( boost::end(r), f ) )
|
make_transform_iterator( boost::end(r), f ) )
|
||||||
|
|
||||||
{ }
|
{ }
|
||||||
};
|
};
|
||||||
|
0
include/boost/range/adaptor/uniqued.hpp
Normal file → Executable file
0
include/boost/range/adaptor/uniqued.hpp
Normal file → Executable file
0
include/boost/range/adaptors.hpp
Normal file → Executable file
0
include/boost/range/adaptors.hpp
Normal file → Executable file
0
include/boost/range/algorithm.hpp
Normal file → Executable file
0
include/boost/range/algorithm.hpp
Normal file → Executable file
0
include/boost/range/algorithm/adjacent_find.hpp
Normal file → Executable file
0
include/boost/range/algorithm/adjacent_find.hpp
Normal file → Executable file
0
include/boost/range/algorithm/binary_search.hpp
Normal file → Executable file
0
include/boost/range/algorithm/binary_search.hpp
Normal file → Executable file
0
include/boost/range/algorithm/copy_backward.hpp
Normal file → Executable file
0
include/boost/range/algorithm/copy_backward.hpp
Normal file → Executable file
0
include/boost/range/algorithm/count.hpp
Normal file → Executable file
0
include/boost/range/algorithm/count.hpp
Normal file → Executable file
0
include/boost/range/algorithm/count_if.hpp
Normal file → Executable file
0
include/boost/range/algorithm/count_if.hpp
Normal file → Executable file
0
include/boost/range/algorithm/equal.hpp
Normal file → Executable file
0
include/boost/range/algorithm/equal.hpp
Normal file → Executable file
0
include/boost/range/algorithm/equal_range.hpp
Normal file → Executable file
0
include/boost/range/algorithm/equal_range.hpp
Normal file → Executable file
0
include/boost/range/algorithm/fill.hpp
Normal file → Executable file
0
include/boost/range/algorithm/fill.hpp
Normal file → Executable file
0
include/boost/range/algorithm/fill_n.hpp
Normal file → Executable file
0
include/boost/range/algorithm/fill_n.hpp
Normal file → Executable file
0
include/boost/range/algorithm/find.hpp
Normal file → Executable file
0
include/boost/range/algorithm/find.hpp
Normal file → Executable file
0
include/boost/range/algorithm/find_end.hpp
Normal file → Executable file
0
include/boost/range/algorithm/find_end.hpp
Normal file → Executable file
0
include/boost/range/algorithm/find_first_of.hpp
Normal file → Executable file
0
include/boost/range/algorithm/find_first_of.hpp
Normal file → Executable file
0
include/boost/range/algorithm/find_if.hpp
Normal file → Executable file
0
include/boost/range/algorithm/find_if.hpp
Normal file → Executable file
66
include/boost/range/algorithm/for_each.hpp
Normal file → Executable file
66
include/boost/range/algorithm/for_each.hpp
Normal file → Executable file
@ -13,53 +13,13 @@
|
|||||||
#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 <boost/utility.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
|
||||||
@ -70,18 +30,7 @@ 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
|
||||||
@ -89,18 +38,7 @@ 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
Normal file → Executable file
0
include/boost/range/algorithm/generate.hpp
Normal file → Executable file
0
include/boost/range/algorithm/heap_algorithm.hpp
Normal file → Executable file
0
include/boost/range/algorithm/heap_algorithm.hpp
Normal file → Executable file
0
include/boost/range/algorithm/inplace_merge.hpp
Normal file → Executable file
0
include/boost/range/algorithm/inplace_merge.hpp
Normal file → Executable file
0
include/boost/range/algorithm/lexicographical_compare.hpp
Normal file → Executable file
0
include/boost/range/algorithm/lexicographical_compare.hpp
Normal file → Executable file
0
include/boost/range/algorithm/lower_bound.hpp
Normal file → Executable file
0
include/boost/range/algorithm/lower_bound.hpp
Normal file → Executable file
0
include/boost/range/algorithm/max_element.hpp
Normal file → Executable file
0
include/boost/range/algorithm/max_element.hpp
Normal file → Executable file
0
include/boost/range/algorithm/merge.hpp
Normal file → Executable file
0
include/boost/range/algorithm/merge.hpp
Normal file → Executable file
0
include/boost/range/algorithm/min_element.hpp
Normal file → Executable file
0
include/boost/range/algorithm/min_element.hpp
Normal file → Executable file
0
include/boost/range/algorithm/mismatch.hpp
Normal file → Executable file
0
include/boost/range/algorithm/mismatch.hpp
Normal file → Executable file
0
include/boost/range/algorithm/nth_element.hpp
Normal file → Executable file
0
include/boost/range/algorithm/nth_element.hpp
Normal file → Executable file
0
include/boost/range/algorithm/partial_sort.hpp
Normal file → Executable file
0
include/boost/range/algorithm/partial_sort.hpp
Normal file → Executable file
0
include/boost/range/algorithm/partial_sort_copy.hpp
Normal file → Executable file
0
include/boost/range/algorithm/partial_sort_copy.hpp
Normal file → Executable file
0
include/boost/range/algorithm/partition.hpp
Normal file → Executable file
0
include/boost/range/algorithm/partition.hpp
Normal file → Executable file
0
include/boost/range/algorithm/permutation.hpp
Normal file → Executable file
0
include/boost/range/algorithm/permutation.hpp
Normal file → Executable file
0
include/boost/range/algorithm/random_shuffle.hpp
Normal file → Executable file
0
include/boost/range/algorithm/random_shuffle.hpp
Normal file → Executable file
0
include/boost/range/algorithm/remove.hpp
Normal file → Executable file
0
include/boost/range/algorithm/remove.hpp
Normal file → Executable file
0
include/boost/range/algorithm/remove_copy.hpp
Normal file → Executable file
0
include/boost/range/algorithm/remove_copy.hpp
Normal file → Executable file
0
include/boost/range/algorithm/remove_copy_if.hpp
Normal file → Executable file
0
include/boost/range/algorithm/remove_copy_if.hpp
Normal file → Executable file
0
include/boost/range/algorithm/remove_if.hpp
Normal file → Executable file
0
include/boost/range/algorithm/remove_if.hpp
Normal file → Executable file
0
include/boost/range/algorithm/replace.hpp
Normal file → Executable file
0
include/boost/range/algorithm/replace.hpp
Normal file → Executable file
0
include/boost/range/algorithm/replace_copy.hpp
Normal file → Executable file
0
include/boost/range/algorithm/replace_copy.hpp
Normal file → Executable file
0
include/boost/range/algorithm/replace_copy_if.hpp
Normal file → Executable file
0
include/boost/range/algorithm/replace_copy_if.hpp
Normal file → Executable file
0
include/boost/range/algorithm/replace_if.hpp
Normal file → Executable file
0
include/boost/range/algorithm/replace_if.hpp
Normal file → Executable file
0
include/boost/range/algorithm/reverse.hpp
Normal file → Executable file
0
include/boost/range/algorithm/reverse.hpp
Normal file → Executable file
0
include/boost/range/algorithm/reverse_copy.hpp
Normal file → Executable file
0
include/boost/range/algorithm/reverse_copy.hpp
Normal file → Executable file
0
include/boost/range/algorithm/rotate.hpp
Normal file → Executable file
0
include/boost/range/algorithm/rotate.hpp
Normal file → Executable file
0
include/boost/range/algorithm/rotate_copy.hpp
Normal file → Executable file
0
include/boost/range/algorithm/rotate_copy.hpp
Normal file → Executable file
0
include/boost/range/algorithm/search.hpp
Normal file → Executable file
0
include/boost/range/algorithm/search.hpp
Normal file → Executable file
0
include/boost/range/algorithm/search_n.hpp
Normal file → Executable file
0
include/boost/range/algorithm/search_n.hpp
Normal file → Executable file
0
include/boost/range/algorithm/set_algorithm.hpp
Normal file → Executable file
0
include/boost/range/algorithm/set_algorithm.hpp
Normal file → Executable file
0
include/boost/range/algorithm/sort.hpp
Normal file → Executable file
0
include/boost/range/algorithm/sort.hpp
Normal file → Executable file
0
include/boost/range/algorithm/stable_partition.hpp
Normal file → Executable file
0
include/boost/range/algorithm/stable_partition.hpp
Normal file → Executable file
0
include/boost/range/algorithm/stable_sort.hpp
Normal file → Executable file
0
include/boost/range/algorithm/stable_sort.hpp
Normal file → Executable file
0
include/boost/range/algorithm/swap_ranges.hpp
Normal file → Executable file
0
include/boost/range/algorithm/swap_ranges.hpp
Normal file → Executable file
0
include/boost/range/algorithm/transform.hpp
Normal file → Executable file
0
include/boost/range/algorithm/transform.hpp
Normal file → Executable file
0
include/boost/range/algorithm/unique.hpp
Normal file → Executable file
0
include/boost/range/algorithm/unique.hpp
Normal file → Executable file
0
include/boost/range/algorithm/unique_copy.hpp
Normal file → Executable file
0
include/boost/range/algorithm/unique_copy.hpp
Normal file → Executable file
0
include/boost/range/algorithm/upper_bound.hpp
Normal file → Executable file
0
include/boost/range/algorithm/upper_bound.hpp
Normal file → Executable file
0
include/boost/range/algorithm_ext.hpp
Normal file → Executable file
0
include/boost/range/algorithm_ext.hpp
Normal file → Executable file
0
include/boost/range/algorithm_ext/copy_n.hpp
Normal file → Executable file
0
include/boost/range/algorithm_ext/copy_n.hpp
Normal file → Executable file
0
include/boost/range/algorithm_ext/erase.hpp
Normal file → Executable file
0
include/boost/range/algorithm_ext/erase.hpp
Normal file → Executable file
0
include/boost/range/algorithm_ext/for_each.hpp
Normal file → Executable file
0
include/boost/range/algorithm_ext/for_each.hpp
Normal file → Executable file
0
include/boost/range/algorithm_ext/insert.hpp
Normal file → Executable file
0
include/boost/range/algorithm_ext/insert.hpp
Normal file → Executable file
0
include/boost/range/algorithm_ext/is_sorted.hpp
Normal file → Executable file
0
include/boost/range/algorithm_ext/is_sorted.hpp
Normal file → Executable file
0
include/boost/range/algorithm_ext/overwrite.hpp
Normal file → Executable file
0
include/boost/range/algorithm_ext/overwrite.hpp
Normal file → Executable file
0
include/boost/range/algorithm_ext/push_back.hpp
Normal file → Executable file
0
include/boost/range/algorithm_ext/push_back.hpp
Normal file → Executable file
0
include/boost/range/algorithm_ext/push_front.hpp
Normal file → Executable file
0
include/boost/range/algorithm_ext/push_front.hpp
Normal file → Executable file
@ -15,7 +15,6 @@
|
|||||||
#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/combine.hpp
Normal file → Executable file
0
include/boost/range/combine.hpp
Normal file → Executable file
0
include/boost/range/counting_range.hpp
Normal file → Executable file
0
include/boost/range/counting_range.hpp
Normal file → Executable file
16
include/boost/range/detail/demote_iterator_traversal_tag.hpp
Normal file → Executable file
16
include/boost/range/detail/demote_iterator_traversal_tag.hpp
Normal file → Executable file
@ -5,9 +5,6 @@
|
|||||||
// 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/
|
||||||
//
|
//
|
||||||
@ -22,12 +19,12 @@ namespace boost
|
|||||||
{
|
{
|
||||||
|
|
||||||
template<class IteratorTraversalTag1, class IteratorTraversalTag2>
|
template<class IteratorTraversalTag1, class IteratorTraversalTag2>
|
||||||
struct inner_demote_iterator_traversal_tag
|
struct demote_iterator_traversal_tag
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
#define BOOST_DEMOTE_TRAVERSAL_TAG( Tag1, Tag2, ResultTag ) \
|
#define BOOST_DEMOTE_TRAVERSAL_TAG( Tag1, Tag2, ResultTag ) \
|
||||||
template<> struct inner_demote_iterator_traversal_tag< Tag1 , Tag2 > \
|
template<> struct demote_iterator_traversal_tag< Tag1 , Tag2 > \
|
||||||
{ \
|
{ \
|
||||||
typedef ResultTag type; \
|
typedef ResultTag type; \
|
||||||
};
|
};
|
||||||
@ -76,15 +73,6 @@ 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
|
||||||
|
|
||||||
|
@ -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.hpp>
|
#include <boost/range/detail/size_type>
|
||||||
#include <boost/range/detail/value_type.hpp>
|
#include <boost/range/detail/value_type>
|
||||||
#include <boost/range/detail/common.hpp>
|
#include <boost/range/detail/common.hpp>
|
||||||
|
|
||||||
namespace boost
|
namespace boost
|
||||||
|
0
include/boost/range/detail/extract_optional_type.hpp
Normal file → Executable file
0
include/boost/range/detail/extract_optional_type.hpp
Normal file → Executable file
@ -5,9 +5,6 @@
|
|||||||
// 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 contributed an improvement to the determination
|
|
||||||
// of the Reference type parameter.
|
|
||||||
//
|
//
|
||||||
// For more information, see http://www.boost.org/libs/range/
|
// For more information, see http://www.boost.org/libs/range/
|
||||||
//
|
//
|
||||||
@ -123,32 +120,7 @@ private:
|
|||||||
template<typename Iterator1
|
template<typename Iterator1
|
||||||
, typename Iterator2
|
, typename Iterator2
|
||||||
, typename ValueType = typename iterator_value<Iterator1>::type
|
, typename ValueType = typename iterator_value<Iterator1>::type
|
||||||
// find least demanding, commonly supported reference type, in the order &, const&, and by-value:
|
, typename Reference = typename iterator_reference<Iterator1>::type
|
||||||
, typename Reference = typename mpl::if_c<
|
|
||||||
!is_reference<typename iterator_reference<Iterator1>::type>::value
|
|
||||||
|| !is_reference<typename iterator_reference<Iterator2>::type>::value,
|
|
||||||
typename remove_const<
|
|
||||||
typename remove_reference<
|
|
||||||
typename iterator_reference<Iterator1>::type
|
|
||||||
>::type
|
|
||||||
>::type,
|
|
||||||
typename mpl::if_c<
|
|
||||||
is_const<
|
|
||||||
typename remove_reference<
|
|
||||||
typename iterator_reference<Iterator1>::type
|
|
||||||
>::type
|
|
||||||
>::value
|
|
||||||
|| is_const<
|
|
||||||
typename remove_reference<
|
|
||||||
typename iterator_reference<Iterator2>::type
|
|
||||||
>::type
|
|
||||||
>::value,
|
|
||||||
typename add_const<
|
|
||||||
typename iterator_reference<Iterator2>::type
|
|
||||||
>::type,
|
|
||||||
typename iterator_reference<Iterator1>::type
|
|
||||||
>::type
|
|
||||||
>::type
|
|
||||||
, typename Traversal = typename demote_iterator_traversal_tag<
|
, typename Traversal = typename demote_iterator_traversal_tag<
|
||||||
typename iterator_traversal<Iterator1>::type
|
typename iterator_traversal<Iterator1>::type
|
||||||
, typename iterator_traversal<Iterator2>::type>::type
|
, typename iterator_traversal<Iterator2>::type>::type
|
||||||
|
0
include/boost/range/detail/misc_concept.hpp
Normal file → Executable file
0
include/boost/range/detail/misc_concept.hpp
Normal file → Executable file
0
include/boost/range/detail/range_return.hpp
Normal file → Executable file
0
include/boost/range/detail/range_return.hpp
Normal file → Executable file
@ -19,7 +19,7 @@ namespace boost
|
|||||||
{
|
{
|
||||||
namespace range_detail
|
namespace range_detail
|
||||||
{
|
{
|
||||||
BOOST_MPL_HAS_XXX_TRAIT_DEF(type)
|
BOOST_MPL_HAS_XXX_TRAIT_DEF(type);
|
||||||
|
|
||||||
template<class T, class Enabler = void>
|
template<class T, class Enabler = void>
|
||||||
struct has_range_iterator_impl
|
struct has_range_iterator_impl
|
||||||
|
@ -124,11 +124,13 @@ namespace boost
|
|||||||
typedef typename base_t::difference_type difference_type;
|
typedef typename base_t::difference_type difference_type;
|
||||||
typedef typename base_t::reference reference;
|
typedef typename base_t::reference reference;
|
||||||
|
|
||||||
integer_iterator_with_step(value_type first, difference_type step, value_type step_size)
|
integer_iterator_with_step(value_type first, value_type step, difference_type step_size)
|
||||||
: m_first(first)
|
: m_first(first)
|
||||||
, m_step(step)
|
, m_step(step)
|
||||||
, m_step_size(step_size)
|
, m_step_size(step_size)
|
||||||
{
|
{
|
||||||
|
BOOST_ASSERT( step >= 0 );
|
||||||
|
BOOST_ASSERT( step_size != 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -211,18 +213,16 @@ namespace boost
|
|||||||
{
|
{
|
||||||
BOOST_ASSERT( step_size != 0 );
|
BOOST_ASSERT( step_size != 0 );
|
||||||
BOOST_ASSERT( (step_size > 0) ? (last >= first) : (last <= first) );
|
BOOST_ASSERT( (step_size > 0) ? (last >= first) : (last <= first) );
|
||||||
|
|
||||||
typedef typename range_detail::integer_iterator_with_step<Integer> iterator_t;
|
typedef typename range_detail::integer_iterator_with_step<Integer> iterator_t;
|
||||||
|
|
||||||
const std::ptrdiff_t sz = static_cast<std::ptrdiff_t>(step_size >= 0 ? step_size : -step_size);
|
const std::ptrdiff_t last_step
|
||||||
const Integer l = step_size >= 0 ? last : first;
|
= (static_cast<std::ptrdiff_t>(last) - static_cast<std::ptrdiff_t>(first))
|
||||||
const Integer f = step_size >= 0 ? first : last;
|
/ (static_cast<std::ptrdiff_t>(step_size));
|
||||||
const std::ptrdiff_t num_steps = (l + ((l-f) % sz) - f) / sz;
|
|
||||||
BOOST_ASSERT(num_steps >= 0);
|
|
||||||
|
|
||||||
return strided_integer_range<Integer>(
|
return strided_integer_range<Integer>(
|
||||||
iterator_t(first, 0, step_size),
|
iterator_t(first, 0, step_size),
|
||||||
iterator_t(first, num_steps, step_size));
|
iterator_t(first, last_step, step_size));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace boost
|
} // namespace boost
|
||||||
|
0
include/boost/range/istream_range.hpp
Normal file → Executable file
0
include/boost/range/istream_range.hpp
Normal file → Executable file
102
include/boost/range/iterator_range_core.hpp
Normal file → Executable file
102
include/boost/range/iterator_range_core.hpp
Normal file → Executable file
@ -53,13 +53,13 @@ namespace boost
|
|||||||
template< class ForwardRange >
|
template< class ForwardRange >
|
||||||
static IteratorT adl_begin( ForwardRange& r )
|
static IteratorT adl_begin( ForwardRange& r )
|
||||||
{
|
{
|
||||||
return static_cast<IteratorT>( boost::begin( r ) );
|
return IteratorT( boost::begin( r ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
template< class ForwardRange >
|
template< class ForwardRange >
|
||||||
static IteratorT adl_end( ForwardRange& r )
|
static IteratorT adl_end( ForwardRange& r )
|
||||||
{
|
{
|
||||||
return static_cast<IteratorT>( boost::end( r ) );
|
return IteratorT( boost::end( r ) );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -71,24 +71,6 @@ namespace boost
|
|||||||
boost::begin(r),
|
boost::begin(r),
|
||||||
boost::end(r) );
|
boost::end(r) );
|
||||||
}
|
}
|
||||||
|
|
||||||
template< class Left, class Right >
|
|
||||||
inline bool greater_than( const Left& l, const Right& r )
|
|
||||||
{
|
|
||||||
return less_than(r,l);
|
|
||||||
}
|
|
||||||
|
|
||||||
template< class Left, class Right >
|
|
||||||
inline bool less_or_equal_than( const Left& l, const Right& r )
|
|
||||||
{
|
|
||||||
return !iterator_range_detail::less_than(r,l);
|
|
||||||
}
|
|
||||||
|
|
||||||
template< class Left, class Right >
|
|
||||||
inline bool greater_or_equal_than( const Left& l, const Right& r )
|
|
||||||
{
|
|
||||||
return !iterator_range_detail::less_than(l,r);
|
|
||||||
}
|
|
||||||
|
|
||||||
// This version is maintained since it is used in other boost libraries
|
// This version is maintained since it is used in other boost libraries
|
||||||
// such as Boost.Assign
|
// such as Boost.Assign
|
||||||
@ -249,7 +231,7 @@ namespace boost
|
|||||||
|
|
||||||
difference_type size() const
|
difference_type size() const
|
||||||
{
|
{
|
||||||
return m_End - m_Begin;
|
return m_End - m_Begin;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool empty() const
|
bool empty() const
|
||||||
@ -289,21 +271,6 @@ namespace boost
|
|||||||
{
|
{
|
||||||
return iterator_range_detail::less_than( *this, r );
|
return iterator_range_detail::less_than( *this, r );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator>( const iterator_range& r ) const
|
|
||||||
{
|
|
||||||
return iterator_range_detail::greater_than( *this, r );
|
|
||||||
}
|
|
||||||
|
|
||||||
bool operator<=( const iterator_range& r ) const
|
|
||||||
{
|
|
||||||
return iterator_range_detail::less_or_equal_than( *this, r );
|
|
||||||
}
|
|
||||||
|
|
||||||
bool operator>=( const iterator_range& r ) const
|
|
||||||
{
|
|
||||||
return iterator_range_detail::greater_or_equal_than( *this, r );
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -403,27 +370,6 @@ namespace boost
|
|||||||
{
|
{
|
||||||
return iterator_range_detail::less_than( l, r );
|
return iterator_range_detail::less_than( l, r );
|
||||||
}
|
}
|
||||||
|
|
||||||
template< class IteratorT, class ForwardRange >
|
|
||||||
inline bool operator<=( const ForwardRange& l,
|
|
||||||
const iterator_range<IteratorT>& r )
|
|
||||||
{
|
|
||||||
return iterator_range_detail::less_or_equal_than( l, r );
|
|
||||||
}
|
|
||||||
|
|
||||||
template< class IteratorT, class ForwardRange >
|
|
||||||
inline bool operator>( const ForwardRange& l,
|
|
||||||
const iterator_range<IteratorT>& r )
|
|
||||||
{
|
|
||||||
return iterator_range_detail::greater_than( l, r );
|
|
||||||
}
|
|
||||||
|
|
||||||
template< class IteratorT, class ForwardRange >
|
|
||||||
inline bool operator>=( const ForwardRange& l,
|
|
||||||
const iterator_range<IteratorT>& r )
|
|
||||||
{
|
|
||||||
return iterator_range_detail::greater_or_equal_than( l, r );
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
|
#ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
|
||||||
#else
|
#else
|
||||||
@ -470,48 +416,6 @@ namespace boost
|
|||||||
{
|
{
|
||||||
return iterator_range_detail::less_than( l, r );
|
return iterator_range_detail::less_than( l, r );
|
||||||
}
|
}
|
||||||
|
|
||||||
template< class Iterator1T, class Iterator2T >
|
|
||||||
inline bool operator<=( const iterator_range<Iterator1T>& l,
|
|
||||||
const iterator_range<Iterator2T>& r )
|
|
||||||
{
|
|
||||||
return iterator_range_detail::less_or_equal_than( l, r );
|
|
||||||
}
|
|
||||||
|
|
||||||
template< class IteratorT, class ForwardRange >
|
|
||||||
inline bool operator<=( const iterator_range<IteratorT>& l,
|
|
||||||
const ForwardRange& r )
|
|
||||||
{
|
|
||||||
return iterator_range_detail::less_or_equal_than( l, r );
|
|
||||||
}
|
|
||||||
|
|
||||||
template< class Iterator1T, class Iterator2T >
|
|
||||||
inline bool operator>( const iterator_range<Iterator1T>& l,
|
|
||||||
const iterator_range<Iterator2T>& r )
|
|
||||||
{
|
|
||||||
return iterator_range_detail::greater_than( l, r );
|
|
||||||
}
|
|
||||||
|
|
||||||
template< class IteratorT, class ForwardRange >
|
|
||||||
inline bool operator>( const iterator_range<IteratorT>& l,
|
|
||||||
const ForwardRange& r )
|
|
||||||
{
|
|
||||||
return iterator_range_detail::greater_than( l, r );
|
|
||||||
}
|
|
||||||
|
|
||||||
template< class Iterator1T, class Iterator2T >
|
|
||||||
inline bool operator>=( const iterator_range<Iterator1T>& l,
|
|
||||||
const iterator_range<Iterator2T>& r )
|
|
||||||
{
|
|
||||||
return iterator_range_detail::greater_or_equal_than( l, r );
|
|
||||||
}
|
|
||||||
|
|
||||||
template< class IteratorT, class ForwardRange >
|
|
||||||
inline bool operator>=( const iterator_range<IteratorT>& l,
|
|
||||||
const ForwardRange& r )
|
|
||||||
{
|
|
||||||
return iterator_range_detail::greater_or_equal_than( l, r );
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // BOOST_NO_FUNCTION_TEMPLATE_ORDERING
|
#endif // BOOST_NO_FUNCTION_TEMPLATE_ORDERING
|
||||||
|
|
||||||
|
0
include/boost/range/iterator_range_io.hpp
Normal file → Executable file
0
include/boost/range/iterator_range_io.hpp
Normal file → Executable file
@ -36,9 +36,6 @@ public:
|
|||||||
|
|
||||||
} // namespace range_detail
|
} // namespace range_detail
|
||||||
|
|
||||||
namespace range
|
|
||||||
{
|
|
||||||
|
|
||||||
template<class SinglePassRange1, class SinglePassRange2>
|
template<class SinglePassRange1, class SinglePassRange2>
|
||||||
class joined_range
|
class joined_range
|
||||||
: public range_detail::joined_type<SinglePassRange1, SinglePassRange2>::type
|
: public range_detail::joined_type<SinglePassRange1, SinglePassRange2>::type
|
||||||
@ -81,11 +78,6 @@ join(SinglePassRange1& r1, SinglePassRange2& r2)
|
|||||||
return joined_range<SinglePassRange1, SinglePassRange2>(r1, r2);
|
return joined_range<SinglePassRange1, SinglePassRange2>(r1, r2);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace range
|
|
||||||
|
|
||||||
using ::boost::range::joined_range;
|
|
||||||
using ::boost::range::join;
|
|
||||||
|
|
||||||
} // namespace boost
|
} // namespace boost
|
||||||
|
|
||||||
#endif // include guard
|
#endif // include guard
|
||||||
|
0
include/boost/range/numeric.hpp
Normal file → Executable file
0
include/boost/range/numeric.hpp
Normal file → Executable file
@ -12,13 +12,12 @@
|
|||||||
#ifndef BOOST_RANGE_SUB_RANGE_HPP
|
#ifndef BOOST_RANGE_SUB_RANGE_HPP
|
||||||
#define BOOST_RANGE_SUB_RANGE_HPP
|
#define BOOST_RANGE_SUB_RANGE_HPP
|
||||||
|
|
||||||
#include <boost/detail/workaround.hpp>
|
|
||||||
|
|
||||||
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1500))
|
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1500))
|
||||||
#pragma warning( push )
|
#pragma warning( push )
|
||||||
#pragma warning( disable : 4996 )
|
#pragma warning( disable : 4996 )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <boost/detail/workaround.hpp>
|
||||||
#include <boost/range/config.hpp>
|
#include <boost/range/config.hpp>
|
||||||
#include <boost/range/iterator_range.hpp>
|
#include <boost/range/iterator_range.hpp>
|
||||||
#include <boost/range/value_type.hpp>
|
#include <boost/range/value_type.hpp>
|
||||||
|
@ -31,22 +31,6 @@ rule range-test ( name : includes * )
|
|||||||
}
|
}
|
||||||
|
|
||||||
test-suite range :
|
test-suite range :
|
||||||
[ compile ../doc/reference/adaptors/examples/adjacent_filtered.cpp : : example_adjacent_filtered ]
|
|
||||||
[ compile ../doc/reference/adaptors/examples/copied.cpp : : example_copied ]
|
|
||||||
[ compile ../doc/reference/adaptors/examples/filtered.cpp : : example_filtered ]
|
|
||||||
[ compile ../doc/reference/adaptors/examples/indexed.cpp : : example_indexed ]
|
|
||||||
[ compile ../doc/reference/adaptors/examples/indirected.cpp : : example_indirected ]
|
|
||||||
[ compile ../doc/reference/adaptors/examples/map_keys.cpp : : example_map_keys ]
|
|
||||||
[ compile ../doc/reference/adaptors/examples/map_values.cpp : : example_map_values ]
|
|
||||||
[ compile ../doc/reference/adaptors/examples/replaced.cpp : : example_replaced ]
|
|
||||||
[ compile ../doc/reference/adaptors/examples/replaced_if.cpp : : example_replaced_if ]
|
|
||||||
[ compile ../doc/reference/adaptors/examples/reversed.cpp : : example_reversed ]
|
|
||||||
[ compile ../doc/reference/adaptors/examples/sliced.cpp : : example_sliced ]
|
|
||||||
[ compile ../doc/reference/adaptors/examples/strided.cpp : : example_strided ]
|
|
||||||
[ compile ../doc/reference/adaptors/examples/tokenized.cpp : : example_tokenized ]
|
|
||||||
[ compile ../doc/reference/adaptors/examples/transformed.cpp : : example_transformed ]
|
|
||||||
[ compile ../doc/reference/adaptors/examples/uniqued.cpp : : example_uniqued ]
|
|
||||||
[ compile-fail compile_fail/iterator_range1.cpp ]
|
|
||||||
[ range-test adaptor_test/adjacent_filtered ]
|
[ range-test adaptor_test/adjacent_filtered ]
|
||||||
[ range-test adaptor_test/copied ]
|
[ range-test adaptor_test/copied ]
|
||||||
[ range-test adaptor_test/filtered ]
|
[ range-test adaptor_test/filtered ]
|
||||||
@ -171,9 +155,5 @@ test-suite range :
|
|||||||
[ range-test std_container ]
|
[ range-test std_container ]
|
||||||
[ range-test string ]
|
[ range-test string ]
|
||||||
[ range-test sub_range ]
|
[ range-test sub_range ]
|
||||||
[ range-test ticket_5486 ]
|
|
||||||
[ range-test ticket_5544_terminate_irange ]
|
|
||||||
[ range-test ticket_5547 ]
|
|
||||||
[ range-test ticket_5556_is_sorted_namespace ]
|
|
||||||
;
|
;
|
||||||
|
|
||||||
|
@ -250,38 +250,6 @@ namespace boost
|
|||||||
BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(),
|
BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(),
|
||||||
output.begin(), output.end() );
|
output.begin(), output.end() );
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Range>
|
|
||||||
void strided_test_ticket_5236_check_bidirectional(const Range& rng)
|
|
||||||
{
|
|
||||||
BOOST_CHECK_EQUAL( boost::distance(rng), 1 );
|
|
||||||
BOOST_CHECK_EQUAL( std::distance(boost::begin(rng), boost::prior(boost::end(rng))), 0 );
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename Range>
|
|
||||||
void strided_test_ticket_5236_check(const Range& rng)
|
|
||||||
{
|
|
||||||
strided_test_ticket_5236_check_bidirectional(rng);
|
|
||||||
|
|
||||||
typename boost::range_iterator<const Range>::type it = boost::end(rng);
|
|
||||||
it = it - 1;
|
|
||||||
BOOST_CHECK_EQUAL( std::distance(boost::begin(rng), it), 0 );
|
|
||||||
}
|
|
||||||
|
|
||||||
void strided_test_ticket_5236()
|
|
||||||
{
|
|
||||||
std::vector<int> v;
|
|
||||||
v.push_back(1);
|
|
||||||
strided_test_ticket_5236_check( v | boost::adaptors::strided(2) );
|
|
||||||
|
|
||||||
// Ensure that there is consistency between the random-access implementation
|
|
||||||
// and the bidirectional.
|
|
||||||
|
|
||||||
std::list<int> l;
|
|
||||||
l.push_back(1);
|
|
||||||
strided_test_ticket_5236_check_bidirectional( l | boost::adaptors::strided(2) );
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -294,7 +262,6 @@ init_unit_test_suite(int argc, char* argv[])
|
|||||||
test->add( BOOST_TEST_CASE( &boost::strided_test ) );
|
test->add( BOOST_TEST_CASE( &boost::strided_test ) );
|
||||||
test->add( BOOST_TEST_CASE( &boost::strided_defect_Trac5014 ) );
|
test->add( BOOST_TEST_CASE( &boost::strided_defect_Trac5014 ) );
|
||||||
test->add( BOOST_TEST_CASE( &boost::strided_test_traversal ) );
|
test->add( BOOST_TEST_CASE( &boost::strided_test_traversal ) );
|
||||||
test->add( BOOST_TEST_CASE( &boost::strided_test_ticket_5236 ) );
|
|
||||||
|
|
||||||
return test;
|
return test;
|
||||||
}
|
}
|
||||||
|
@ -172,9 +172,9 @@ void check_adl_conformance()
|
|||||||
BOOST_CHECK_EQUAL( boost_test::begin( r6 ), global_namespace );
|
BOOST_CHECK_EQUAL( boost_test::begin( r6 ), global_namespace );
|
||||||
}
|
}
|
||||||
|
|
||||||
#include <boost/test/included/unit_test.hpp>
|
#include <boost/test/included/unit_test_framework.hpp>
|
||||||
|
|
||||||
using boost::unit_test::test_suite;
|
using boost::unit_test_framework::test_suite;
|
||||||
|
|
||||||
test_suite* init_unit_test_suite( int argc, char* argv[] )
|
test_suite* init_unit_test_suite( int argc, char* argv[] )
|
||||||
{
|
{
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
#include <boost/range/begin.hpp>
|
#include <boost/range/begin.hpp>
|
||||||
#include <boost/test/unit_test.hpp>
|
#include <boost/test/unit_test.hpp>
|
||||||
#include <boost/test/test_tools.hpp>
|
#include <boost/test/test_tools.hpp>
|
||||||
#include <boost/test/included/unit_test.hpp>
|
#include <boost/test/included/unit_test_framework.hpp>
|
||||||
|
|
||||||
namespace mock_std
|
namespace mock_std
|
||||||
{
|
{
|
||||||
@ -104,12 +104,12 @@ namespace
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
using boost::unit_test::test_suite;
|
using boost::unit_test_framework::test_suite;
|
||||||
|
|
||||||
boost::unit_test::test_suite*
|
boost::unit_test_framework::test_suite*
|
||||||
init_unit_test_suite( int argc, char* argv[] )
|
init_unit_test_suite( int argc, char* argv[] )
|
||||||
{
|
{
|
||||||
boost::unit_test::test_suite* test = BOOST_TEST_SUITE( "Range Test Suite - begin() ADL namespace barrier" );
|
boost::unit_test_framework::test_suite* test = BOOST_TEST_SUITE( "Range Test Suite - begin() ADL namespace barrier" );
|
||||||
|
|
||||||
test->add( BOOST_TEST_CASE( &test_range_begin ) );
|
test->add( BOOST_TEST_CASE( &test_range_begin ) );
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user