Merge branch 'develop' - small fixes in addition to a more major fix for adaptors

producing iterators that did not have default constructors.
This commit is contained in:
Neil Groves
2014-06-16 22:51:08 +01:00
80 changed files with 340 additions and 91 deletions

View File

@ -10,7 +10,6 @@
#ifndef BOOST_RANGE_DETAIL_ANY_ITERATOR_HPP_INCLUDED
#define BOOST_RANGE_DETAIL_ANY_ITERATOR_HPP_INCLUDED
#include <boost/cast.hpp>
#include <boost/mpl/and.hpp>
#include <boost/mpl/or.hpp>
#include <boost/mpl/not.hpp>

View File

@ -10,7 +10,7 @@
#ifndef BOOST_RANGE_DETAIL_ANY_ITERATOR_WRAPPER_HPP_INCLUDED
#define BOOST_RANGE_DETAIL_ANY_ITERATOR_WRAPPER_HPP_INCLUDED
#include <boost/cast.hpp>
#include <boost/polymorphic_cast.hpp>
#include <boost/range/config.hpp>
#include <boost/range/detail/any_iterator_interface.hpp>
#include <boost/range/concepts.hpp>

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

View File

@ -0,0 +1,64 @@
// 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/
//
#ifndef BOOST_RANGE_DETAIL_DEFAULT_CONSTRUCTIBLE_UNARY_FN_HPP_INCLUDED
#define BOOST_RANGE_DETAIL_DEFAULT_CONSTRUCTIBLE_UNARY_FN_HPP_INCLUDED
#include <boost/optional/optional.hpp>
#include <boost/mpl/if.hpp>
#include <boost/type_traits/has_trivial_constructor.hpp>
namespace boost
{
namespace range_detail
{
template<typename F, typename R>
class default_constructible_unary_fn_wrapper
{
public:
typedef R result_type;
default_constructible_unary_fn_wrapper()
{
}
default_constructible_unary_fn_wrapper(const F& source)
: m_impl(source)
{
}
template<typename Arg>
R operator()(const Arg& arg) const
{
BOOST_ASSERT(m_impl);
return (*m_impl)(arg);
}
template<typename Arg>
R operator()(Arg& arg) const
{
BOOST_ASSERT(m_impl);
return (*m_impl)(arg);
}
private:
boost::optional<F> m_impl;
};
template<typename F, typename R>
struct default_constructible_unary_fn_gen
{
typedef typename boost::mpl::if_<
boost::has_trivial_default_constructor<F>,
F,
default_constructible_unary_fn_wrapper<F,R>
>::type type;
};
} // namespace range_detail
} // namespace boost
#endif // include guard

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

View File

@ -15,36 +15,32 @@
#endif
#include <boost/config.hpp>
#include <boost/preprocessor/cat.hpp>
#include <boost/mpl/has_xxx.hpp>
#ifdef BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS
#define BOOST_RANGE_EXTRACT_OPTIONAL_TYPE( a_typedef ) \
template< typename C > \
struct extract_ ## a_typedef \
{ \
typedef BOOST_DEDUCED_TYPENAME C::a_typedef type; \
};
#else
namespace boost {
namespace range_detail {
template< typename T > struct exists { typedef void type; };
}
}
#if !defined(BOOST_MPL_CFG_NO_HAS_XXX)
// Defines extract_some_typedef<T> which exposes T::some_typedef as
// extract_some_typedef<T>::type if T::some_typedef exists. Otherwise
// extract_some_typedef<T> is empty.
#define BOOST_RANGE_EXTRACT_OPTIONAL_TYPE( a_typedef ) \
template< typename C, typename Enable=void > \
struct extract_ ## a_typedef \
{}; \
template< typename C > \
struct extract_ ## a_typedef< C \
, BOOST_DEDUCED_TYPENAME boost::range_detail::exists< BOOST_DEDUCED_TYPENAME C::a_typedef >::type \
> { \
typedef BOOST_DEDUCED_TYPENAME C::a_typedef type; \
#define BOOST_RANGE_EXTRACT_OPTIONAL_TYPE( a_typedef ) \
BOOST_MPL_HAS_XXX_TRAIT_DEF(a_typedef) \
template< typename C, bool B = BOOST_PP_CAT(has_, a_typedef)<C>::value > \
struct BOOST_PP_CAT(extract_, a_typedef) \
{}; \
template< typename C > \
struct BOOST_PP_CAT(extract_, a_typedef)< C, true > \
{ \
typedef BOOST_DEDUCED_TYPENAME C::a_typedef type; \
};
#else
#define BOOST_RANGE_EXTRACT_OPTIONAL_TYPE( a_typedef ) \
template< typename C > \
struct BOOST_PP_CAT(extract_, a_typedef) \
{ \
typedef BOOST_DEDUCED_TYPENAME C::a_typedef type; \
};
#endif

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

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

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

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

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