source: NonGTP/Boost/boost/python/detail/unwrap_wrapper.hpp @ 857

Revision 857, 1.2 KB checked in by igarcia, 18 years ago (diff)
Line 
1// Copyright David Abrahams 2004. Distributed under the Boost
2// Software License, Version 1.0. (See accompanying
3// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
4#ifndef UNWRAP_WRAPPER_DWA2004723_HPP
5# define UNWRAP_WRAPPER_DWA2004723_HPP
6
7# include <boost/python/detail/prefix.hpp>
8# include <boost/python/detail/is_wrapper.hpp>
9#  if defined(BOOST_PYTHON_NO_SFINAE)
10#   include <boost/mpl/eval_if.hpp>
11#   include <boost/mpl/identity.hpp>
12#  else
13#   include <boost/python/detail/enable_if.hpp>
14#  endif
15
16namespace boost { namespace python { namespace detail {
17
18#  if defined(BOOST_PYTHON_NO_SFINAE)
19template <class T>
20struct unwrap_wrapper_helper
21{
22    typedef typename T::_wrapper_wrapped_type_ type;
23};
24 
25template <class T>
26typename mpl::eval_if<is_wrapper<T>,unwrap_wrapper_helper<T>,mpl::identity<T> >::type*
27unwrap_wrapper(T*)
28{
29    return 0;
30}
31#  else
32template <class T>
33typename disable_if_ret<is_wrapper<T>,T*>::type
34unwrap_wrapper(T*)
35{
36    return 0;
37}
38
39template <class T>
40T* unwrap_wrapper(wrapper<T>*)
41{
42    return 0;
43}
44#  endif
45
46}}} // namespace boost::python::detail
47
48#endif // UNWRAP_WRAPPER_DWA2004723_HPP
Note: See TracBrowser for help on using the repository browser.