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

Revision 857, 868 bytes checked in by igarcia, 19 years ago (diff)
RevLine 
[857]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 IS_WRAPPER_DWA2004723_HPP
5# define IS_WRAPPER_DWA2004723_HPP
6
7# include <boost/python/detail/prefix.hpp>
8# include <boost/mpl/bool.hpp>
9
10namespace boost { namespace python {
11
12template <class T> class wrapper;
13
14namespace detail
15{
16  typedef char (&is_not_wrapper)[2];
17  is_not_wrapper is_wrapper_helper(...);
18  template <class T>
19  char is_wrapper_helper(wrapper<T> const volatile*);
20
21  // A metafunction returning true iff T is [derived from] wrapper<U>
22  template <class T>
23  struct is_wrapper
24    : mpl::bool_<(sizeof(detail::is_wrapper_helper((T*)0)) == 1)>
25  {};
26
27}}} // namespace boost::python::detail
28
29#endif // IS_WRAPPER_DWA2004723_HPP
Note: See TracBrowser for help on using the repository browser.