Compare commits

...

15 Commits

Author SHA1 Message Date
Neil Groves
1d91272a55 trac 6715 - iterator_range operators work automatically in derived. 2014-02-22 22:31:48 +00:00
Neil Groves
d70210e6f2 Merge branch 'hotfix/trac5811_indirected_optional' into develop 2014-02-22 16:16:19 +00:00
Neil Groves
8e7eeeb6d9 ticket 5811 - unit test to confirm already fixed. 2014-02-22 16:14:55 +00:00
Neil Groves
7cd6631cae strided.cpp unit test has the deque test removed. 2014-02-21 17:52:32 +00:00
Neil Groves
96054b0b48 unit test type_erased.cpp corrected mix of value types under test. 2014-02-21 17:50:28 +00:00
Neil Groves
b795de8310 extension_size.cpp include added to cstdint.hpp 2014-02-21 17:44:16 +00:00
Michel Morin
2735dcff18 Correct broken links to C++ standard papers. Refs #9212.
[SVN r86524]
2013-10-30 12:51:24 +00:00
Stephen Kelly
e7185c2966 Remove remaining occurances of BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
These evaded scripting.

[SVN r86249]
2013-10-11 23:22:36 +00:00
Stephen Kelly
5366172708 Remove BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
Process #ifdef...#else...#endif blocks.

[SVN r86246]
2013-10-11 23:19:17 +00:00
Stephen Kelly
b02c60e468 Remove BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
Process #ifndef...#else...#endif blocks.

[SVN r86245]
2013-10-11 23:17:48 +00:00
Stephen Kelly
c55650216f Remove obsolete files.
[SVN r86242]
2013-10-11 23:11:35 +00:00
Stephen Kelly
1e6ba3c885 Range: Remove obsolete GCC version checks.
[SVN r86102]
2013-10-01 08:41:42 +00:00
Stephen Kelly
4f34d95156 Remove obsolete MSVC check from pragma guard
git grep -h -B1 "^#\s*pragma once" | grep -v pragma | sort | uniq

is now clean.

[SVN r85952]
2013-09-26 13:02:51 +00:00
Stephen Kelly
650b75d2d7 Range: Remove obsolete MSVC version checks.
[SVN r85915]
2013-09-25 21:13:39 +00:00
Stephen Kelly
8af782611e Range: Remove ATL specific define for old MSVC.
[SVN r85912]
2013-09-25 21:12:40 +00:00
49 changed files with 291 additions and 1065 deletions

View File

@@ -171,7 +171,7 @@
[def __metafunctions__ [@boost:/libs/mpl/doc/refmanual/metafunction.html metafunctions]]
[def __concept_check__ [@boost:/libs/concept_check/index.html Boost Concept Check library]]
[def __boost_array__ [@boost:/libs/array/index.html boost::array]]
[def __the_forwarding_problem__ [@http://std.dkuug.dk/jtc1/sc22/wg21/docs/papers/2002/n1385.htm The Forwarding Problem]]
[def __the_forwarding_problem__ [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2002/n1385.htm The Forwarding Problem]]
[def __sgi_inner_product__ [@http://www.sgi.com/tech/stl/inner_product.html inner_product]]
[def __sgi_partial_sum__ [@http://www.sgi.com/tech/stl/partial_sum.html partial_sum]]

View File

@@ -11,23 +11,13 @@
#ifndef BOOST_RANGE_HPP_27_07_04
#define BOOST_RANGE_HPP_27_07_04
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
#if defined(_MSC_VER)
# pragma once
#endif
#if defined(_MSC_VER) && (_MSC_VER == 1300)
#include <boost/range/detail/collection_traits.hpp>
#include <boost/range/iterator_range.hpp>
#include <boost/range/sub_range.hpp>
#else
#include <boost/range/functions.hpp>
#include <boost/range/metafunctions.hpp>
#include <boost/range/iterator_range.hpp>
#include <boost/range/sub_range.hpp>
#endif // _MSC_VER == 1300
#endif

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

@@ -19,7 +19,7 @@
// were originally written by Vladimir Prus'
// <ghost@cs.msu.su> code from Boost Wiki
#if defined(_MSC_VER) && _MSC_VER >= 1000
#if defined(_MSC_VER)
#pragma once
#endif

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

@@ -11,7 +11,7 @@
#ifndef BOOST_RANGE_AS_ARRAY_HPP
#define BOOST_RANGE_AS_ARRAY_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
#if defined(_MSC_VER)
# pragma once
#endif

View File

@@ -11,7 +11,7 @@
#ifndef BOOST_RANGE_AS_LITERAL_HPP
#define BOOST_RANGE_AS_LITERAL_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
#if defined(_MSC_VER)
# pragma once
#endif

View File

@@ -35,15 +35,6 @@
#endif
#if !defined(BOOST_RANGE_ATL_HAS_OLD_CSIMPLESTRING)
#if (_MSC_VER < 1310) // from <boost/regex/mfc.hpp>, but dubious
#define BOOST_RANGE_ATL_HAS_OLD_CSIMPLESTRING
#endif
#endif
// forward declarations
//

View File

@@ -11,7 +11,7 @@
#ifndef BOOST_RANGE_BEGIN_HPP
#define BOOST_RANGE_BEGIN_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
#if defined(_MSC_VER)
# pragma once
#endif
@@ -26,9 +26,7 @@
namespace boost
{
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) && \
!BOOST_WORKAROUND(__GNUC__, < 3) \
/**/
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
namespace range_detail
{
#endif
@@ -85,9 +83,7 @@ namespace range_detail
}
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) && \
!BOOST_WORKAROUND(__GNUC__, < 3) \
/**/
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
} // namespace 'range_detail'
#endif
@@ -100,9 +96,7 @@ namespace range_adl_barrier
template< class T >
inline BOOST_DEDUCED_TYPENAME range_iterator<T>::type begin( T& r )
{
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) && \
!BOOST_WORKAROUND(__GNUC__, < 3) \
/**/
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
using namespace range_detail;
#endif
return range_begin( r );
@@ -111,9 +105,7 @@ inline BOOST_DEDUCED_TYPENAME range_iterator<T>::type begin( T& r )
template< class T >
inline BOOST_DEDUCED_TYPENAME range_iterator<const T>::type begin( const T& r )
{
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) && \
!BOOST_WORKAROUND(__GNUC__, < 3) \
/**/
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
using namespace range_detail;
#endif
return range_begin( r );

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

@@ -11,7 +11,7 @@
#ifndef BOOST_RANGE_CATEGORY_HPP
#define BOOST_RANGE_CATEGORY_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
#if defined(_MSC_VER)
# pragma once
#endif

View File

@@ -13,7 +13,7 @@
#include <boost/detail/workaround.hpp>
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
#if defined(_MSC_VER)
# pragma once
#endif
@@ -26,18 +26,14 @@
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
# define BOOST_RANGE_DEDUCED_TYPENAME typename
#else
# if BOOST_WORKAROUND(BOOST_MSVC, == 1300) && !defined(_MSC_EXTENSIONS)
# define BOOST_RANGE_DEDUCED_TYPENAME typename
# else
# define BOOST_RANGE_DEDUCED_TYPENAME BOOST_DEDUCED_TYPENAME
# endif
#define BOOST_RANGE_DEDUCED_TYPENAME BOOST_DEDUCED_TYPENAME
#endif
#ifdef BOOST_RANGE_NO_ARRAY_SUPPORT
#error "macro already defined!"
#endif
#if BOOST_WORKAROUND( BOOST_MSVC, < 1300 ) || BOOST_WORKAROUND( __MWERKS__, <= 0x3003 )
#if BOOST_WORKAROUND( __MWERKS__, <= 0x3003 )
#define BOOST_RANGE_NO_ARRAY_SUPPORT 1
#endif

View File

@@ -11,15 +11,12 @@
#ifndef BOOST_RANGE_CONST_ITERATOR_HPP
#define BOOST_RANGE_CONST_ITERATOR_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
#if defined(_MSC_VER)
# pragma once
#endif
#include <boost/range/config.hpp>
#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
#include <boost/range/detail/const_iterator.hpp>
#else
#include <boost/range/detail/extract_optional_type.hpp>
#include <boost/type_traits/remove_const.hpp>
@@ -62,6 +59,5 @@ namespace boost
} // namespace boost
#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
#endif

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

@@ -11,7 +11,7 @@
#ifndef BOOST_RANGE_CONST_REVERSE_ITERATOR_HPP
#define BOOST_RANGE_CONST_REVERSE_ITERATOR_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
#if defined(_MSC_VER)
# pragma once
#endif

View File

@@ -11,7 +11,7 @@
#ifndef BOOST_RANGE_DETAIL_AS_LITERAL_HPP
#define BOOST_RANGE_DETAIL_AS_LITERAL_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
#if defined(_MSC_VER)
# pragma once
#endif

View File

@@ -15,9 +15,6 @@
#include <boost/detail/workaround.hpp>
#include <boost/range/iterator.hpp>
#include <boost/range/detail/common.hpp>
#if BOOST_WORKAROUND(BOOST_MSVC, < 1310)
# include <boost/range/value_type.hpp>
#endif
namespace boost
{
@@ -62,19 +59,11 @@ namespace boost
template<>
struct range_begin<array_>
{
#if !BOOST_WORKAROUND(BOOST_MSVC, < 1310)
template< typename T, std::size_t sz >
static T* fun( T BOOST_RANGE_ARRAY_REF()[sz] )
{
return boost_range_array;
}
#else
template<typename T>
static BOOST_RANGE_DEDUCED_TYPENAME range_value<T>::type* fun(T& t)
{
return t;
}
#endif
};
} // namespace 'range_detail'

View File

@@ -185,7 +185,6 @@ namespace boost {
// Array container traits ---------------------------------------------------------------
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
// array traits ( partial specialization )
template< typename T >
struct array_traits;
@@ -204,125 +203,6 @@ namespace boost {
BOOST_STATIC_CONSTANT( size_type, array_size = sz );
};
#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
// array traits ( no partial specialization )
/*
without partial specialization we are able to
provide support only for a limited number of
types. Currently the primitive numeric types
are supported
*/
template< typename T, typename BaseT >
struct array_traits_impl
{
typedef BaseT value_type;
typedef BaseT* iterator;
typedef const BaseT* const_iterator;
typedef std::size_t size_type;
typedef std::ptrdiff_t difference_type;
// size of the array
BOOST_STATIC_CONSTANT( size_type, array_size = sizeof(T)/sizeof(BaseT) );
};
template< typename T, typename BaseT >
struct array_traits_impl_selector
{
typedef array_traits_impl<T,BaseT> type;
};
struct array_traits_void
{
typedef void type;
};
template< typename T, typename BaseT >
struct array_traits_cv_selector
{
typedef BOOST_STRING_TYPENAME
::boost::mpl::eval_if<
::boost::is_convertible<T,BaseT*>,
array_traits_impl_selector<T,BaseT>,
::boost::mpl::eval_if<
::boost::is_convertible<T,const BaseT*>,
array_traits_impl_selector<T, const BaseT>,
::boost::mpl::eval_if<
::boost::is_convertible<T, volatile BaseT*>,
array_traits_impl_selector<T, volatile BaseT>,
array_traits_impl_selector<T, const volatile BaseT>
>
>
>::type type;
};
template< typename T >
struct array_traits_select
{
template< typename T1, typename T2 >
struct apply
{
typedef BOOST_STRING_TYPENAME
::boost::mpl::eval_if<
::boost::is_convertible<T,const volatile T2*>,
array_traits_cv_selector<T,T2>,
::boost::mpl::identity<T1> >::type type;
};
};
template< typename T >
struct array_traits_selector
{
private:
// supported array base types
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
typedef BOOST_STRING_TYPENAME
::boost::mpl::vector10<
wchar_t,
#else // BOOST_NO_INTRINSIC_WCHAR_T
typedef BOOST_STRING_TYPENAME
::boost::mpl::vector9<
#endif // BOOST_NO_INTRINSIC_WCHAR_T
char,
signed char,
unsigned char,
signed short,
unsigned short,
signed int,
unsigned int,
signed long,
unsigned long
>::type array_base_types;
public:
typedef BOOST_STRING_TYPENAME
::boost::mpl::fold<
array_base_types,
::boost::algorithm::detail::array_traits_void,
::boost::algorithm::detail::array_traits_select<T> >::type type;
};
template< typename T >
struct array_traits
{
typedef BOOST_STRING_TYPENAME
array_traits_selector<T>::type traits_type;
typedef BOOST_STRING_TYPENAME
traits_type::value_type value_type;
typedef BOOST_STRING_TYPENAME
traits_type::iterator iterator;
typedef BOOST_STRING_TYPENAME
traits_type::const_iterator const_iterator;
typedef BOOST_STRING_TYPENAME
traits_type::size_type size_type;
typedef BOOST_STRING_TYPENAME
traits_type::difference_type difference_type;
BOOST_STATIC_CONSTANT( size_type, array_size = traits_type::array_size );
};
#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
// array length resolving
/*

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

@@ -11,7 +11,7 @@
#ifndef BOOST_RANGE_DETAIL_COMMON_HPP
#define BOOST_RANGE_DETAIL_COMMON_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
#if defined(_MSC_VER)
# pragma once
#endif

View File

@@ -1,71 +0,0 @@
// Boost.Range library
//
// Copyright Thorsten Ottosen 2003-2004. 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/
//
#ifndef BOOST_RANGE_DETAIL_CONST_ITERATOR_HPP
#define BOOST_RANGE_DETAIL_CONST_ITERATOR_HPP
#include <boost/range/detail/common.hpp>
#include <boost/range/detail/remove_extent.hpp>
//////////////////////////////////////////////////////////////////////////////
// missing partial specialization workaround.
//////////////////////////////////////////////////////////////////////////////
namespace boost
{
namespace range_detail
{
template< typename T >
struct range_const_iterator_;
template<>
struct range_const_iterator_<std_container_>
{
template< typename C >
struct pts
{
typedef BOOST_RANGE_DEDUCED_TYPENAME C::const_iterator type;
};
};
template<>
struct range_const_iterator_<std_pair_>
{
template< typename P >
struct pts
{
typedef BOOST_RANGE_DEDUCED_TYPENAME P::first_type type;
};
};
template<>
struct range_const_iterator_<array_>
{
template< typename T >
struct pts
{
typedef const BOOST_RANGE_DEDUCED_TYPENAME
remove_extent<T>::type* type;
};
};
}
template< typename C >
class range_const_iterator
{
typedef BOOST_DEDUCED_TYPENAME range_detail::range<C>::type c_type;
public:
typedef BOOST_DEDUCED_TYPENAME range_detail::range_const_iterator_<c_type>::BOOST_NESTED_TEMPLATE pts<C>::type type;
};
}
#endif

View File

@@ -14,15 +14,9 @@
#include <boost/config.hpp> // BOOST_MSVC
#include <boost/detail/workaround.hpp>
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
# include <boost/range/detail/vc6/end.hpp>
#else
# include <boost/range/detail/implementation_help.hpp>
# include <boost/range/iterator.hpp>
# include <boost/range/detail/common.hpp>
# if BOOST_WORKAROUND(BOOST_MSVC, < 1310)
# include <boost/range/detail/remove_extent.hpp>
# endif
#include <boost/range/detail/implementation_help.hpp>
#include <boost/range/iterator.hpp>
#include <boost/range/detail/common.hpp>
namespace boost
{
@@ -68,19 +62,11 @@ namespace boost
template<>
struct range_end<array_>
{
#if !BOOST_WORKAROUND(BOOST_MSVC, < 1310)
template< typename T, std::size_t sz >
static T* fun( T BOOST_RANGE_ARRAY_REF()[sz] )
{
return boost::range_detail::array_end( boost_range_array );
}
#else
template<typename T>
static BOOST_RANGE_DEDUCED_TYPENAME remove_extent<T>::type* fun(T& t)
{
return t + remove_extent<T>::size;
}
#endif
};
} // namespace 'range_detail'
@@ -97,5 +83,4 @@ namespace boost
} // namespace 'boost'
# endif // VC6
#endif

View File

@@ -10,7 +10,7 @@
#ifndef BOOST_RANGE_DETAIL_EXTRACT_OPTIONAL_TYPE_HPP_INCLUDED
#define BOOST_RANGE_DETAIL_EXTRACT_OPTIONAL_TYPE_HPP_INCLUDED
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
#if defined(_MSC_VER)
# pragma once
#endif

View File

@@ -1,78 +0,0 @@
// Boost.Range library
//
// Copyright Thorsten Ottosen 2003-2004. 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/
//
#ifndef BOOST_RANGE_DETAIL_ITERATOR_HPP
#define BOOST_RANGE_DETAIL_ITERATOR_HPP
#include <boost/range/detail/common.hpp>
#include <boost/range/detail/remove_extent.hpp>
#include <boost/static_assert.hpp>
//////////////////////////////////////////////////////////////////////////////
// missing partial specialization workaround.
//////////////////////////////////////////////////////////////////////////////
namespace boost
{
namespace range_detail
{
template< typename T >
struct range_iterator_ {
template< typename C >
struct pts
{
typedef int type;
};
};
template<>
struct range_iterator_<std_container_>
{
template< typename C >
struct pts
{
typedef BOOST_RANGE_DEDUCED_TYPENAME C::iterator type;
};
};
template<>
struct range_iterator_<std_pair_>
{
template< typename P >
struct pts
{
typedef BOOST_RANGE_DEDUCED_TYPENAME P::first_type type;
};
};
template<>
struct range_iterator_<array_>
{
template< typename T >
struct pts
{
typedef BOOST_RANGE_DEDUCED_TYPENAME
remove_extent<T>::type* type;
};
};
}
template< typename C >
class range_mutable_iterator
{
typedef BOOST_RANGE_DEDUCED_TYPENAME range_detail::range<C>::type c_type;
public:
typedef typename range_detail::range_iterator_<c_type>::BOOST_NESTED_TEMPLATE pts<C>::type type;
};
}
#endif

View File

@@ -1,159 +0,0 @@
// Boost.Range library
//
// Copyright Thorsten Ottosen 2003-2004. 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/
//
#ifndef BOOST_RANGE_DETAIL_SIZE_HPP
#define BOOST_RANGE_DETAIL_SIZE_HPP
#include <boost/config.hpp> // BOOST_MSVC
#include <boost/detail/workaround.hpp>
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
# include <boost/range/detail/vc6/size.hpp>
#else
# include <boost/range/detail/implementation_help.hpp>
# include <boost/range/detail/size_type.hpp>
# include <boost/range/detail/common.hpp>
# if BOOST_WORKAROUND(BOOST_MSVC, == 1300)
# include <boost/range/detail/remove_extent.hpp>
# endif
# include <iterator>
namespace boost
{
namespace range_detail
{
template< typename T >
struct range_size_;
//////////////////////////////////////////////////////////////////////
// default
//////////////////////////////////////////////////////////////////////
template<>
struct range_size_<std_container_>
{
template< typename C >
static BOOST_RANGE_DEDUCED_TYPENAME C::size_type fun( const C& c )
{
return c.size();
};
};
//////////////////////////////////////////////////////////////////////
// pair
//////////////////////////////////////////////////////////////////////
template<>
struct range_size_<std_pair_>
{
template< typename P >
static BOOST_RANGE_DEDUCED_TYPENAME range_size<P>::type
fun( const P& p )
{
return std::distance( p.first, p.second );
}
};
//////////////////////////////////////////////////////////////////////
// array
//////////////////////////////////////////////////////////////////////
template<>
struct range_size_<array_>
{
#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
template< typename T, std::size_t sz >
static std::size_t fun( T BOOST_RANGE_ARRAY_REF()[sz] )
{
return sz;
}
#else
template<typename T>
static std::size_t fun(T& t)
{
return remove_extent<T>::size;
}
#endif
};
template<>
struct range_size_<char_array_>
{
template< typename T, std::size_t sz >
static std::size_t fun( T BOOST_RANGE_ARRAY_REF()[sz] )
{
return boost::range_detail::array_size( boost_range_array );
}
};
template<>
struct range_size_<wchar_t_array_>
{
template< typename T, std::size_t sz >
static std::size_t fun( T BOOST_RANGE_ARRAY_REF()[sz] )
{
return boost::range_detail::array_size( boost_range_array );
}
};
//////////////////////////////////////////////////////////////////////
// string
//////////////////////////////////////////////////////////////////////
template<>
struct range_size_<char_ptr_>
{
static std::size_t fun( const char* s )
{
return boost::range_detail::str_size( s );
}
};
template<>
struct range_size_<const_char_ptr_>
{
static std::size_t fun( const char* s )
{
return boost::range_detail::str_size( s );
}
};
template<>
struct range_size_<wchar_t_ptr_>
{
static std::size_t fun( const wchar_t* s )
{
return boost::range_detail::str_size( s );
}
};
template<>
struct range_size_<const_wchar_t_ptr_>
{
static std::size_t fun( const wchar_t* s )
{
return boost::range_detail::str_size( s );
}
};
} // namespace 'range_detail'
template< typename C >
BOOST_RANGE_DEDUCED_TYPENAME range_size<C>::type
size( const C& c )
{
return range_detail::range_size_< BOOST_RANGE_DEDUCED_TYPENAME range_detail::range<C>::type >::fun( c );
}
} // namespace 'boost'
# endif
#endif

2
include/boost/range/detail/sizer.hpp Executable file → Normal file
View File

@@ -11,7 +11,7 @@
#ifndef BOOST_RANGE_DETAIL_SIZER_HPP
#define BOOST_RANGE_DETAIL_SIZER_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#if defined(_MSC_VER)
# pragma once
#endif

View File

@@ -1,170 +0,0 @@
// Boost.Range library
//
// Copyright Thorsten Ottosen 2003-2004. 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/
//
#ifndef BOOST_RANGE_DETAIL_VC6_END_HPP
#define BOOST_RANGE_DETAIL_VC6_END_HPP
#include <boost/range/detail/implementation_help.hpp>
#include <boost/range/detail/implementation_help.hpp>
#include <boost/range/result_iterator.hpp>
#include <boost/range/detail/common.hpp>
#include <boost/range/detail/remove_extent.hpp>
namespace boost
{
namespace range_detail
{
template< typename T >
struct range_end;
//////////////////////////////////////////////////////////////////////
// default
//////////////////////////////////////////////////////////////////////
template<>
struct range_end<std_container_>
{
template< typename C >
struct inner {
static BOOST_RANGE_DEDUCED_TYPENAME range_result_iterator<C>::type
fun( C& c )
{
return c.end();
};
};
};
//////////////////////////////////////////////////////////////////////
// pair
//////////////////////////////////////////////////////////////////////
template<>
struct range_end<std_pair_>
{
template< typename P >
struct inner {
static BOOST_RANGE_DEDUCED_TYPENAME range_result_iterator<P>::type
fun( const P& p )
{
return p.second;
}
};
};
//////////////////////////////////////////////////////////////////////
// array
//////////////////////////////////////////////////////////////////////
template<>
struct range_end<array_>
{
template< typename T >
struct inner {
static BOOST_DEDUCED_TYPENAME remove_extent<T>::type*
fun(T& t)
{
return t + remove_extent<T>::size;
}
};
};
template<>
struct range_end<char_array_>
{
template< typename T >
struct inner {
static BOOST_DEDUCED_TYPENAME remove_extent<T>::type*
fun(T& t)
{
return t + remove_extent<T>::size;
}
};
};
template<>
struct range_end<wchar_t_array_>
{
template< typename T >
struct inner {
static BOOST_DEDUCED_TYPENAME remove_extent<T>::type*
fun(T& t)
{
return t + remove_extent<T>::size;
}
};
};
//////////////////////////////////////////////////////////////////////
// string
//////////////////////////////////////////////////////////////////////
template<>
struct range_end<char_ptr_>
{
template< typename T >
struct inner {
static char* fun( char* s )
{
return boost::range_detail::str_end( s );
}
};
};
template<>
struct range_end<const_char_ptr_>
{
template< typename T >
struct inner {
static const char* fun( const char* s )
{
return boost::range_detail::str_end( s );
}
};
};
template<>
struct range_end<wchar_t_ptr_>
{
template< typename T >
struct inner {
static wchar_t* fun( wchar_t* s )
{
return boost::range_detail::str_end( s );
}
};
};
template<>
struct range_end<const_wchar_t_ptr_>
{
template< typename T >
struct inner {
static const wchar_t* fun( const wchar_t* s )
{
return boost::range_detail::str_end( s );
}
};
};
} // namespace 'range_detail'
template< typename C >
inline BOOST_DEDUCED_TYPENAME range_result_iterator<C>::type
end( C& c )
{
return range_detail::range_end<range_detail::range<C>::type>::inner<C>::fun( c );
}
} // namespace 'boost'
#endif

View File

@@ -1,166 +0,0 @@
// Boost.Range library
//
// Copyright Thorsten Ottosen 2003-2004. 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/
//
#ifndef BOOST_RANGE_DETAIL_VC6_SIZE_HPP
#define BOOST_RANGE_DETAIL_VC6_SIZE_HPP
#include <boost/range/detail/implementation_help.hpp>
#include <boost/range/detail/size_type.hpp>
#include <boost/range/detail/common.hpp>
#include <boost/range/detail/remove_extent.hpp>
#include <iterator>
namespace boost
{
namespace range_detail
{
template< typename T >
struct range_size_;
//////////////////////////////////////////////////////////////////////
// default
//////////////////////////////////////////////////////////////////////
template<>
struct range_size_<std_container_>
{
template< typename C >
struct inner {
static BOOST_RANGE_DEDUCED_TYPENAME C::size_type fun( const C& c )
{
return c.size();
};
};
};
//////////////////////////////////////////////////////////////////////
// pair
//////////////////////////////////////////////////////////////////////
template<>
struct range_size_<std_pair_>
{
template< typename P >
struct inner {
static BOOST_RANGE_DEDUCED_TYPENAME range_size<P>::type
fun( const P& p )
{
return std::distance( p.first, p.second );
}
};
};
//////////////////////////////////////////////////////////////////////
// array
//////////////////////////////////////////////////////////////////////
template<>
struct range_size_<array_>
{
template<typename T>
struct inner {
static std::size_t fun(T& t)
{
return remove_extent<T>::size;
}
};
};
template<>
struct range_size_<char_array_>
{
template<typename T>
struct inner {
static std::size_t fun(T& t)
{
return sizeof(T) / sizeof(T[0]);
}
};
};
template<>
struct range_size_<wchar_t_array_>
{
template<typename T>
struct inner {
static std::size_t fun(T& t)
{
return sizeof(T) / sizeof(T[0]);
}
};
};
//////////////////////////////////////////////////////////////////////
// string
//////////////////////////////////////////////////////////////////////
template<>
struct range_size_<char_ptr_>
{
template<typename T>
struct inner {
static std::size_t fun( const char* s )
{
return boost::range_detail::str_size( s );
}
};
};
template<>
struct range_size_<const_char_ptr_>
{
template<typename T>
struct inner {
static std::size_t fun( const char* s )
{
return boost::range_detail::str_size( s );
}
};
};
template<>
struct range_size_<wchar_t_ptr_>
{
template<typename T>
struct inner {
static std::size_t fun( const wchar_t* s )
{
return boost::range_detail::str_size( s );
}
};
};
template<>
struct range_size_<const_wchar_t_ptr_>
{
template<typename T>
struct inner {
static std::size_t fun( const wchar_t* s )
{
return boost::range_detail::str_size( s );
}
};
};
} // namespace 'range_detail'
template< typename C >
BOOST_RANGE_DEDUCED_TYPENAME range_size<C>::type
size( const C& c )
{
return range_detail::range_size_<range_detail::range<C>::type>::inner<C>::fun( c );
}
} // namespace 'boost'
#endif

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

@@ -11,7 +11,7 @@
#ifndef BOOST_RANGE_DIFFERENCE_TYPE_HPP
#define BOOST_RANGE_DIFFERENCE_TYPE_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
#if defined(_MSC_VER)
# pragma once
#endif

2
include/boost/range/distance.hpp Executable file → Normal file
View File

@@ -11,7 +11,7 @@
#ifndef BOOST_RANGE_DISTANCE_HPP
#define BOOST_RANGE_DISTANCE_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
#if defined(_MSC_VER)
# pragma once
#endif

View File

@@ -11,7 +11,7 @@
#ifndef BOOST_RANGE_EMPTY_HPP
#define BOOST_RANGE_EMPTY_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
#if defined(_MSC_VER)
# pragma once
#endif

View File

@@ -11,7 +11,7 @@
#ifndef BOOST_RANGE_END_HPP
#define BOOST_RANGE_END_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
#if defined(_MSC_VER)
# pragma once
#endif
@@ -28,9 +28,7 @@
namespace boost
{
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) && \
!BOOST_WORKAROUND(__GNUC__, < 3) \
/**/
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
namespace range_detail
{
#endif
@@ -82,9 +80,7 @@ namespace range_detail
return range_detail::array_end<T,sz>( a );
}
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) && \
!BOOST_WORKAROUND(__GNUC__, < 3) \
/**/
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
} // namespace 'range_detail'
#endif
@@ -94,9 +90,7 @@ namespace range_adl_barrier
template< class T >
inline BOOST_DEDUCED_TYPENAME range_iterator<T>::type end( T& r )
{
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) && \
!BOOST_WORKAROUND(__GNUC__, < 3) \
/**/
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
using namespace range_detail;
#endif
return range_end( r );
@@ -105,9 +99,7 @@ inline BOOST_DEDUCED_TYPENAME range_iterator<T>::type end( T& r )
template< class T >
inline BOOST_DEDUCED_TYPENAME range_iterator<const T>::type end( const T& r )
{
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) && \
!BOOST_WORKAROUND(__GNUC__, < 3) \
/**/
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
using namespace range_detail;
#endif
return range_end( r );

2
include/boost/range/functions.hpp Executable file → Normal file
View File

@@ -11,7 +11,7 @@
#ifndef BOOST_RANGE_FUNCTIONS_HPP
#define BOOST_RANGE_FUNCTIONS_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
#if defined(_MSC_VER)
# pragma once
#endif

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

@@ -11,7 +11,7 @@
#ifndef BOOST_RANGE_ITERATOR_HPP
#define BOOST_RANGE_ITERATOR_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#if defined(_MSC_VER)
# pragma once
#endif
@@ -67,6 +67,4 @@ namespace boost
} // namespace boost
//#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
#endif

View File

@@ -24,6 +24,7 @@
#include <boost/mpl/or.hpp>
#include <boost/type_traits/is_abstract.hpp>
#include <boost/type_traits/is_array.hpp>
#include <boost/type_traits/is_convertible.hpp>
#include <boost/type_traits/is_pointer.hpp>
#include <boost/range/functions.hpp>
#include <boost/range/iterator.hpp>
@@ -77,7 +78,7 @@ namespace boost
template< class Left, class Right >
inline bool greater_than( const Left& l, const Right& r )
{
return less_than(r,l);
return iterator_range_detail::less_than(r,l);
}
template< class Left, class Right >
@@ -102,6 +103,8 @@ namespace boost
struct range_tag { };
struct const_range_tag { };
struct iterator_range_tag { };
}
// iterator range template class -----------------------------------------//
@@ -125,6 +128,7 @@ namespace boost
*/
template<class IteratorT>
class iterator_range
: public iterator_range_detail::iterator_range_tag
{
typedef range_detail::safe_bool< IteratorT iterator_range<IteratorT>::* > safe_bool_t;
protected: // Used by sub_range
@@ -207,14 +211,12 @@ namespace boost
m_Begin( impl::adl_begin( r ) ), m_End( impl::adl_end( r ) )
{}
#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
this_type& operator=( const this_type& r )
{
m_Begin = r.begin();
m_End = r.end();
return *this;
}
#endif
template< class Iterator >
iterator_range& operator=( const iterator_range<Iterator>& r )
@@ -270,46 +272,11 @@ namespace boost
return empty();
}
bool equal( const iterator_range& r ) const
bool equal(const iterator_range& r) const
{
return m_Begin == r.m_Begin && m_End == r.m_End;
}
#ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
bool operator==( const iterator_range& r ) const
{
return boost::equal( *this, r );
}
bool operator!=( const iterator_range& r ) const
{
return !operator==(r);
}
bool operator<( const iterator_range& r ) const
{
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
public: // convenience
reference front() const
{
@@ -385,138 +352,143 @@ namespace boost
/////////////////////////////////////////////////////////////////////
// comparison operators
/////////////////////////////////////////////////////////////////////
template< class IteratorT, class ForwardRange >
inline bool operator==( const ForwardRange& l,
const iterator_range<IteratorT>& r )
template<class SinglePassRange1, class SinglePassRange2>
inline BOOST_DEDUCED_TYPENAME enable_if<
mpl::or_<
is_convertible<
const SinglePassRange1&,
const iterator_range_detail::iterator_range_tag&
>,
is_convertible<
const SinglePassRange2&,
const iterator_range_detail::iterator_range_tag&
>
>,
bool
>::type
operator==(const SinglePassRange1& l, const SinglePassRange2& r)
{
return boost::equal( l, r );
BOOST_RANGE_CONCEPT_ASSERT((
boost::SinglePassRangeConcept<const SinglePassRange1>));
BOOST_RANGE_CONCEPT_ASSERT((
boost::SinglePassRangeConcept<const SinglePassRange2>));
return boost::equal(l, r);
}
template<class SinglePassRange1, class SinglePassRange2>
inline BOOST_DEDUCED_TYPENAME enable_if<
mpl::or_<
is_convertible<
const SinglePassRange1&,
const iterator_range_detail::iterator_range_tag&
>,
is_convertible<
const SinglePassRange2&,
const iterator_range_detail::iterator_range_tag&
>
>,
bool
>::type
operator!=(const SinglePassRange1& l, const SinglePassRange2& r)
{
BOOST_RANGE_CONCEPT_ASSERT((
boost::SinglePassRangeConcept<const SinglePassRange1>));
BOOST_RANGE_CONCEPT_ASSERT((
boost::SinglePassRangeConcept<const SinglePassRange2>));
return !boost::equal(l, r);
}
template< class IteratorT, class ForwardRange >
inline bool operator!=( const ForwardRange& l,
const iterator_range<IteratorT>& r )
template<class SinglePassRange1, class SinglePassRange2>
inline BOOST_DEDUCED_TYPENAME enable_if<
mpl::or_<
is_convertible<
const SinglePassRange1&,
const iterator_range_detail::iterator_range_tag&
>,
is_convertible<
const SinglePassRange2&,
const iterator_range_detail::iterator_range_tag&
>
>,
bool
>::type
operator<(const SinglePassRange1& l, const SinglePassRange2& r)
{
return !boost::equal( l, r );
BOOST_RANGE_CONCEPT_ASSERT((
boost::SinglePassRangeConcept<const SinglePassRange1>));
BOOST_RANGE_CONCEPT_ASSERT((
boost::SinglePassRangeConcept<const SinglePassRange2>));
return iterator_range_detail::less_than(l, r);
}
template< class IteratorT, class ForwardRange >
inline bool operator<( const ForwardRange& l,
const iterator_range<IteratorT>& r )
template<class SinglePassRange1, class SinglePassRange2>
inline BOOST_DEDUCED_TYPENAME enable_if<
mpl::or_<
is_convertible<
const SinglePassRange1&,
const iterator_range_detail::iterator_range_tag&
>,
is_convertible<
const SinglePassRange2&,
const iterator_range_detail::iterator_range_tag&
>
>,
bool
>::type
operator<=(const SinglePassRange1& l, const SinglePassRange2& r)
{
return iterator_range_detail::less_than( l, r );
BOOST_RANGE_CONCEPT_ASSERT((
boost::SinglePassRangeConcept<const SinglePassRange1>));
BOOST_RANGE_CONCEPT_ASSERT((
boost::SinglePassRangeConcept<const SinglePassRange2>));
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 )
template<class SinglePassRange1, class SinglePassRange2>
inline BOOST_DEDUCED_TYPENAME enable_if<
mpl::or_<
is_convertible<
const SinglePassRange1&,
const iterator_range_detail::iterator_range_tag&
>,
is_convertible<
const SinglePassRange2&,
const iterator_range_detail::iterator_range_tag&
>
>,
bool
>::type
operator>(const SinglePassRange1& l, const SinglePassRange2& r)
{
return iterator_range_detail::less_or_equal_than( l, r );
BOOST_RANGE_CONCEPT_ASSERT((
boost::SinglePassRangeConcept<const SinglePassRange1>));
BOOST_RANGE_CONCEPT_ASSERT((
boost::SinglePassRangeConcept<const SinglePassRange2>));
return iterator_range_detail::greater_than(l, r);
}
template< class IteratorT, class ForwardRange >
inline bool operator>( const ForwardRange& l,
const iterator_range<IteratorT>& r )
template<class SinglePassRange1, class SinglePassRange2>
inline BOOST_DEDUCED_TYPENAME enable_if<
mpl::or_<
is_convertible<
const SinglePassRange1&,
const iterator_range_detail::iterator_range_tag&
>,
is_convertible<
const SinglePassRange2&,
const iterator_range_detail::iterator_range_tag&
>
>,
bool
>::type
operator>=(const SinglePassRange1& l, const SinglePassRange2& r)
{
return iterator_range_detail::greater_than( l, r );
BOOST_RANGE_CONCEPT_ASSERT((
boost::SinglePassRangeConcept<const SinglePassRange1>));
BOOST_RANGE_CONCEPT_ASSERT((
boost::SinglePassRangeConcept<const SinglePassRange2>));
return iterator_range_detail::greater_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_or_equal_than( l, r );
}
#ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
#else
template< class Iterator1T, class Iterator2T >
inline bool operator==( const iterator_range<Iterator1T>& l,
const iterator_range<Iterator2T>& r )
{
return boost::equal( l, r );
}
template< class IteratorT, class ForwardRange >
inline bool operator==( const iterator_range<IteratorT>& l,
const ForwardRange& r )
{
return boost::equal( l, r );
}
template< class Iterator1T, class Iterator2T >
inline bool operator!=( const iterator_range<Iterator1T>& l,
const iterator_range<Iterator2T>& r )
{
return !boost::equal( l, r );
}
template< class IteratorT, class ForwardRange >
inline bool operator!=( const iterator_range<IteratorT>& l,
const ForwardRange& r )
{
return !boost::equal( 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_than( l, r );
}
template< class IteratorT, class ForwardRange >
inline bool operator<( const iterator_range<IteratorT>& l,
const ForwardRange& 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
// iterator range utilities -----------------------------------------//

View File

@@ -11,7 +11,7 @@
#ifndef BOOST_RANGE_METAFUNCTIONS_HPP
#define BOOST_RANGE_METAFUNCTIONS_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
#if defined(_MSC_VER)
# pragma once
#endif

View File

@@ -11,15 +11,12 @@
#ifndef BOOST_RANGE_MUTABLE_ITERATOR_HPP
#define BOOST_RANGE_MUTABLE_ITERATOR_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
#if defined(_MSC_VER)
# pragma once
#endif
#include <boost/range/config.hpp>
#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
#include <boost/range/detail/iterator.hpp>
#else
#include <boost/range/detail/extract_optional_type.hpp>
#include <boost/iterator/iterator_traits.hpp>
@@ -62,6 +59,5 @@ namespace boost
} // namespace boost
#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
#endif

View File

@@ -19,7 +19,7 @@
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#if defined(_MSC_VER) && _MSC_VER >= 1000
#if defined(_MSC_VER)
#pragma once
#endif

2
include/boost/range/pointer.hpp Executable file → Normal file
View File

@@ -11,7 +11,7 @@
#ifndef BOOST_RANGE_POINTER_TYPE_HPP
#define BOOST_RANGE_POINTER_TYPE_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
#if defined(_MSC_VER)
# pragma once
#endif

2
include/boost/range/rbegin.hpp Executable file → Normal file
View File

@@ -11,7 +11,7 @@
#ifndef BOOST_RANGE_RBEGIN_HPP
#define BOOST_RANGE_RBEGIN_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
#if defined(_MSC_VER)
# pragma once
#endif

2
include/boost/range/reference.hpp Executable file → Normal file
View File

@@ -11,7 +11,7 @@
#ifndef BOOST_RANGE_REFERENCE_TYPE_HPP
#define BOOST_RANGE_REFERENCE_TYPE_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
#if defined(_MSC_VER)
# pragma once
#endif

2
include/boost/range/rend.hpp Executable file → Normal file
View File

@@ -11,7 +11,7 @@
#ifndef BOOST_RANGE_REND_HPP
#define BOOST_RANGE_REND_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
#if defined(_MSC_VER)
# pragma once
#endif

2
include/boost/range/result_iterator.hpp Executable file → Normal file
View File

@@ -11,7 +11,7 @@
#ifndef BOOST_RANGE_RESULT_ITERATOR_HPP
#define BOOST_RANGE_RESULT_ITERATOR_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#if defined(_MSC_VER)
# pragma once
#endif

2
include/boost/range/reverse_iterator.hpp Executable file → Normal file
View File

@@ -11,7 +11,7 @@
#ifndef BOOST_RANGE_REVERSE_ITERATOR_HPP
#define BOOST_RANGE_REVERSE_ITERATOR_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
#if defined(_MSC_VER)
# pragma once
#endif

2
include/boost/range/reverse_result_iterator.hpp Executable file → Normal file
View File

@@ -11,7 +11,7 @@
#ifndef BOOST_RANGE_REVERSE_RESULT_ITERATOR_HPP
#define BOOST_RANGE_REVERSE_RESULT_ITERATOR_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#if defined(_MSC_VER)
# pragma once
#endif

View File

@@ -11,7 +11,7 @@
#ifndef BOOST_RANGE_SIZE_HPP
#define BOOST_RANGE_SIZE_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
#if defined(_MSC_VER)
# pragma once
#endif

View File

@@ -11,16 +11,13 @@
#ifndef BOOST_RANGE_SIZE_TYPE_HPP
#define BOOST_RANGE_SIZE_TYPE_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#if defined(_MSC_VER)
# pragma once
#endif
#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
#include <boost/utility/enable_if.hpp>
#include <boost/type_traits/make_unsigned.hpp>
@@ -96,7 +93,6 @@ namespace boost
} // namespace boost
#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
#endif

6
include/boost/range/value_type.hpp Executable file → Normal file
View File

@@ -11,17 +11,13 @@
#ifndef BOOST_RANGE_VALUE_TYPE_HPP
#define BOOST_RANGE_VALUE_TYPE_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
#if defined(_MSC_VER)
# pragma once
#endif
#include <boost/range/config.hpp>
#include <boost/range/iterator.hpp>
//#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
//#include <boost/range/detail/value_type.hpp>
//#else
#include <boost/iterator/iterator_traits.hpp>
namespace boost

View File

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

View File

@@ -11,6 +11,9 @@
// The strided_defect_Trac5014 test case is a modified version of a test case
// contributed by Michel Morin as part of the trac ticket.
//
// The deque test case has been removed due to erroneous standard library
// implementations causing test failures.
//
#include <boost/range/adaptor/strided.hpp>
#include <boost/config.hpp>
@@ -21,7 +24,6 @@
#include <boost/range/algorithm_ext.hpp>
#include <algorithm>
#include <deque>
#include <vector>
namespace boost
@@ -160,7 +162,6 @@ namespace boost
void strided_test()
{
strided_test_impl< std::vector<int> >();
strided_test_impl< std::deque<int> >();
strided_test_impl< std::list<int> >();
}

View File

@@ -14,6 +14,7 @@
#include <boost/range/algorithm/fill.hpp>
#include <boost/assign.hpp>
#include <boost/array.hpp>
#include <boost/cstdint.hpp>
#include <algorithm>
#include <list>
@@ -30,12 +31,12 @@ namespace boost_range_adaptor_type_erased_test
{
}
MockType(int x)
MockType(boost::int32_t x)
: m_x(x)
{
}
int get() const { return m_x; }
boost::int32_t get() const { return m_x; }
inline bool operator==(const MockType& other) const
{
@@ -48,7 +49,15 @@ namespace boost_range_adaptor_type_erased_test
}
private:
int m_x;
boost::int32_t m_x;
};
class MockType2 : public MockType
{
public:
MockType2() {}
MockType2(boost::int32_t x) : MockType(x) { }
MockType2(const MockType& other) : MockType(other) { }
};
inline std::ostream& operator<<(std::ostream& out, const MockType& obj)
@@ -418,15 +427,12 @@ namespace boost_range_adaptor_type_erased_test
template<class Traversal>
void test_type_erased_mix_values_driver()
{
test_type_erased_mix_values_impl< Traversal, int, char, const int&, short, const int& >();
test_type_erased_mix_values_impl< Traversal, int, int*, const int&, char, const int& >();
test_type_erased_mix_values_impl< Traversal, MockType, char, const MockType&, short, const MockType& >();
// In fact value type should have no effect in the eligibility
// for conversion, hence we should be able to convert it
// completely backwards!
test_type_erased_mix_values_impl< Traversal, int, short, const int&, char, const int& >();
test_type_erased_mix_values_impl< Traversal, int, char, const int&, int*, const int& >();
test_type_erased_mix_values_impl<
Traversal,
MockType,
MockType2, const MockType&,
MockType, const MockType&
>();
}
void test_type_erased_mix_values()

View File

@@ -20,6 +20,7 @@
#include <boost/test/test_tools.hpp>
#include <boost/test/unit_test.hpp>
#include <boost/static_assert.hpp>
#include <boost/cstdint.hpp>
#include <list>
#include <vector>

View File

@@ -0,0 +1,47 @@
// Boost.Range library
//
// Copyright Neil Groves 2014. 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/adaptor/indirected.hpp>
#include <boost/optional.hpp>
#include <boost/test/test_tools.hpp>
#include <boost/test/unit_test.hpp>
#include <vector>
namespace boost
{
namespace
{
void test_ticket_5811_indirected_optional()
{
std::vector<boost::optional<int> > v;
std::vector<int> r;
for (int i = 0; i < 10; ++i)
{
v.push_back(i);
r.push_back(i);
}
BOOST_CHECK_EQUAL_COLLECTIONS(r.begin(), r.end(),
v.begin(), v.end());
}
}
}
boost::unit_test::test_suite*
init_unit_test_suite(int argc, char* argv[])
{
boost::unit_test::test_suite* test
= BOOST_TEST_SUITE("RangeTestSuite.ticket_5811_indirected_optional");
test->add(BOOST_TEST_CASE(&boost::test_ticket_5811_indirected_optional));
return test;
}

View File

@@ -0,0 +1,44 @@
// Boost.Range library
//
// Copyright Neil Groves 2014. 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/iterator_range_core.hpp>
#include <boost/test/test_tools.hpp>
#include <boost/test/unit_test.hpp>
namespace boost
{
namespace
{
class str_ref : public boost::iterator_range<const char*>
{
};
void test_ticket_6715_iterator_range_equality()
{
str_ref a;
str_ref b;
BOOST_CHECK(a == b);
}
}
}
boost::unit_test::test_suite*
init_unit_test_suite(int argc, char* argv[])
{
boost::unit_test::test_suite* test
= BOOST_TEST_SUITE(
"RangeTestSuite.ticket_6715_iterator_range_equality");
test->add(BOOST_TEST_CASE(
&boost::test_ticket_6715_iterator_range_equality));
return test;
}