Compare commits

...

23 Commits

Author SHA1 Message Date
782e67f4ac Create branches/filesystem-v3 for v2 removal
[SVN r77385]
2012-03-18 20:54:17 +00:00
1cb6a99c80 eliminated unit_test_framework
[SVN r74719]
2011-10-05 09:13:05 +00:00
c4bd4bf4ce Remove tabs.
[SVN r72190]
2011-05-26 18:23:57 +00:00
41b76f8f5c [boost][range] - Ticket 5236 - Improved test coverage to ensure that the result for a random access strided range is consistent with that of a bidirectional strided range.
[SVN r72108]
2011-05-22 22:15:14 +00:00
846f11a96c [boost][range] - Ticket 5236 - Strided reversing past begin issue resolved.
[SVN r72107]
2011-05-22 22:06:30 +00:00
8810c4c4aa [boost][range] - Ticket 5547 - Boost.Range join() ambiguous with Boost.Algorithm join() function. Put the Boost.Range join function into the boost::range namespace and brought out with 'using'
[SVN r72106]
2011-05-22 21:19:53 +00:00
91428c2110 [boost][range] - Ticket 5530 - adaptor example fails to compile. This change adds tests for all of the .cpp example files for the range adaptors, and fixes a few small issues with the examples shown by the new tests.
[SVN r72104]
2011-05-22 21:03:01 +00:00
44c26a3356 [boost][range] - Ticket 5486 - Removal of unnecessary variables from adjacent_filtered_range. This removes the requirement for the predicate to be default constructible.
[SVN r72102]
2011-05-22 20:33:06 +00:00
b06fca8378 [boost][range] - Ticket 5556 - is_sorted namespace issue under GCC 4.5
[SVN r72101]
2011-05-22 20:20:20 +00:00
3b3889b70f [boost][range] - Ticket 5485 - doubly defined BOOST_DEFINE_RANGE_ADAPTOR_1 macro.
[SVN r72098]
2011-05-22 20:01:12 +00:00
5ed6116490 [boost][range] - ticket 5544 - fix for termination of irange - done properly for negative step sizes.
[SVN r72097]
2011-05-22 19:59:59 +00:00
df1a3a334f [boost][range] - ticket 5544 - fix for termination of irange.
[SVN r72070]
2011-05-22 11:16:53 +00:00
126e6861d7 [boost][range] - Resolved Trace 5162 - boost::iterator_range<T*> is unsafe.
[SVN r70852]
2011-04-02 13:05:26 +00:00
d490a84c8d [boost][range] - Improved the work-around for VC10 for_each implementation. Corrected a missing newline at the end of the file.
[SVN r70850]
2011-04-02 10:14:51 +00:00
10af4fc1e0 [boost][range] - Improve the forwarding of the functor, and provide a work-around for the breaking changes in VC10 for_each.
[SVN r70690]
2011-03-29 10:27:00 +00:00
f8bb8aafbf [range] - Improved default Reference type deduction for the join_iterator as implemented by aschoedl in Trac issue 5061.
[SVN r70041]
2011-03-16 23:55:25 +00:00
c6a6a46db4 [range] - Fix for the demotion of traversal tags supplied by aschoedl. This is mentioned in Trac issue 5061, but has also been reported independently by a few users.
[SVN r70040]
2011-03-16 23:47:02 +00:00
cc8a1413cb [range] - Qualify the lookup of the make_transform_iterator function to protect against ADL. This was reported as part of Trac issue 5061.
[SVN r70039]
2011-03-16 23:41:12 +00:00
1131136d4a [range] - Fix for Trac issue 5313 - Typos in boost/range/detail/detail_str.hpp
[SVN r70038]
2011-03-16 23:37:03 +00:00
3cd6a7277f [range] Added <=, ==, >, >=, != operators to iterator_range
[SVN r70037]
2011-03-16 23:33:57 +00:00
19a2090ef8 [range] - Fix for Trac issue 5295 - boost/range/sub_range.hpp cannot be included by itself
[SVN r70036]
2011-03-16 23:31:59 +00:00
67f457ade1 [range] Fix for Trac issue 5179 - Extra ";" in boost range file
[SVN r70035]
2011-03-16 23:29:29 +00:00
7315e2c14e [range] resolved trac issue 5295 - sub_range.hpp was missing an include of concepts.hpp
[SVN r70034]
2011-03-16 23:20:12 +00:00
150 changed files with 692 additions and 104 deletions

View File

@ -11,7 +11,7 @@
#include <boost/range/algorithm/copy.hpp>
#include <boost/assign.hpp>
#include <algorithm>
#include <functinoal>
#include <functional>
#include <iostream>
#include <vector>

View File

@ -41,5 +41,5 @@ int main(int argc, const char* argv[])
display_element_and_index( input | indexed(0) );
return 0;
]
}

