is_member_pointer.hpp 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes,
  2. // Howard Hinnant and John Maddock 2000.
  3. // (C) Copyright Mat Marcus, Jesse Jones and Adobe Systems Inc 2001
  4. // Use, modification and distribution are subject to the Boost Software License,
  5. // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  6. // http://www.boost.org/LICENSE_1_0.txt).
  7. //
  8. // See http://www.boost.org/libs/type_traits for most recent version including documentation.
  9. // Fixed is_pointer, is_reference, is_const, is_volatile, is_same,
  10. // is_member_pointer based on the Simulated Partial Specialization work
  11. // of Mat Marcus and Jesse Jones. See http://opensource.adobe.com or
  12. // http://groups.yahoo.com/group/boost/message/5441
  13. // Some workarounds in here use ideas suggested from "Generic<Programming>:
  14. // Mappings between Types and Values"
  15. // by Andrei Alexandrescu (see http://www.cuj.com/experts/1810/alexandr.html).
  16. #ifndef BOOST_TT_IS_MEMBER_POINTER_HPP_INCLUDED
  17. #define BOOST_TT_IS_MEMBER_POINTER_HPP_INCLUDED
  18. #include <boost/detail/workaround.hpp>
  19. #include <boost/type_traits/is_member_function_pointer.hpp>
  20. namespace boost {
  21. #if defined( __CODEGEARC__ )
  22. template <class T> struct is_member_pointer : public integral_constant<bool, __is_member_pointer(T)>{};
  23. #else
  24. template <class T> struct is_member_pointer : public integral_constant<bool, ::boost::is_member_function_pointer<T>::value>{};
  25. template <class T, class U> struct is_member_pointer<U T::* > : public true_type{};
  26. #if !BOOST_WORKAROUND(__MWERKS__,<=0x3003) && !BOOST_WORKAROUND(__IBMCPP__, <=600)
  27. template <class T, class U> struct is_member_pointer<U T::*const> : public true_type{};
  28. template <class T, class U> struct is_member_pointer<U T::*const volatile> : public true_type{};
  29. template <class T, class U> struct is_member_pointer<U T::*volatile> : public true_type{};
  30. #endif
  31. #endif
  32. } // namespace boost
  33. #endif // BOOST_TT_IS_MEMBER_POINTER_HPP_INCLUDED