summaryrefslogtreecommitdiff
path: root/boost/python/object
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2016-10-06 10:30:07 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2016-10-06 10:32:57 +0900
commit71d216b90256936a9638f325af9bc69d720e75de (patch)
tree9c5f682d341c7c88ad0c8e3d4b262e00b6fb691a /boost/python/object
parent733b5d5ae2c5d625211e2985ac25728ac3f54883 (diff)
downloadboost-71d216b90256936a9638f325af9bc69d720e75de.tar.gz
boost-71d216b90256936a9638f325af9bc69d720e75de.tar.bz2
boost-71d216b90256936a9638f325af9bc69d720e75de.zip
Imported Upstream version 1.59.0
Change-Id: I2dde00f4eca71df3eea9d251dcaecde18a6c90a5 Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'boost/python/object')
-rw-r--r--boost/python/object/class_metadata.hpp4
-rw-r--r--boost/python/object/forward.hpp101
-rw-r--r--boost/python/object/iterator.hpp28
-rw-r--r--boost/python/object/pointer_holder.hpp6
-rw-r--r--boost/python/object/value_holder.hpp6
5 files changed, 3 insertions, 142 deletions
diff --git a/boost/python/object/class_metadata.hpp b/boost/python/object/class_metadata.hpp
index 155ae35d06..c71cf67c4e 100644
--- a/boost/python/object/class_metadata.hpp
+++ b/boost/python/object/class_metadata.hpp
@@ -53,11 +53,7 @@ struct register_base_of
template <class Base>
inline void operator()(Base*) const
{
-# if !BOOST_WORKAROUND(BOOST_MSVC, == 1200)
BOOST_MPL_ASSERT_NOT((is_same<Base,Derived>));
-# else
- BOOST_STATIC_ASSERT(!(is_same<Base,Derived>::value));
-# endif
// Register the Base class
register_dynamic_id<Base>();
diff --git a/boost/python/object/forward.hpp b/boost/python/object/forward.hpp
index 2faf3321ec..30613d8ebd 100644
--- a/boost/python/object/forward.hpp
+++ b/boost/python/object/forward.hpp
@@ -12,13 +12,7 @@
# include <boost/ref.hpp>
# include <boost/python/detail/value_arg.hpp>
# include <boost/python/detail/copy_ctor_mutates_rhs.hpp>
-# if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
-# include <boost/type_traits/is_enum.hpp>
-# include <boost/mpl/and.hpp>
-# include <boost/mpl/not.hpp>
-# else
-# include <boost/mpl/or.hpp>
-# endif
+# include <boost/mpl/or.hpp>
namespace boost { namespace python { namespace objects {
@@ -42,24 +36,13 @@ struct reference_to_value
template <class T>
struct forward
: mpl::if_<
-# if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
- // vc6 chokes on unforwarding enums nested in classes
- mpl::and_<
- is_scalar<T>
- , mpl::not_<
- is_enum<T>
- >
- >
-# else
mpl::or_<python::detail::copy_ctor_mutates_rhs<T>, is_scalar<T> >
-# endif
, T
, reference_to_value<T>
>
{
};
-# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
template<typename T>
struct unforward
{
@@ -86,88 +69,6 @@ struct unforward_cref<reference_to_value<T> >
{
};
-# else // no partial specialization
-
-namespace detail
-{
- typedef char (&yes_reference_to_value_t)[1];
- typedef char (&no_reference_to_value_t)[2];
-
- no_reference_to_value_t is_reference_to_value_test(...);
-
- template<typename T>
- yes_reference_to_value_t is_reference_to_value_test(boost::type< reference_to_value<T> >);
-
- template<bool wrapped>
- struct unforwarder
- {
- template <class T>
- struct apply
- {
- typedef typename unwrap_reference<T>::type& type;
- };
- };
-
- template<>
- struct unforwarder<true>
- {
- template <class T>
- struct apply
- {
- typedef typename T::reference type;
- };
- };
-
- template<bool wrapped = false>
- struct cref_unforwarder
- {
- template <class T>
- struct apply
- : python::detail::value_arg<
- typename unwrap_reference<T>::type
- >
- {
- };
- };
-
- template<>
- struct cref_unforwarder<true>
- {
- template <class T>
- struct apply
- : python::detail::value_arg<
- typename T::reference
- >
- {
- };
- };
-
- template<typename T>
- struct is_reference_to_value
- {
- BOOST_STATIC_CONSTANT(
- bool, value = (
- sizeof(is_reference_to_value_test(boost::type<T>()))
- == sizeof(yes_reference_to_value_t)));
- typedef mpl::bool_<value> type;
- };
-}
-
-template <typename T>
-struct unforward
- : public detail::unforwarder<
- detail::is_reference_to_value<T>::value
- >::template apply<T>
-{};
-
-template <typename T>
-struct unforward_cref
- : public detail::cref_unforwarder<
- detail::is_reference_to_value<T>::value
- >::template apply<T>
-{};
-
-# endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
template <class T>
typename reference_to_value<T>::reference
diff --git a/boost/python/object/iterator.hpp b/boost/python/object/iterator.hpp
index ab748fe82d..db5224713f 100644
--- a/boost/python/object/iterator.hpp
+++ b/boost/python/object/iterator.hpp
@@ -71,35 +71,7 @@ struct iterator_range
# endif
};
-# ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
- // for compilers which can't deduce the value_type of pointers, we
- // have a special implementation of next. This takes advantage of
- // the fact that T* results are treated like T& results by
- // Boost.Python's function wrappers.
- struct next_ptr
- {
- typedef Iterator result_type;
-
- result_type
- operator()(iterator_range<NextPolicies,Iterator>& self)
- {
- if (self.m_start == self.m_finish)
- stop_iteration_error();
- return self.m_start++;
- }
- };
-
- typedef mpl::if_<
- is_same<
- boost::detail::please_invoke_BOOST_TT_BROKEN_COMPILER_SPEC_on_cv_unqualified_pointee<Iterator>
- , typename traits_t::value_type
- >
- , next_ptr
- , next
- >::type next_fn;
-# else
typedef next next_fn;
-# endif
object m_sequence; // Keeps the sequence alive while iterating.
Iterator m_start;
diff --git a/boost/python/object/pointer_holder.hpp b/boost/python/object/pointer_holder.hpp
index 4627e34ad2..27d95193a0 100644
--- a/boost/python/object/pointer_holder.hpp
+++ b/boost/python/object/pointer_holder.hpp
@@ -46,11 +46,7 @@ template <class T> class wrapper;
namespace boost { namespace python { namespace objects {
-# if BOOST_WORKAROUND(__GNUC__, == 2)
-# define BOOST_PYTHON_UNFORWARD_LOCAL(z, n, _) BOOST_PP_COMMA_IF(n) (typename unforward<A##n>::type)objects::do_unforward(a##n,0)
-# else
-# define BOOST_PYTHON_UNFORWARD_LOCAL(z, n, _) BOOST_PP_COMMA_IF(n) objects::do_unforward(a##n,0)
-# endif
+#define BOOST_PYTHON_UNFORWARD_LOCAL(z, n, _) BOOST_PP_COMMA_IF(n) objects::do_unforward(a##n,0)
template <class Pointer, class Value>
struct pointer_holder : instance_holder
diff --git a/boost/python/object/value_holder.hpp b/boost/python/object/value_holder.hpp
index f4d452cab1..a4e91786d1 100644
--- a/boost/python/object/value_holder.hpp
+++ b/boost/python/object/value_holder.hpp
@@ -33,11 +33,7 @@
namespace boost { namespace python { namespace objects {
-# if BOOST_WORKAROUND(__GNUC__, == 2)
-# define BOOST_PYTHON_UNFORWARD_LOCAL(z, n, _) BOOST_PP_COMMA_IF(n) (typename unforward<A##n>::type)objects::do_unforward(a##n,0)
-# else
-# define BOOST_PYTHON_UNFORWARD_LOCAL(z, n, _) BOOST_PP_COMMA_IF(n) objects::do_unforward(a##n,0)
-# endif
+#define BOOST_PYTHON_UNFORWARD_LOCAL(z, n, _) BOOST_PP_COMMA_IF(n) objects::do_unforward(a##n,0)
template <class Value>
struct value_holder : instance_holder