Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r85898 - trunk/boost/python
From: steveire_at_[hidden]
Date: 2013-09-25 07:20:43


Author: skelly
Date: 2013-09-25 07:20:43 EDT (Wed, 25 Sep 2013)
New Revision: 85898
URL: http://svn.boost.org/trac/boost/changeset/85898

Log:
Python: Simplify object_operators implementation.

The old-MSVC-specific version is no longer needed.

Text files modified:
   trunk/boost/python/object_core.hpp | 59 +++------------------------------------
   trunk/boost/python/object_items.hpp | 3 --
   trunk/boost/python/object_slices.hpp | 4 --
   3 files changed, 6 insertions(+), 60 deletions(-)

Modified: trunk/boost/python/object_core.hpp
==============================================================================
--- trunk/boost/python/object_core.hpp Wed Sep 25 06:29:59 2013 (r85897)
+++ trunk/boost/python/object_core.hpp 2013-09-25 07:20:43 EDT (Wed, 25 Sep 2013) (r85898)
@@ -36,12 +36,6 @@
 # include <boost/type_traits/is_convertible.hpp>
 # include <boost/type_traits/remove_reference.hpp>
 
-# if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
-# include <boost/type_traits/add_pointer.hpp>
-# endif
-
-# include <boost/mpl/if.hpp>
-
 namespace boost { namespace python {
 
 namespace detail
@@ -98,11 +92,7 @@
   class object_operators : public def_visitor<U>
   {
    protected:
-# if !defined(BOOST_MSVC) || BOOST_MSVC >= 1300
       typedef object const& object_cref;
-# else
- typedef object object_cref;
-# endif
    public:
       // function call
       //
@@ -139,25 +129,11 @@
     
       template <class T>
       const_object_item
- operator[](T const& key) const
-# if !defined(BOOST_MSVC) || BOOST_MSVC > 1300
- ;
-# else
- {
- return (*this)[object(key)];
- }
-# endif
+ operator[](T const& key) const;
     
       template <class T>
       object_item
- operator[](T const& key)
-# if !defined(BOOST_MSVC) || BOOST_MSVC > 1300
- ;
-# else
- {
- return (*this)[object(key)];
- }
-# endif
+ operator[](T const& key);
 
       // slicing
       //
@@ -175,29 +151,11 @@
 
       template <class T, class V>
       const_object_slice
- slice(T const& start, V const& end) const
-# if !defined(BOOST_MSVC) || BOOST_MSVC > 1300
- ;
-# else
- {
- return this->slice(
- slice_bound<T>::type(start)
- , slice_bound<V>::type(end));
- }
-# endif
+ slice(T const& start, V const& end) const;
     
       template <class T, class V>
       object_slice
- slice(T const& start, V const& end)
-# if !defined(BOOST_MSVC) || BOOST_MSVC > 1300
- ;
-# else
- {
- return this->slice(
- slice_bound<T>::type(start)
- , slice_bound<V>::type(end));
- }
-# endif
+ slice(T const& start, V const& end);
       
    private: // def visitation for adding callable objects as class methods
       
@@ -323,14 +281,7 @@
       
       // explicit conversion from any C++ object to Python
       template <class T>
- explicit object(
- T const& x
-# if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
- // use some SFINAE to un-confuse MSVC about its
- // copy-initialization ambiguity claim.
- , typename mpl::if_<is_proxy<T>,int&,int>::type* = 0
-# endif
- )
+ explicit object(T const& x)
         : object_base(object_base_initializer(x))
       {
       }

Modified: trunk/boost/python/object_items.hpp
==============================================================================
--- trunk/boost/python/object_items.hpp Wed Sep 25 06:29:59 2013 (r85897)
+++ trunk/boost/python/object_items.hpp 2013-09-25 07:20:43 EDT (Wed, 25 Sep 2013) (r85898)
@@ -44,7 +44,6 @@
     return const_object_item(x, key);
 }
 
-# if !defined(BOOST_MSVC) || BOOST_MSVC > 1300
 template <class U>
 template <class T>
 inline const_object_item
@@ -60,8 +59,6 @@
 {
     return (*this)[object(key)];
 }
-# endif
-
 
 inline object const_item_policies::get(object const& target, object const& key)
 {

Modified: trunk/boost/python/object_slices.hpp
==============================================================================
--- trunk/boost/python/object_slices.hpp Wed Sep 25 06:29:59 2013 (r85897)
+++ trunk/boost/python/object_slices.hpp 2013-09-25 07:20:43 EDT (Wed, 25 Sep 2013) (r85898)
@@ -99,7 +99,7 @@
     object_cref2 x = *static_cast<U const*>(this);
     return const_object_slice(x, api::slice_key(borrowed(start.ptr()), allow_null((PyObject*)0)));
 }
-# if !defined(BOOST_MSVC) || BOOST_MSVC > 1300
+
 template <class U>
 template <class T, class V>
 inline const_object_slice
@@ -119,8 +119,6 @@
         typename slice_bound<T>::type(start)
         , typename slice_bound<V>::type(end));
 }
-# endif
-
 
 inline object const_slice_policies::get(object const& target, key_type const& key)
 {


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk