Replace is_copy_constructible and is_abstract with is_convertible

This commit is contained in:
code@jendruk.com
2019-05-08 17:21:45 +02:00
parent 9f03cc44d8
commit 1bf2db29c0

View File

@ -13,12 +13,9 @@
#include <boost/range/detail/any_iterator_buffer.hpp> #include <boost/range/detail/any_iterator_buffer.hpp>
#include <boost/iterator/iterator_categories.hpp> #include <boost/iterator/iterator_categories.hpp>
#include <boost/mpl/not.hpp> #include <boost/mpl/not.hpp>
#include <boost/type_traits/add_const.hpp> #include <boost/type_traits/decay.hpp>
#include <boost/type_traits/add_reference.hpp> #include <boost/type_traits/is_convertible.hpp>
#include <boost/type_traits/is_abstract.hpp>
#include <boost/type_traits/is_copy_constructible.hpp>
#include <boost/type_traits/is_reference.hpp> #include <boost/type_traits/is_reference.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <boost/type_traits/remove_reference.hpp> #include <boost/type_traits/remove_reference.hpp>
namespace boost namespace boost
@ -40,16 +37,11 @@ namespace boost
template<class T> template<class T>
struct reference_as_value_type_generator struct reference_as_value_type_generator
{ {
typedef typename remove_const< typedef typename decay<T>::type decayed_type;
typename remove_reference<T>::type
>::type const_reference_stripped_type;
typedef typename mpl::if_< typedef typename mpl::if_<
typename mpl::or_< typename is_convertible<const decayed_type&, decayed_type>::type,
mpl::not_<typename is_abstract<const_reference_stripped_type>::type>, decayed_type,
typename is_copy_constructible<const_reference_stripped_type>::type
>::type,
const_reference_stripped_type,
T T
>::type type; >::type type;
}; };