Compare commits

..

56 Commits

Author SHA1 Message Date
Marshall Clow
ca6c43d7a6 Release 1.54.0 beta1
[SVN r84619]
2013-06-03 14:02:28 +00:00
Nathan Ridge
58d57f9b7b [range] merge documentation fix from trunk (refs #7926)
[SVN r82622]
2013-01-26 04:03:46 +00:00
Nathan Ridge
4df157ac11 [range] merge fix for typos in comments to release branch (refs #7916)
[SVN r82620]
2013-01-26 03:13:39 +00:00
Nathan Ridge
537f2474c9 [range] Merge documentation fixes and minor refactoring of docs (refs #5160; refs #5314; refs #5440; refs #5775; refs #6212; refs #7585; refs #7843; refs #7866).
[SVN r82487]
2013-01-14 09:19:32 +00:00
Nathan Ridge
2726efa8c1 [range] merged bug fixes (r81890, refs #5603; r82071, refs #6103) from trunk
[SVN r82139]
2012-12-21 08:47:14 +00:00
Nathan Ridge
a417560f09 [range] merge doc fixes (r81888, r81889) from trunk
[SVN r82138]
2012-12-21 08:44:32 +00:00
Neil Groves
bda0d613c1 [boost][range] merge from trunk to release
[SVN r80677]
2012-09-23 18:59:28 +00:00
Neil Groves
dc46fc13ab [boost][range] - Merge trac resolutions from the trunk. The most notable change is the alteration of the size type to be unsigned. This is a potentially breaking change.
[SVN r78860]
2012-06-08 22:59:54 +00:00
Neil Groves
2f3d82be9f [boost][range] - merge from trunk of miscellaneous defect fixes
[SVN r72427]
2011-06-05 21:47:57 +00:00
Bryce Adelstein-Lelbach
47e478d099 Merge to release.
[SVN r72228]
2011-05-27 19:51:13 +00:00
Neil Groves
cafea6aea5 [boost][range] - Merge a fix to undo an erroneous change to iterator_range.size() that allowed it to compile for ranges that did not model the Random Access Range Concept and thereby broken the complexity guarantees.
[SVN r68190]
2011-01-16 17:07:27 +00:00
Neil Groves
6d46ce412f [range] - merge the tested changes from the trunk in preparation for the 1.46 release.
[SVN r67905]
2011-01-10 06:35:02 +00:00
Neil Groves
674be9dfa0 [boost][range] - merge from trunk which fixes a defect in the strided range adaptor, and contains improvements to the documentation
[SVN r67454]
2010-12-26 15:13:43 +00:00
Daniel James
65b22bfa38 Merge filesystem, range, doc from trunk.
* Inline deprecated methods in filesystem.
* Fix some links in range.
* Clean up test document a bit.


[SVN r64315]
2010-07-24 14:26:01 +00:00
Daniel James
fb8994f51c Merge documentation changes.
[SVN r64186]
2010-07-19 23:29:09 +00:00
Neil Groves
26c095d022 Boost.Range merge of bug fixes and documentation
[SVN r64120]
2010-07-18 11:36:34 +00:00
Daniel James
ca2328ed87 Merge documentation fixes.
* Use `doc/src/*.css` instead of `doc/html/*.css`.
* Remove wiki and people directories.
* Some documentation fixes.
* Left out `minimal.css` changes and boostbook changes because of clashes.


[SVN r63347]
2010-06-26 12:30:09 +00:00
Douglas Gregor
794fd3e226 Move Boost.Range's join_iterator intrusive_ptr_add_ref and intrusive_ptr_release where ADL will actually find them
[SVN r61867]
2010-05-09 01:32:55 +00:00
Douglas Gregor
88001ada37 Merge standards-conformance fixes for Boost.Range
[SVN r61864]
2010-05-09 01:23:32 +00:00
Neil Groves
91d62c2c1a Boost.Range documentation merge from the trunk. Corrects inconsitency with return types, Range Return Categories etc.
[SVN r61685]
2010-04-29 21:18:58 +00:00
Neil Groves
f9eeb5d447 Boost.Range correct missing items from merge by merging these changes manually.
This changeset is what should have happened with the prior svn merge operation.

[SVN r61519]
2010-04-23 23:18:59 +00:00
Neil Groves
a47f15a98f Boost.Range merge from trunk to release.
This is motivated by the need to correct the istream_range, to correct the adaptors.hpp header file, and correct the return types of various range algorithms.

[SVN r61517]
2010-04-23 22:50:56 +00:00
Neil Groves
dfc30e334d Boost.Range merged defect fix for iterator_range.
[SVN r61280]
2010-04-14 21:15:41 +00:00
Neil Groves
13b748a228 Boost.Range removed deprecated html documentation.
[SVN r61181]
2010-04-10 15:25:56 +00:00
Neil Groves
eea32403ef Boost.Range merge of fixes from the trunk.
[SVN r61146]
2010-04-08 19:34:17 +00:00
Neil Groves
29b2053f5c Merged the new Boost.Range into the release branch.
[SVN r61052]
2010-04-04 20:00:13 +00:00
Troy D. Straszheim
29fa877949 rm cmake from the release branch before it goes out broken. Policy dictates that you never commit to release, you commit to trunk and merge to release.
[SVN r56941]
2009-10-17 01:10:45 +00:00
Troy D. Straszheim
a39946c55d Add basic copyright/license to keep cmake out of the inspection report
[SVN r55095]
2009-07-22 21:51:01 +00:00
Daniel James
90f4eca5cd Merge in inspect checks for links in CSS files and external content. And fix a few of these issues.
Merged revisions 52663-52664,52666-52668,52712 via svnmerge from 
https://svn.boost.org/svn/boost/trunk

........
  r52663 | danieljames | 2009-04-29 22:12:08 +0100 (Wed, 29 Apr 2009) | 1 line
  
  Check for invalid css links in html files as well as css files.
........
  r52664 | danieljames | 2009-04-29 22:12:32 +0100 (Wed, 29 Apr 2009) | 1 line
  
  Check for external links.
........
  r52666 | danieljames | 2009-04-29 22:19:12 +0100 (Wed, 29 Apr 2009) | 1 line
  
  Use local copies of the boost logo.
........
  r52667 | danieljames | 2009-04-29 22:19:40 +0100 (Wed, 29 Apr 2009) | 1 line
  
  Remove unused copy of boostbook.css
........
  r52668 | danieljames | 2009-04-29 22:19:56 +0100 (Wed, 29 Apr 2009) | 3 lines
  
  Fix a link to a header on trac.
  
  IMO it would be better to link to the local copy.
........
  r52712 | danieljames | 2009-05-01 21:51:10 +0100 (Fri, 01 May 2009) | 1 line
  
  Better inspect error for external content.
........


[SVN r53044]
2009-05-16 13:45:21 +00:00
Thorsten Jørgen Ottosen
c8c808b04e fix for bug Ticket #2903
[SVN r52204]
2009-04-05 20:49:47 +00:00
John Maddock
deefb61ec6 Merge PDF build changes from Trunk.
[SVN r51417]
2009-02-23 18:39:32 +00:00
Troy D. Straszheim
12d904a5e4 merge of cmake build files from trunk per beman
[SVN r50756]
2009-01-24 18:57:20 +00:00
Thorsten Jørgen Ottosen
26b096f65d update in response to inspection report
[SVN r47681]
2008-07-22 09:29:56 +00:00
Thorsten Jørgen Ottosen
a85afbe470 doc update
[SVN r47495]
2008-07-16 21:05:16 +00:00
Thorsten Jørgen Ottosen
e7902d439b more changes from trunk
[SVN r46652]
2008-06-24 15:42:48 +00:00
Thorsten Jørgen Ottosen
b4f99d66b5 bug-fixes from trunk
[SVN r46649]
2008-06-24 15:38:50 +00:00
Thorsten Jørgen Ottosen
d1c2c5ce3f bug-fixes from trunk
[SVN r46647]
2008-06-24 15:37:59 +00:00
Thorsten Jørgen Ottosen
062e820882 cleanup to pass inspection tool
[SVN r43139]
2008-02-07 08:38:07 +00:00
Thorsten Jørgen Ottosen
4d381e8564 fixed #if -> #ifdef
[SVN r42716]
2008-01-13 11:38:13 +00:00
Thorsten Jørgen Ottosen
fd00cc129f doc fixes
[SVN r42692]
2008-01-12 12:38:46 +00:00
Thorsten Jørgen Ottosen
8291ce67fc minor changes from trunk
[SVN r41751]
2007-12-05 17:30:23 +00:00
Thorsten Jørgen Ottosen
dbfa1df088 missing include (Ticket #1463)
[SVN r41637]
2007-12-03 09:01:03 +00:00
Thorsten Jørgen Ottosen
5afec2b74f merge from truck (boost::size()->boost::distance())
[SVN r41635]
2007-12-03 08:51:22 +00:00
Beman Dawes
a33d5c22c5 Full merge from trunk at revision 41356 of entire boost-root tree.
[SVN r41370]
2007-11-25 18:38:02 +00:00
Beman Dawes
901266b76a Full merge from trunk at revision 41356 of entire boost-root tree.
[SVN r41369]
2007-11-25 18:07:19 +00:00
Beman Dawes
25e932149c Starting point for releases
[SVN r39706]
2007-10-05 14:25:06 +00:00
nobody
c54e15d374 This commit was manufactured by cvs2svn to create tag
'Version_1_34_1'.

[SVN r38286]
2007-07-24 19:28:14 +00:00
Thorsten Jørgen Ottosen
fd448ffa31 removed invalid test
[SVN r37117]
2007-02-28 22:27:50 +00:00
Thorsten Jørgen Ottosen
21b558fe5e license info
[SVN r36156]
2006-11-22 22:33:09 +00:00
Thorsten Jørgen Ottosen
33c8f3e3ec *** empty log message ***
[SVN r36155]
2006-11-22 22:27:28 +00:00
Vladimir Prus
523f8a5926 Merge from HEAD.
Allow building of shared versions of some Boost.Test libraries.
Adjust tests to use always use static linking to Boost.Test, since
linking to the shared version requires test changes.

Patch from Juergen Hunold.


[SVN r35990]
2006-11-10 19:59:52 +00:00
Rene Rivera
3bd0d886c4 Remove obsolete Boost.Build v1 files.
[SVN r35880]
2006-11-06 17:10:46 +00:00
Thorsten Jørgen Ottosen
e46eae8144 *** empty log message ***
[SVN r35717]
2006-10-24 10:37:46 +00:00
Daniel James
12cf02586c Remove tabs
[SVN r34957]
2006-08-26 14:28:38 +00:00
Thorsten Jørgen Ottosen
ee024f588b applied borland patch
[SVN r33670]
2006-04-11 20:12:31 +00:00
nobody
8e715b3810 This commit was manufactured by cvs2svn to create branch 'RC_1_34_0'.
[SVN r33417]
2006-03-21 02:26:31 +00:00
34 changed files with 98 additions and 551 deletions

View File

@@ -15,7 +15,7 @@
# pragma once
#endif
#if defined(_MSC_VER) && (_MSC_VER == 1300)
#if _MSC_VER == 1300 // experiment
#include <boost/range/detail/collection_traits.hpp>
#include <boost/range/iterator_range.hpp>
@@ -28,6 +28,6 @@
#include <boost/range/iterator_range.hpp>
#include <boost/range/sub_range.hpp>
#endif // _MSC_VER == 1300
#endif // _MSC_VER == 1300 // experiment
#endif

View File

@@ -55,9 +55,6 @@ namespace boost
index_type m_index;
public:
indexed_iterator()
: m_index(index_type()) {}
explicit indexed_iterator( Iter i, index_type index )
: base(i), m_index(index)
{

View File

@@ -52,9 +52,9 @@ namespace boost
template< class T, class U, class V >
struct regex_holder
{
T re;
U sub;
V f;
const T& re;
const U& sub;
V f;
regex_holder( const T& rex, const U& subm, V flag ) :
re(rex), sub(subm), f(flag)

View File

@@ -89,11 +89,11 @@ inline BOOST_DEDUCED_TYPENAME range_return<ForwardRange, return_begin_found>::ty
unique( ForwardRange& rng, BinaryPredicate pred )
{
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange> ));
return ::boost::range::unique<return_begin_found>(rng, pred);
return ::boost::range::unique<return_begin_found>(rng);
}
/// \overload
template< class ForwardRange, class BinaryPredicate >
inline BOOST_DEDUCED_TYPENAME range_return<const ForwardRange, return_begin_found>::type
inline BOOST_DEDUCED_TYPENAME range_iterator<const ForwardRange>::type
unique( const ForwardRange& rng, BinaryPredicate pred )
{
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange> ));

View File

@@ -330,8 +330,8 @@ namespace boost {
struct BidirectionalRangeConcept : ForwardRangeConcept<T>
{
#if BOOST_RANGE_ENABLE_CONCEPT_ASSERT
BOOST_RANGE_CONCEPT_ASSERT((range_detail::BidirectionalIteratorConcept<BOOST_DEDUCED_TYPENAME BidirectionalRangeConcept::iterator>));
BOOST_RANGE_CONCEPT_ASSERT((range_detail::BidirectionalIteratorConcept<BOOST_DEDUCED_TYPENAME BidirectionalRangeConcept::const_iterator>));
BOOST_RANGE_CONCEPT_ASSERT((BidirectionalIteratorConcept<BOOST_DEDUCED_TYPENAME BidirectionalRangeConcept::iterator>));
BOOST_RANGE_CONCEPT_ASSERT((BidirectionalIteratorConcept<BOOST_DEDUCED_TYPENAME BidirectionalRangeConcept::const_iterator>));
#endif
};
@@ -348,8 +348,8 @@ namespace boost {
struct RandomAccessRangeConcept : BidirectionalRangeConcept<T>
{
#if BOOST_RANGE_ENABLE_CONCEPT_ASSERT
BOOST_RANGE_CONCEPT_ASSERT((range_detail::RandomAccessIteratorConcept<BOOST_DEDUCED_TYPENAME RandomAccessRangeConcept::iterator>));
BOOST_RANGE_CONCEPT_ASSERT((range_detail::RandomAccessIteratorConcept<BOOST_DEDUCED_TYPENAME RandomAccessRangeConcept::const_iterator>));
BOOST_RANGE_CONCEPT_ASSERT((RandomAccessIteratorConcept<BOOST_DEDUCED_TYPENAME RandomAccessRangeConcept::iterator>));
BOOST_RANGE_CONCEPT_ASSERT((RandomAccessIteratorConcept<BOOST_DEDUCED_TYPENAME RandomAccessRangeConcept::const_iterator>));
#endif
};

View File

@@ -48,12 +48,6 @@
#define BOOST_RANGE_ARRAY_REF() (&boost_range_array)
#endif
#if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)))
# define BOOST_RANGE_UNUSED __attribute__((unused))
#else
# define BOOST_RANGE_UNUSED
#endif
#endif

View File

@@ -16,7 +16,7 @@
#include <boost/config.hpp>
#ifdef BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS
#ifdef BOOST_NO_PARTIAL_TEMPLATE_SPECIALIZATION
#define BOOST_RANGE_EXTRACT_OPTIONAL_TYPE( a_typedef ) \
template< typename C > \

View File

@@ -21,13 +21,13 @@
#include <wchar.h>
#endif
namespace boost
namespace boost
{
namespace range_detail
{
template <typename T>
inline void boost_range_silence_warning( const T& ) { }
/////////////////////////////////////////////////////////////////////
// end() help
/////////////////////////////////////////////////////////////////////
@@ -36,7 +36,7 @@ namespace boost
{
return s + strlen( s );
}
#ifndef BOOST_NO_CWCHAR
inline const wchar_t* str_end( const wchar_t* s, const wchar_t* )
{
@@ -51,7 +51,7 @@ namespace boost
;
return s;
}
#endif
#endif
template< class Char >
inline Char* str_end( Char* s )
@@ -64,7 +64,7 @@ namespace boost
{
return boost_range_array + sz;
}
template< class T, std::size_t sz >
inline const T* array_end( const T BOOST_RANGE_ARRAY_REF()[sz] )
{
@@ -74,7 +74,7 @@ namespace boost
/////////////////////////////////////////////////////////////////////
// size() help
/////////////////////////////////////////////////////////////////////
template< class Char >
inline std::size_t str_size( const Char* const& s )
{
@@ -96,7 +96,7 @@ namespace boost
}
} // namespace 'range_detail'
} // namespace 'boost'

View File

@@ -23,10 +23,6 @@
#include <boost/range/empty.hpp>
#include <boost/range/detail/demote_iterator_traversal_tag.hpp>
#include <boost/range/value_type.hpp>
#include <boost/type_traits/add_const.hpp>
#include <boost/type_traits/add_reference.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <boost/type_traits/remove_reference.hpp>
#include <boost/next_prior.hpp>
namespace boost
@@ -75,9 +71,7 @@ public:
Reference dereference(unsigned int selected) const
{
if (selected)
return *m_it2;
return *m_it1;
return selected ? *m_it2 : *m_it1;
}
bool equal(const join_iterator_union& other, unsigned int selected) const
@@ -150,7 +144,7 @@ template<typename Iterator1
>::type
>::value,
typename add_const<
typename iterator_reference<Iterator1>::type
typename iterator_reference<Iterator2>::type
>::type,
typename iterator_reference<Iterator1>::type
>::type

View File

@@ -168,7 +168,7 @@ namespace boost
typedef boost::iterator_range<
BOOST_DEDUCED_TYPENAME range_iterator<SinglePassRange>::type > type;
static type pack(BOOST_DEDUCED_TYPENAME range_iterator<SinglePassRange>::type,
static type pack(BOOST_DEDUCED_TYPENAME range_iterator<SinglePassRange>::type found,
SinglePassRange& rng)
{
return type(boost::begin(rng), boost::end(rng));

View File

@@ -7,14 +7,10 @@
//
// For more information, see http://www.boost.org/libs/range/
//
// Acknowledgments:
// Ticket #8341: Arno Schoedl - improved handling of has_range_iterator upon
// use-cases where T was const.
#ifndef BOOST_RANGE_HAS_ITERATOR_HPP_INCLUDED
#define BOOST_RANGE_HAS_ITERATOR_HPP_INCLUDED
#include <boost/mpl/bool.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/has_xxx.hpp>
#include <boost/range/iterator.hpp>
#include <boost/utility/enable_if.hpp>
@@ -32,16 +28,7 @@ namespace boost
};
template<class T>
struct has_range_iterator_impl<
T,
BOOST_DEDUCED_TYPENAME enable_if<
BOOST_DEDUCED_TYPENAME mpl::eval_if<is_const<T>,
has_type<range_const_iterator<
BOOST_DEDUCED_TYPENAME remove_const<T>::type> >,
has_type<range_mutable_iterator<T> >
>::type
>::type
>
struct has_range_iterator_impl<T, BOOST_DEDUCED_TYPENAME enable_if< has_type< range_mutable_iterator<T> > >::type>
: boost::mpl::true_
{
};
@@ -53,12 +40,7 @@ namespace boost
};
template<class T>
struct has_range_const_iterator_impl<
T,
BOOST_DEDUCED_TYPENAME enable_if<
has_type<range_const_iterator<T> >
>::type
>
struct has_range_const_iterator_impl<T, BOOST_DEDUCED_TYPENAME enable_if< has_type< range_const_iterator<T> > >::type>
: boost::mpl::true_
{
};

View File

@@ -217,7 +217,7 @@ namespace boost
const std::ptrdiff_t sz = static_cast<std::ptrdiff_t>(step_size >= 0 ? step_size : -step_size);
const Integer l = step_size >= 0 ? last : first;
const Integer f = step_size >= 0 ? first : last;
const std::ptrdiff_t num_steps = (l - f) / sz + ((l - f) % sz ? 1 : 0);
const std::ptrdiff_t num_steps = (l + ((l-f) % sz) - f) / sz;
BOOST_ASSERT(num_steps >= 0);
return strided_integer_range<Integer>(

View File

@@ -14,7 +14,7 @@
*/
#include <iterator>
#include <iosfwd>
#include <istream>
#include <boost/config.hpp>
#include <boost/range/iterator_range.hpp>
@@ -27,8 +27,8 @@ namespace boost
istream_range(std::basic_istream<Elem, Traits>& in)
{
return iterator_range<std::istream_iterator<Type, Elem, Traits> >(
std::istream_iterator<Type, Elem, Traits>(in),
std::istream_iterator<Type, Elem, Traits>());
std::istream_iterator<Type>(in),
std::istream_iterator<Type>());
}
} // namespace range
using range::istream_range;

View File

@@ -25,46 +25,46 @@
namespace boost
{
#if BOOST_WORKAROUND(BOOST_MSVC, == 1310)
#if BOOST_WORKAROUND(BOOST_MSVC, == 1310)
namespace range_detail_vc7_1
{
template< typename C, typename Sig = void(C) >
struct range_iterator
{
typedef BOOST_RANGE_DEDUCED_TYPENAME
mpl::eval_if_c< is_const<C>::value,
range_const_iterator< typename remove_const<C>::type >,
range_mutable_iterator<C> >::type type;
};
template< typename C, typename T >
struct range_iterator< C, void(T[]) >
{
typedef T* type;
};
}
#endif
namespace range_detail_vc7_1
{
template< typename C, typename Sig = void(C) >
struct range_iterator
{
typedef BOOST_RANGE_DEDUCED_TYPENAME
mpl::eval_if_c< is_const<C>::value,
range_const_iterator< typename remove_const<C>::type >,
range_mutable_iterator<C> >::type type;
};
template< typename C, typename T >
struct range_iterator< C, void(T[]) >
{
typedef T* type;
};
}
#endif
template< typename C >
struct range_iterator
{
#if BOOST_WORKAROUND(BOOST_MSVC, == 1310)
typedef BOOST_RANGE_DEDUCED_TYPENAME
range_detail_vc7_1::range_iterator<C>::type type;
#else
typedef BOOST_RANGE_DEDUCED_TYPENAME
mpl::eval_if_c< is_const<C>::value,
typedef BOOST_RANGE_DEDUCED_TYPENAME
range_detail_vc7_1::range_iterator<C>::type type;
#else
typedef BOOST_RANGE_DEDUCED_TYPENAME
mpl::eval_if_c< is_const<C>::value,
range_const_iterator< typename remove_const<C>::type >,
range_mutable_iterator<C> >::type type;
#endif
#endif
};
} // namespace boost
//#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION

View File

@@ -21,9 +21,7 @@
#include <boost/assert.hpp>
#include <boost/iterator/iterator_traits.hpp>
#include <boost/iterator/iterator_facade.hpp>
#include <boost/mpl/or.hpp>
#include <boost/type_traits/is_abstract.hpp>
#include <boost/type_traits/is_array.hpp>
#include <boost/type_traits/is_pointer.hpp>
#include <boost/range/functions.hpp>
#include <boost/range/iterator.hpp>
@@ -169,8 +167,7 @@ namespace boost
private: // for return value of operator()()
typedef BOOST_DEDUCED_TYPENAME
boost::mpl::if_< boost::mpl::or_< boost::is_abstract< value_type >,
boost::is_array< value_type > >,
boost::mpl::if_< boost::is_abstract<value_type>,
reference, value_type >::type abstract_value_type;
public:

View File

@@ -17,7 +17,6 @@
#include <boost/range/config.hpp>
#include <boost/range/difference_type.hpp>
#include <boost/range/concepts.hpp>
#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
#include <boost/range/detail/size_type.hpp>
#else
@@ -46,8 +45,8 @@ namespace boost
template<typename C>
static yes_type test(BOOST_DEDUCED_TYPENAME C::size_type x);
template<typename C>
static no_type test(...);
template<typename C, typename Arg>
static no_type test(Arg x);
public:
static const bool value = sizeof(test<T>(0)) == sizeof(yes_type);
@@ -75,24 +74,12 @@ namespace boost
template< class T >
struct range_size :
detail::range_size<T>
{
// Very strange things happen on some compilers that have the range concept
// asserts disabled. This preprocessor condition is clearly redundant on a
// working compiler but is vital for at least some compilers such as clang 4.2
// but only on the Mac!
#if BOOST_RANGE_ENABLE_CONCEPT_ASSERT == 1
BOOST_RANGE_CONCEPT_ASSERT((boost::SinglePassRangeConcept<T>));
#endif
};
{ };
template< class T >
struct range_size<const T >
: detail::range_size<T>
{
#if BOOST_RANGE_ENABLE_CONCEPT_ASSERT == 1
BOOST_RANGE_CONCEPT_ASSERT((boost::SinglePassRangeConcept<T>));
#endif
};
{ };
} // namespace boost

View File

@@ -161,6 +161,5 @@ test-suite range :
[ range-test ticket_5544_terminate_irange ]
[ range-test ticket_5547 ]
[ range-test ticket_5556_is_sorted_namespace ]
[ range-test ticket_6944 ]
;

View File

@@ -15,14 +15,11 @@
#include <boost/assign.hpp>
#include <boost/range/algorithm_ext.hpp>
#include <boost/range/concepts.hpp>
#include <algorithm>
#include <list>
#include <vector>
#include "../test_utils.hpp"
namespace boost
{
namespace
@@ -86,9 +83,6 @@ namespace boost
{
indexed_test_impl< std::vector< int > >();
indexed_test_impl< std::list< int > >();
check_random_access_range_concept(std::vector<int>() | boost::adaptors::indexed(0));
check_bidirectional_range_concept(std::list<int>() | boost::adaptors::indexed(0));
}
}
}

View File

@@ -13,7 +13,6 @@
//
#include <boost/range/adaptor/strided.hpp>
#include <boost/config.hpp>
#include <boost/test/test_tools.hpp>
#include <boost/test/unit_test.hpp>
@@ -43,12 +42,9 @@ namespace boost
Container reference;
{
typedef BOOST_DEDUCED_TYPENAME Container::const_iterator
iterator_t BOOST_RANGE_UNUSED;
typedef BOOST_DEDUCED_TYPENAME Container::difference_type
diff_t BOOST_RANGE_UNUSED;
typedef BOOST_DEDUCED_TYPENAME Container::size_type
size_type BOOST_RANGE_UNUSED;
typedef BOOST_DEDUCED_TYPENAME Container::const_iterator iterator_t;
typedef BOOST_DEDUCED_TYPENAME Container::difference_type diff_t;
typedef BOOST_DEDUCED_TYPENAME Container::size_type size_type;
iterator_t it = c.begin();
iterator_t last = c.end();
@@ -132,7 +128,6 @@ namespace boost
typedef boost::strided_range<Container> strided_range_t;
strided_range_t rng( boost::adaptors::stride(c, 0) );
boost::ignore_unused_variable_warning(rng);
typedef BOOST_DEDUCED_TYPENAME boost::range_iterator<strided_range_t>::type iter_t;
iter_t first(boost::begin(c), boost::begin(c), boost::end(c), 0);

View File

@@ -35,7 +35,6 @@
#endif
#include <boost/assign.hpp>
#include <boost/config.hpp>
#include <boost/array.hpp>
#include <boost/bind.hpp>
#include <boost/range/numeric.hpp>
@@ -108,11 +107,9 @@ void test_random_algorithms(Rng & rng, std::random_access_iterator_tag)
{
typedef BOOST_DEDUCED_TYPENAME boost::range_iterator<Rng>::type iterator;
typedef BOOST_DEDUCED_TYPENAME boost::range_value<Rng>::type value_type;
typedef BOOST_DEDUCED_TYPENAME boost::range_size<Rng>::type size_type BOOST_RANGE_UNUSED;
typedef BOOST_DEDUCED_TYPENAME boost::range_size<Rng>::type size_type;
typedef BOOST_DEDUCED_TYPENAME boost::iterator_category<iterator>::type iterator_category;
// just make sure these compile (for now)
if(0)
{
@@ -331,8 +328,6 @@ void test_algorithms(Rng & rng)
o = boost::adjacent_difference( rng, boost::begin(out) );
o = boost::adjacent_difference( rng, boost::begin(out),
null_op2() );
boost::ignore_unused_variable_warning(b);
}

View File

@@ -43,7 +43,7 @@ namespace boost
source.begin(), source.end()
);
it = boost::copy(boost::make_iterator_range(source), target.begin());
it == boost::copy(boost::make_iterator_range(source), target.begin());
BOOST_CHECK( it == target.end() );

View File

@@ -71,8 +71,6 @@ namespace boost_range_test_algorithm_stable_partition
result_t result2 = boost::stable_partition<return_type>(
boost::make_iterator_range(cont2), policy.pred());
boost::ignore_unused_variable_warning(result2);
BOOST_CHECK_EQUAL_COLLECTIONS( cont2.begin(), cont2.end(),
cont.begin(), cont.end() );

View File

@@ -41,8 +41,6 @@ namespace boost
iterator_t reference_it
= std::transform(cont.begin(), cont.end(), reference.begin(), fn);
boost::ignore_unused_variable_warning(reference_it);
iterator_t test_it
= boost::transform(cont, target.begin(), fn);
@@ -103,8 +101,6 @@ namespace boost
iterator_t reference_it
= std::transform(cont1.begin(), cont1.end(),
cont2.begin(), reference.begin(), fn);
boost::ignore_unused_variable_warning(reference_it);
iterator_t test_it
= boost::transform(cont1, cont2, target.begin(), fn);

View File

@@ -9,15 +9,13 @@
// For more information, see http://www.boost.org/libs/range/
//
#include <boost/range/algorithm/unique.hpp>
#include <boost/range/detail/range_return.hpp>
#include <boost/test/test_tools.hpp>
#include <boost/test/unit_test.hpp>
#include <boost/assign.hpp>
#include <boost/bind.hpp>
#include <boost/config.hpp>
#include "../test_driver/range_overload_test_driver.hpp"
#include "../test_driver/range_return_test_driver.hpp"
#include <algorithm>
#include <functional>
#include <list>
@@ -62,36 +60,6 @@ namespace boost_range_test_algorithm_unique
}
};
template<typename Container>
struct test_range_overload
{
BOOST_STATIC_CONSTANT(
::boost::range_return_value,
result_type = ::boost::return_begin_found);
template<typename Policy>
BOOST_DEDUCED_TYPENAME boost::range_return<
Container, result_type
>::type
operator()(Policy& policy, Container& cont)
{
typedef BOOST_DEDUCED_TYPENAME boost::range_return<
Container,result_type>::type result_t;
Container cont2(cont);
result_t result = boost::unique(cont);
boost::unique(boost::make_iterator_range(cont2));
BOOST_CHECK_EQUAL_COLLECTIONS(
cont.begin(), cont.end(),
cont2.begin(), cont2.end());
return result;
}
};
template< class Container >
BOOST_DEDUCED_TYPENAME boost::range_iterator<Container>::type
reference(Container& cont)
@@ -99,7 +67,7 @@ namespace boost_range_test_algorithm_unique
return std::unique(cont.begin(), cont.end());
}
};
// test the 'unique' algorithm with a predicate
template<class Pred>
class unique_pred_test_policy
@@ -137,34 +105,6 @@ namespace boost_range_test_algorithm_unique
return result;
}
};
template<typename Container>
struct test_range_overload
{
BOOST_STATIC_CONSTANT(
::boost::range_return_value,
result_type = ::boost::return_begin_found);
template<typename Policy>
BOOST_DEDUCED_TYPENAME boost::range_return<Container,result_type>::type
operator()(Policy& policy, Container& cont)
{
typedef BOOST_DEDUCED_TYPENAME boost::range_return<
Container,result_type>::type result_t;
Container cont2(cont);
result_t result = boost::unique(cont, policy.pred());
boost::unique(boost::make_iterator_range(cont2), policy.pred());
BOOST_CHECK_EQUAL_COLLECTIONS(
cont.begin(), cont.end(),
cont2.begin(), cont2.end());
return result;
}
};
template< class Container >
BOOST_DEDUCED_TYPENAME boost::range_iterator<Container>::type
@@ -181,7 +121,7 @@ namespace boost_range_test_algorithm_unique
typedef BOOST_DEDUCED_TYPENAME Container::value_type value_t;
boost::range_test::range_overload_test_driver test_driver;
boost::range_test::range_return_test_driver test_driver;
Container cont;
@@ -205,19 +145,6 @@ namespace boost_range_test_algorithm_unique
test_driver(cont, policy);
}
template<typename T>
struct equal_div_2
{
typedef bool result_type;
typedef const T& first_argument_type;
typedef const T& second_argument_type;
bool operator()(const T& left, const T& right) const
{
return left / 2 == right / 2;
}
};
template<class Container>
void test_unique_impl()
@@ -225,22 +152,17 @@ namespace boost_range_test_algorithm_unique
test_unique_impl<Container>(
unique_test_policy(),
std::less<int>()
);
);
test_unique_impl<Container>(
unique_pred_test_policy<std::equal_to<int> >(),
unique_pred_test_policy<std::less<int> >(),
std::less<int>()
);
);
test_unique_impl<Container>(
unique_pred_test_policy<std::equal_to<int> >(),
unique_pred_test_policy<std::greater<int> >(),
std::greater<int>()
);
test_unique_impl<Container>(
unique_pred_test_policy<equal_div_2<int> >(),
std::less<int>()
);
);
}
void test_unique()

