2 // Copyright 2000 John Maddock (john@johnmaddock.co.uk)
3 // Copyright 2002 Aleksey Gurtovoy (agurtovoy@meta-comm.com)
5 // Use, modification and distribution are subject to the Boost Software License,
6 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt).
9 // See http://www.boost.org/libs/type_traits for most recent version including documentation.
11 #ifndef BOOST_TT_IS_FUNCTION_CXX_03_HPP_INCLUDED
12 #define BOOST_TT_IS_FUNCTION_CXX_03_HPP_INCLUDED
14 #include <boost/type_traits/is_reference.hpp>
16 #if !defined(BOOST_TT_TEST_MS_FUNC_SIGS)
17 # include <boost/type_traits/detail/is_function_ptr_helper.hpp>
19 # include <boost/type_traits/detail/is_function_ptr_tester.hpp>
20 # include <boost/type_traits/detail/yes_no_type.hpp>
23 // is a type a function?
24 // Please note that this implementation is unnecessarily complex:
25 // we could just use !is_convertible<T*, const volatile void*>::value,
26 // except that some compilers erroneously allow conversions from
27 // function pointers to void*.
31 #if !defined( __CODEGEARC__ )
35 #if !defined(BOOST_TT_TEST_MS_FUNC_SIGS)
36 template<bool is_ref = true>
37 struct is_function_chooser
39 template< typename T > struct result_
40 : public false_type {};
44 struct is_function_chooser<false>
46 template< typename T > struct result_
47 : public ::boost::type_traits::is_function_ptr_helper<T*> {};
51 struct is_function_impl
52 : public is_function_chooser< ::boost::is_reference<T>::value >
53 ::BOOST_NESTED_TEMPLATE result_<T>
60 struct is_function_impl
62 #if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000)
64 #pragma warning(disable:6334)
67 BOOST_STATIC_CONSTANT(
68 bool, value = sizeof(::boost::type_traits::is_function_ptr_tester(t))
69 == sizeof(::boost::type_traits::yes_type)
71 #if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000)
77 struct is_function_impl<T&> : public false_type
79 #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
81 struct is_function_impl<T&&> : public false_type
89 #endif // !defined( __CODEGEARC__ )
91 #if defined( __CODEGEARC__ )
92 template <class T> struct is_function : integral_constant<bool, __is_function(T)> {};
94 template <class T> struct is_function : integral_constant<bool, ::boost::detail::is_function_impl<T>::value> {};
95 #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
96 template <class T> struct is_function<T&&> : public false_type {};
98 #if !BOOST_WORKAROUND(BOOST_MSVC, <= 1600)
99 template <class T> struct is_function<T&> : public false_type {};
104 #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && defined(BOOST_MSVC) && BOOST_WORKAROUND(BOOST_MSVC, <= 1700)
105 #include <boost/type_traits/detail/is_function_msvc10_fix.hpp>
108 #endif // BOOST_TT_IS_FUNCTION_CXX_03_HPP_INCLUDED