mirror of
https://github.com/boostorg/python.git
synced 2026-01-26 06:42:27 +00:00
Fix const-correctness problem
[SVN r20135]
This commit is contained in:
@@ -15,39 +15,43 @@
|
||||
# include <boost/mpl/if.hpp>
|
||||
|
||||
namespace boost { namespace python {
|
||||
namespace detail {
|
||||
template <class Pointer>
|
||||
struct opaque_conversion_holder {
|
||||
inline PyObject *operator () (Pointer p) {
|
||||
static opaque_pointer_converter<Pointer> converter (
|
||||
typeid (Pointer).name());
|
||||
|
||||
return converter.convert(p);
|
||||
}
|
||||
};
|
||||
namespace detail
|
||||
{
|
||||
template <class Pointer>
|
||||
struct opaque_conversion_holder
|
||||
{
|
||||
inline PyObject *operator()(Pointer p) const
|
||||
{
|
||||
static opaque_pointer_converter<Pointer> converter (
|
||||
typeid (Pointer).name());
|
||||
|
||||
template <class R>
|
||||
struct return_opaque_pointer_requires_a_pointer_type
|
||||
return converter.convert(p);
|
||||
}
|
||||
};
|
||||
|
||||
template <class R>
|
||||
struct return_opaque_pointer_requires_a_pointer_type
|
||||
# if defined(__GNUC__) && __GNUC__ >= 3 || defined(__EDG__)
|
||||
{}
|
||||
{}
|
||||
# endif
|
||||
;
|
||||
}
|
||||
;
|
||||
}
|
||||
|
||||
struct return_opaque_pointer
|
||||
struct return_opaque_pointer
|
||||
{
|
||||
template <class R>
|
||||
struct apply
|
||||
{
|
||||
template <class R>
|
||||
struct apply
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(
|
||||
bool, ok = is_pointer<R>::value);
|
||||
BOOST_STATIC_CONSTANT(
|
||||
bool, ok = is_pointer<R>::value);
|
||||
|
||||
typedef typename mpl::if_c<
|
||||
ok
|
||||
, detail::opaque_conversion_holder<R>
|
||||
, detail::return_opaque_pointer_requires_a_pointer_type<R>
|
||||
>::type type;
|
||||
};
|
||||
typedef typename mpl::if_c<
|
||||
ok
|
||||
, detail::opaque_conversion_holder<R>
|
||||
, detail::return_opaque_pointer_requires_a_pointer_type<R>
|
||||
>::type type;
|
||||
};
|
||||
};
|
||||
}} // namespace boost::python
|
||||
# endif // RETURN_OPAQUE_POINTER_HPP_
|
||||
|
||||
Reference in New Issue
Block a user