#ifndef OTHER_DWA20020601_HPP # define OTHER_DWA20020601_HPP # include // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) # if _MSC_VER+0 >= 1020 # pragma once # endif # include namespace boost { namespace python { template struct other { typedef T type; }; # ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION namespace detail { template class is_other { public: BOOST_STATIC_CONSTANT(bool, value = false); }; template class is_other > { public: BOOST_STATIC_CONSTANT(bool, value = true); }; template class unwrap_other { public: typedef T type; }; template class unwrap_other > { public: typedef T type; }; } # else // no partial specialization }} // namespace boost::python #include namespace boost { namespace python { namespace detail { typedef char (&yes_other_t)[1]; typedef char (&no_other_t)[2]; no_other_t is_other_test(...); template yes_other_t is_other_test(type< other >); template struct other_unwrapper { template struct apply { typedef T type; }; }; template<> struct other_unwrapper { template struct apply { typedef typename T::type type; }; }; template class is_other { public: BOOST_STATIC_CONSTANT( bool, value = ( sizeof(detail::is_other_test(type())) == sizeof(detail::yes_other_t))); }; template class unwrap_other : public detail::other_unwrapper< is_other::value >::template apply {}; } # endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION }} // namespace boost::python #endif // #ifndef OTHER_DWA20020601_HPP