diff options
author | Anas Nashif <anas.nashif@intel.com> | 2012-10-30 12:57:26 -0700 |
---|---|---|
committer | Anas Nashif <anas.nashif@intel.com> | 2012-10-30 12:57:26 -0700 |
commit | 1a78a62555be32868418fe52f8e330c9d0f95d5a (patch) | |
tree | d3765a80e7d3b9640ec2e930743630cd6b9fce2b /boost/python/pointee.hpp | |
download | boost-1a78a62555be32868418fe52f8e330c9d0f95d5a.tar.gz boost-1a78a62555be32868418fe52f8e330c9d0f95d5a.tar.bz2 boost-1a78a62555be32868418fe52f8e330c9d0f95d5a.zip |
Imported Upstream version 1.49.0upstream/1.49.0
Diffstat (limited to 'boost/python/pointee.hpp')
-rw-r--r-- | boost/python/pointee.hpp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/boost/python/pointee.hpp b/boost/python/pointee.hpp new file mode 100644 index 0000000000..ab8bb87439 --- /dev/null +++ b/boost/python/pointee.hpp @@ -0,0 +1,43 @@ +// 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) +#ifndef POINTEE_DWA2002323_HPP +# define POINTEE_DWA2002323_HPP + +# include <boost/python/detail/prefix.hpp> + +# include <boost/type_traits/object_traits.hpp> +# include <boost/type_traits/remove_pointer.hpp> + +namespace boost { namespace python { + +namespace detail +{ + template <bool is_ptr = true> + struct pointee_impl + { + template <class T> struct apply : remove_pointer<T> {}; + }; + + template <> + struct pointee_impl<false> + { + template <class T> struct apply + { + typedef typename T::element_type type; + }; + }; +} + +template <class T> +struct pointee + : detail::pointee_impl< + ::boost::is_pointer<T>::value + >::template apply<T> +{ +}; + +}} // namespace boost::python::detail + +#endif // POINTEE_DWA2002323_HPP |