View File

@@ -10,7 +10,6 @@
#include <boost/static_assert.hpp>
#include <boost/type_traits.hpp>
#include <boost/concept_check.hpp>
#include <boost/config.hpp>
enum Container {};
@@ -52,7 +51,6 @@ void compat1()
{
std::vector<int> v;
iterator_of< std::vector<int> >::type i = v.begin();
boost::ignore_unused_variable_warning(i);
}
#include <boost/test/included/unit_test.hpp>

View File

@@ -16,7 +16,6 @@ namespace iterator_range_test_detail
{
double source[] = { 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 };
boost::iterator_range<float*> rng = boost::make_iterator_range(source);
boost::ignore_unused_variable_warning(rng);
}
}

View File

@@ -19,7 +19,6 @@
#include <boost/range.hpp>
#include <boost/test/test_tools.hpp>
#include <boost/test/unit_test.hpp>
#include <boost/static_assert.hpp>
#include <list>
#include <vector>
@@ -28,13 +27,6 @@ namespace boost_range_extension_size_test
class FooWithoutSize
{
typedef std::list<int> impl_t;
BOOST_STATIC_ASSERT((
boost::is_same<
boost::range_size<std::list<int> >::type,
std::list<int>::size_type
>::value));
typedef impl_t::const_iterator const_iterator;
typedef impl_t::iterator iterator;
@@ -47,117 +39,12 @@ namespace boost_range_extension_size_test
private:
impl_t m_impl;
};
template<typename SizeType>
class FooWithSize
inline boost::range_size<std::list<int> >::type
range_calculate_size(const FooWithoutSize& rng)
{
public:
typedef SizeType size_type;
typedef boost::uint8_t* iterator;
typedef const boost::uint8_t* const_iterator;
const_iterator begin() const;
iterator begin();
const_iterator end() const;
iterator end();
};
BOOST_STATIC_ASSERT((
boost::is_same<
boost::uint8_t,
boost::range_size<FooWithSize<boost::uint8_t> >::type
>::value
));
BOOST_STATIC_ASSERT((
boost::is_same<
boost::uint16_t,
boost::range_size<FooWithSize<boost::uint16_t> >::type
>::value
));
BOOST_STATIC_ASSERT((
boost::is_same<
boost::uint32_t,
boost::range_size<FooWithSize<boost::uint32_t> >::type
>::value
));
BOOST_STATIC_ASSERT((
boost::is_same<
boost::uint64_t,
boost::range_size<FooWithSize<boost::uint64_t> >::type
>::value
));
class UdtSizeType
{
public:
typedef boost::uint16_t value_type;
UdtSizeType() : value_(0) { }
UdtSizeType(value_type value) : value_(value) { }
operator value_type() const { return value_; }
private:
value_type value_;
};
BOOST_STATIC_ASSERT((
boost::is_same<
UdtSizeType,
boost::range_size<FooWithSize<UdtSizeType> >::type
>::value
));
class Foo2WithoutSize
{
public:
struct const_iterator
{
typedef std::forward_iterator_tag iterator_category;
typedef boost::int8_t difference_type;
typedef boost::int16_t value_type;
typedef value_type* pointer;
typedef value_type& reference;
reference operator*() const;
pointer operator->() const;
const_iterator& operator++();
const_iterator operator++(int);
bool operator==(const const_iterator&) const;
bool operator!=(const const_iterator&) const;
};
struct iterator : const_iterator
{
typedef const value_type* pointer;
typedef const value_type& reference;
reference operator*() const;
pointer operator->() const;
iterator& operator++();
iterator operator++(int);
bool operator==(const iterator&) const;
bool operator!=(const iterator&) const;
};
const_iterator begin() const;
iterator begin();
const_iterator end() const;
iterator end();
};
BOOST_STATIC_ASSERT((
boost::is_same<
boost::uint8_t,
boost::range_size<
::boost_range_extension_size_test::Foo2WithoutSize>::type
>::value
));
return 2u;
}
}
namespace boost
@@ -173,26 +60,6 @@ namespace boost
};
}
namespace boost_range_extension_size_test
{
inline boost::range_size<FooWithoutSize>::type
range_calculate_size(const FooWithoutSize& rng)
{
return 2u;
}
}
BOOST_STATIC_ASSERT((
boost::is_same<
boost::make_unsigned<std::ptrdiff_t>::type,
boost::range_size<
boost_range_extension_size_test::FooWithoutSize>::type
>::value
));
typedef boost::make_unsigned<std::ptrdiff_t>::type t1;
typedef boost::range_size<boost_range_extension_size_test::FooWithoutSize>::type t1;
namespace
{

View File

@@ -35,6 +35,15 @@ namespace boost
reference.begin(), reference.end() );
}
template<typename Integer>
std::ptrdiff_t test_irange_calculate_num_steps(Integer first, Integer last, int step)
{
const std::ptrdiff_t sz = static_cast<std::ptrdiff_t>(step >= 0 ? step : -step);
const std::ptrdiff_t l = static_cast<std::ptrdiff_t>(step >= 0 ? last : first);
const std::ptrdiff_t f = static_cast<std::ptrdiff_t>(step >= 0 ? first : last);
return (l + ((l-f) % sz) - f) / sz;
}
// Test an integer range with a runtime specified step size.
template<typename Integer, typename IntegerInput>
void test_irange_impl(IntegerInput first, IntegerInput last, int step)
@@ -49,12 +58,9 @@ namespace boost
std::vector<Integer> reference;
const std::ptrdiff_t first_p = static_cast<std::ptrdiff_t>(first);
const std::ptrdiff_t last_p = static_cast<std::ptrdiff_t>(last);
const std::ptrdiff_t step_p = static_cast<std::ptrdiff_t>(step);
for (std::ptrdiff_t current_value = first_p;
step_p >= 0 ? current_value < last_p : current_value > last_p;
current_value += step_p)
const std::ptrdiff_t num_steps = test_irange_calculate_num_steps(first, last, step);
Integer current_value = first;
for (std::ptrdiff_t i = 0; i < num_steps; ++i, current_value += step)
reference.push_back(current_value);
std::vector<Integer> test;

View File

@@ -19,15 +19,15 @@
namespace
{
template <typename CharT>
void test_istream_range_impl()
// Test an integer range with a step size of 1.
void test_istream_range()
{
std::basic_stringstream<CharT> s;
std::stringstream s;
std::vector<int> reference;
for (int i = 0; i < 10; ++i)
{
reference.push_back(i);
s << i << CharT(' ');
s << i << " ";
}
std::vector<int> target;
@@ -36,13 +36,6 @@ namespace
BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(),
target.begin(), target.end() );
}
// Test an istream range.
void test_istream_range()
{
test_istream_range_impl<char>();
test_istream_range_impl<wchar_t>();
}
} // namespace anonymous namespace

View File

@@ -101,11 +101,6 @@ void check_iterator_range()
BOOST_CHECK( rrr == str );
check_reference_type();
// Check that an iterator range can be instantiated with
// a pointer to an array as an iterator.
int arr[2][2];
boost::make_iterator_range(arr, arr + 2);
}
namespace iterator_range_test_detail

View File

@@ -135,11 +135,7 @@ namespace boost
{
Collection1 c1(rng1);
Collection2 c2(rng2);
typedef BOOST_DEDUCED_TYPENAME boost::range_value<
Collection1
>::type value_t BOOST_RANGE_UNUSED;
typedef typename boost::range_value<Collection1>::type value_t;
fill_with_ints(boost::join(c1,c2));
// Ensure that the size of the written range has not been
@@ -261,18 +257,6 @@ namespace boost
test_join_impl< std::vector<int>, std::deque<int> >();
test_join_impl< std::deque<int>, std::vector<int> >();
}
void test_join_iterator_reference_type_constness_ticket8483()
{
// Just test that this compiles.
// Before the fix for bug 8483, the reference type of the joined
// range's iterator was incorrect ('int&' instead of 'const int&'),
// causing compiler errors.
const std::vector<int> v1;
std::vector<int> v2;
std::vector<int> joined;
boost::push_back(joined, join(v1, v2));
}
}
}
@@ -284,7 +268,6 @@ init_unit_test_suite(int argc, char* argv[])
= BOOST_TEST_SUITE( "RangeTestSuite.adaptor.joined" );
test->add( BOOST_TEST_CASE( &boost::join_test ) );
test->add( BOOST_TEST_CASE( &boost::test_join_iterator_reference_type_constness_ticket8483 ) );
return test;
}