View File

@ -9,7 +9,7 @@
//
#include <boost/range/adaptor/transformed.hpp>
#include <boost/range/algorithm/copy.hpp>
#include <boost/range/assign.hpp>
#include <boost/assign.hpp>
#include <algorithm>
#include <iostream>
#include <vector>

View File

@ -143,10 +143,6 @@ namespace boost
skip_iter(boost::end(r), boost::end(r), p))
{
}
private:
P m_pred;
R* m_range;
};
template< class T >

0
include/boost/range/adaptor/argument_fwd.hpp Executable file → Normal file
View File

0
include/boost/range/adaptor/copied.hpp Executable file → Normal file
View File

View File

@ -44,24 +44,6 @@
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 ) \
struct adaptor_name \
{ \

0
include/boost/range/adaptor/filtered.hpp Executable file → Normal file
View File

0
include/boost/range/adaptor/indexed.hpp Executable file → Normal file
View File

0
include/boost/range/adaptor/map.hpp Executable file → Normal file
View File

0
include/boost/range/adaptor/reversed.hpp Executable file → Normal file
View File

0
include/boost/range/adaptor/sliced.hpp Executable file → Normal file
View File

43
include/boost/range/adaptor/strided.hpp Executable file → Normal file
View File

@ -176,6 +176,7 @@ namespace boost
strided_iterator()
: m_first()
, m_last()
, m_index(0)
, m_stride()
{
}
@ -184,6 +185,7 @@ namespace boost
: super_t(it)
, m_first(first)
, m_last(last)
, m_index(stride ? (it - first) / stride : 0)
, m_stride(stride)
{
}
@ -194,6 +196,7 @@ namespace boost
: super_t(other.base())
, m_first(other.base_begin())
, m_last(other.base_end())
, m_index(other.get_index())
, m_stride(other.get_stride())
{
}
@ -201,44 +204,37 @@ namespace boost
base_iterator base_begin() const { return m_first; }
base_iterator base_end() const { return m_last; }
difference_type get_stride() const { return m_stride; }
difference_type get_index() const { return m_index; }
private:
void increment()
{
base_iterator& it = this->base_reference();
if ((m_last - it) > m_stride)
it += m_stride;
m_index += m_stride;
if (m_index < (m_last - m_first))
this->base_reference() = m_first + m_index;
else
it = m_last;
this->base_reference() = m_last;
}
void decrement()
{
base_iterator& it = this->base_reference();
if ((it - m_first) > m_stride)
it -= m_stride;
m_index -= m_stride;
if (m_index >= 0)
this->base_reference() = m_first + m_index;
else
it = m_first;
this->base_reference() = m_first;
}
void advance(difference_type offset)
{
base_iterator& it = this->base_reference();
offset *= m_stride;
if (offset >= 0)
{
if ((m_last - it) > offset)
it += offset;
m_index += offset;
if (m_index < 0)
this->base_reference() = m_first;
else if (m_index > (m_last - m_first))
this->base_reference() = m_last;
else
it = m_last;
}
else
{
if ((m_first - it) > offset)
it += offset;
else
it = m_first;
}
this->base_reference() = m_first + m_index;
}
template<class OtherIterator>
@ -252,12 +248,13 @@ namespace boost
bool equal(const strided_iterator& other) const
{
return other.base() == this->base();
return this->base() == other.base();
}
private:
base_iterator m_first;
base_iterator m_last;
difference_type m_index;
difference_type m_stride;
};

0
include/boost/range/adaptor/tokenized.hpp Executable file → Normal file
View File

4
include/boost/range/adaptor/transformed.hpp Executable file → Normal file
View File

@ -42,8 +42,8 @@ namespace boost
typedef R source_range_type;
transformed_range( F f, R& r )
: base( make_transform_iterator( boost::begin(r), f ),
make_transform_iterator( boost::end(r), f ) )
: base( boost::make_transform_iterator( boost::begin(r), f ),
boost::make_transform_iterator( boost::end(r), f ) )
{ }
};

0
include/boost/range/adaptor/uniqued.hpp Executable file → Normal file
View File

0
include/boost/range/adaptors.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm/adjacent_find.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm/binary_search.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm/copy_backward.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm/count.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm/count_if.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm/equal.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm/equal_range.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm/fill.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm/fill_n.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm/find.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm/find_end.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm/find_first_of.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm/find_if.hpp Executable file → Normal file
View File

66
include/boost/range/algorithm/for_each.hpp Executable file → Normal file
View File

