Skip to content

Commit 5476f97

Browse files
committed
Python: Simplify object_operators implementation.
The old-MSVC-specific version is no longer needed. [SVN r85898]
1 parent da01e9b commit 5476f97

File tree

3 files changed

+6
-60
lines changed

3 files changed

+6
-60
lines changed

include/boost/python/object_core.hpp

Lines changed: 5 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,6 @@
3636
# include <boost/type_traits/is_convertible.hpp>
3737
# include <boost/type_traits/remove_reference.hpp>
3838

39-
# if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
40-
# include <boost/type_traits/add_pointer.hpp>
41-
# endif
42-
43-
# include <boost/mpl/if.hpp>
44-
4539
namespace boost { namespace python {
4640

4741
namespace detail
@@ -98,11 +92,7 @@ namespace api
9892
class object_operators : public def_visitor<U>
9993
{
10094
protected:
101-
# if !defined(BOOST_MSVC) || BOOST_MSVC >= 1300
10295
typedef object const& object_cref;
103-
# else
104-
typedef object object_cref;
105-
# endif
10696
public:
10797
// function call
10898
//
@@ -139,25 +129,11 @@ namespace api
139129

140130
template <class T>
141131
const_object_item
142-
operator[](T const& key) const
143-
# if !defined(BOOST_MSVC) || BOOST_MSVC > 1300
144-
;
145-
# else
146-
{
147-
return (*this)[object(key)];
148-
}
149-
# endif
132+
operator[](T const& key) const;
150133

151134
template <class T>
152135
object_item
153-
operator[](T const& key)
154-
# if !defined(BOOST_MSVC) || BOOST_MSVC > 1300
155-
;
156-
# else
157-
{
158-
return (*this)[object(key)];
159-
}
160-
# endif
136+
operator[](T const& key);
161137

162138
// slicing
163139
//
@@ -175,29 +151,11 @@ namespace api
175151

176152
template <class T, class V>
177153
const_object_slice
178-
slice(T const& start, V const& end) const
179-
# if !defined(BOOST_MSVC) || BOOST_MSVC > 1300
180-
;
181-
# else
182-
{
183-
return this->slice(
184-
slice_bound<T>::type(start)
185-
, slice_bound<V>::type(end));
186-
}
187-
# endif
154+
slice(T const& start, V const& end) const;
188155

189156
template <class T, class V>
190157
object_slice
191-
slice(T const& start, V const& end)
192-
# if !defined(BOOST_MSVC) || BOOST_MSVC > 1300
193-
;
194-
# else
195-
{
196-
return this->slice(
197-
slice_bound<T>::type(start)
198-
, slice_bound<V>::type(end));
199-
}
200-
# endif
158+
slice(T const& start, V const& end);
201159

202160
private: // def visitation for adding callable objects as class methods
203161

@@ -323,14 +281,7 @@ namespace api
323281

324282
// explicit conversion from any C++ object to Python
325283
template <class T>
326-
explicit object(
327-
T const& x
328-
# if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
329-
// use some SFINAE to un-confuse MSVC about its
330-
// copy-initialization ambiguity claim.
331-
, typename mpl::if_<is_proxy<T>,int&,int>::type* = 0
332-
# endif
333-
)
284+
explicit object(T const& x)
334285
: object_base(object_base_initializer(x))
335286
{
336287
}

include/boost/python/object_items.hpp

100755100644
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ object_operators<U>::operator[](object_cref key) const
4444
return const_object_item(x, key);
4545
}
4646

47-
# if !defined(BOOST_MSVC) || BOOST_MSVC > 1300
4847
template <class U>
4948
template <class T>
5049
inline const_object_item
@@ -60,8 +59,6 @@ object_operators<U>::operator[](T const& key)
6059
{
6160
return (*this)[object(key)];
6261
}
63-
# endif
64-
6562

6663
inline object const_item_policies::get(object const& target, object const& key)
6764
{

include/boost/python/object_slices.hpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ object_operators<U>::slice(object_cref start, slice_nil) const
9999
object_cref2 x = *static_cast<U const*>(this);
100100
return const_object_slice(x, api::slice_key(borrowed(start.ptr()), allow_null((PyObject*)0)));
101101
}
102-
# if !defined(BOOST_MSVC) || BOOST_MSVC > 1300
102+
103103
template <class U>
104104
template <class T, class V>
105105
inline const_object_slice
@@ -119,8 +119,6 @@ object_operators<U>::slice(T const& start, V const& end)
119119
typename slice_bound<T>::type(start)
120120
, typename slice_bound<V>::type(end));
121121
}
122-
# endif
123-
124122

125123
inline object const_slice_policies::get(object const& target, key_type const& key)
126124
{

0 commit comments

Comments
 (0)