View File

@@ -1,74 +0,0 @@
// Copyright Neil Groves 2013. Use, modification and
// distribution is subject to the Boost Software License, Version
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
//
// For more information, see http://www.boost.org/libs/range/
//
// Acknowledgments:
// Implemented by Andy in response to Ticket 6888 - unique fix
//
#ifndef BOOST_RANGE_TEST_TEST_DRIVER_RANGE_OVERLOAD_TEST_DRIVER_HPP_INCLUDED
#define BOOST_RANGE_TEST_TEST_DRIVER_RANGE_OVERLOAD_TEST_DRIVER_HPP_INCLUDED
#include "range_return_test_driver.hpp"
#include <boost/assert.hpp>
#include <boost/test/test_tools.hpp>
#include <boost/test/unit_test.hpp>
namespace boost
{
namespace range_test
{
// A test driver to exercise a test through range_return_test_driver
// plus the overload that determines the return_type by overload
//
// The test driver also contains the code required to check the
// return value correctness.
//
// The TestPolicy needs to implement all those required by
// range_return_test_driver, and additionally
//
// - perform the boost range version of the algorithm that determines
// the return_type by overload
class range_overload_test_driver : range_return_test_driver
{
public:
template< class Container,
class TestPolicy >
void operator()(Container& cont, TestPolicy policy)
{
range_return_test_driver::operator()(cont, policy);
test_range_overload<Container, TestPolicy>()(cont, policy);
}
private:
template< class Container, class TestPolicy >
struct test_range_overload
{
void operator()(Container& cont, TestPolicy policy)
{
typedef BOOST_DEDUCED_TYPENAME range_iterator<Container>::type iterator_t;
typedef BOOST_DEDUCED_TYPENAME TestPolicy::template test_range_overload<Container> test_range_overload_t;
const range_return_value result_type = test_range_overload_t::result_type;
typedef BOOST_DEDUCED_TYPENAME range_return<Container, result_type>::type range_return_t;
Container reference(cont);
Container test_cont(cont);
test_range_overload_t test_range_overload_fn;
range_return_t range_result = test_range_overload_fn(policy, test_cont);
iterator_t reference_it = policy.reference(reference);
check_results<result_type>::test(test_cont, reference,
range_result, reference_it);
}
};
};
}
}
#endif // include guard

View File

@@ -1,24 +0,0 @@
// Boost.Range library
//
// Copyright Akira Takahashi 2013. Use, modification and
// distribution is subject to the Boost Software License, Version
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
//
// For more information, see http://www.boost.org/libs/range/
//
#include <boost/range/concepts.hpp>
template <class RandomAccessRng>
void check_random_access_range_concept(const RandomAccessRng& rng)
{
BOOST_RANGE_CONCEPT_ASSERT(( boost::RandomAccessRangeConcept<RandomAccessRng> ));
}
template <class BidirectionalRng>
void check_bidirectional_range_concept(const BidirectionalRng& rng)
{
BOOST_RANGE_CONCEPT_ASSERT(( boost::BidirectionalRangeConcept<BidirectionalRng> ));
}

View File

@@ -1,46 +0,0 @@
// Boost.Range library
//
// Copyright Neil Groves 2011. Use, modification and
// distribution is subject to the Boost Software License, Version
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
//
// For more information, see http://www.boost.org/libs/range/
//
#include <boost/concept_check.hpp>
#include <boost/iterator/iterator_adaptor.hpp>
#include <boost/range/concepts.hpp>
#include <boost/range/iterator_range.hpp>
#include <boost/test/test_tools.hpp>
#include <boost/test/unit_test.hpp>
#include <vector>
namespace boost
{
typedef std::vector<int>::iterator iter_base;
struct iter : boost::iterator_adaptor<iter, iter_base, int, boost::use_default, int> {}; // will be deduced as random-access traversal but input category
typedef boost::iterator_range<iter> iter_range;
namespace
{
// Ticket 6944 - Some Range concepts use the incorrect Iterator concept
void test_ticket_6944()
{
BOOST_CONCEPT_ASSERT(( boost::RandomAccessRangeConcept<iter_range> ));
}
}
}
boost::unit_test::test_suite*
init_unit_test_suite(int argc, char* argv[])
{
boost::unit_test::test_suite* test
= BOOST_TEST_SUITE( "RangeTestSuite.ticket_6944" );
test->add( BOOST_TEST_CASE( &boost::test_ticket_6944 ) );
return test;
}