@ -13,13 +13,53 @@
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
#include <boost/range/concepts.hpp>
#include <boost/ref.hpp>
#include <boost/utility.hpp>
#include <algorithm>
#if BOOST_WORKAROUND(BOOST_MSVC, == 1600)
#include <xutility>
#endif
namespace boost
{
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
///
/// range-based version of the for_each std algorithm
@ -30,7 +70,18 @@ template< class SinglePassRange, class UnaryFunction >
inline UnaryFunction for_each(SinglePassRange & rng, UnaryFunction fun)
{
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
@ -38,7 +89,18 @@ template< class SinglePassRange, class UnaryFunction >
inline UnaryFunction for_each(const SinglePassRange& rng, UnaryFunction fun)
{
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

0
include/boost/range/algorithm/generate.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm/heap_algorithm.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm/inplace_merge.hpp Executable file → Normal file
View File

View File

0
include/boost/range/algorithm/lower_bound.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm/max_element.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm/merge.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm/min_element.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm/mismatch.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm/nth_element.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm/partial_sort.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm/partial_sort_copy.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm/partition.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm/permutation.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm/random_shuffle.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm/remove.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm/remove_copy.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm/remove_copy_if.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm/remove_if.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm/replace.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm/replace_copy.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm/replace_copy_if.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm/replace_if.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm/reverse.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm/reverse_copy.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm/rotate.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm/rotate_copy.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm/search.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm/search_n.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm/set_algorithm.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm/sort.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm/stable_partition.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm/stable_sort.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm/swap_ranges.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm/transform.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm/unique.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm/unique_copy.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm/upper_bound.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm_ext.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm_ext/copy_n.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm_ext/erase.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm_ext/for_each.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm_ext/insert.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm_ext/is_sorted.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm_ext/overwrite.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm_ext/push_back.hpp Executable file → Normal file
View File

0
include/boost/range/algorithm_ext/push_front.hpp Executable file → Normal file
View File

View File

@ -15,6 +15,7 @@
#include <boost/iterator/iterator_facade.hpp>
#include <boost/iterator/iterator_adaptor.hpp>
#include <boost/range/detail/any_iterator.hpp>
#include <boost/range/concepts.hpp>
#include <boost/range/reference.hpp>
#include <boost/range/value_type.hpp>
#include <boost/range/iterator_range_core.hpp>

0
include/boost/range/as_array.hpp Executable file → Normal file
View File

0
include/boost/range/category.hpp Executable file → Normal file
View File

0
include/boost/range/combine.hpp Executable file → Normal file
View File

0
include/boost/range/config.hpp Executable file → Normal file
View File

0
include/boost/range/const_reverse_iterator.hpp Executable file → Normal file
View File

0
include/boost/range/counting_range.hpp Executable file → Normal file
View File

0
include/boost/range/detail/collection_traits.hpp Executable file → Normal file
View File

View File

0
include/boost/range/detail/common.hpp Executable file → Normal file
View File

0
include/boost/range/detail/const_iterator.hpp Executable file → Normal file
View File

View File

@ -5,6 +5,9 @@
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// 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/
//
@ -19,12 +22,12 @@ namespace boost
{
template<class IteratorTraversalTag1, class IteratorTraversalTag2>
struct demote_iterator_traversal_tag
struct inner_demote_iterator_traversal_tag
{
};
#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; \
};
@ -73,6 +76,15 @@ BOOST_DEMOTE_TRAVERSAL_TAG( random_access_traversal_tag, random_access_traversal
#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 boost

4
include/boost/range/detail/detail_str.hpp Executable file → Normal file
View File

@ -134,8 +134,8 @@ namespace boost
#include <boost/range/detail/begin.hpp>
#include <boost/range/detail/end.hpp>
#include <boost/range/detail/size_type>
#include <boost/range/detail/value_type>
#include <boost/range/detail/size_type.hpp>
#include <boost/range/detail/value_type.hpp>
#include <boost/range/detail/common.hpp>
namespace boost

0
include/boost/range/detail/difference_type.hpp Executable file → Normal file
View File

0
include/boost/range/detail/empty.hpp Executable file → Normal file
View File

0
include/boost/range/detail/extract_optional_type.hpp Executable file → Normal file
View File

0
include/boost/range/detail/implementation_help.hpp Executable file → Normal file
View File

0
include/boost/range/detail/iterator.hpp Executable file → Normal file
View File

View File

@ -5,6 +5,9 @@
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// 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/
//
@ -120,7 +123,32 @@ private:
template<typename Iterator1
, typename Iterator2
, typename ValueType = typename iterator_value<Iterator1>::type
, typename Reference = typename iterator_reference<Iterator1>::type
// find least demanding, commonly supported reference type, in the order &, const&, and by-value:
, 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 iterator_traversal<Iterator1>::type
, typename iterator_traversal<Iterator2>::type>::type

0
include/boost/range/detail/misc_concept.hpp Executable file → Normal file
View File

0
include/boost/range/detail/range_return.hpp Executable file → Normal file
View File

Some files were not shown because too many files have changed in this diff Show More