New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
is_function.hpp in vendors/XIOS/current/extern/boost/include/boost/type_traits – NEMO

source: vendors/XIOS/current/extern/boost/include/boost/type_traits/is_function.hpp @ 3428

Last change on this file since 3428 was 3428, checked in by rblod, 12 years ago

importing initial XIOS vendor drop

File size: 2.9 KB
Line 
1
2//  Copyright 2000 John Maddock (john@johnmaddock.co.uk)
3//  Copyright 2002 Aleksey Gurtovoy (agurtovoy@meta-comm.com)
4//
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).
8//
9//  See http://www.boost.org/libs/type_traits for most recent version including documentation.
10
11#ifndef BOOST_TT_IS_FUNCTION_HPP_INCLUDED
12#define BOOST_TT_IS_FUNCTION_HPP_INCLUDED
13
14#include <boost/type_traits/is_reference.hpp>
15#include <boost/type_traits/detail/false_result.hpp>
16#include <boost/config.hpp>
17
18#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_TT_TEST_MS_FUNC_SIGS)
19#   include <boost/type_traits/detail/is_function_ptr_helper.hpp>
20#else
21#   include <boost/type_traits/detail/is_function_ptr_tester.hpp>
22#   include <boost/type_traits/detail/yes_no_type.hpp>
23#endif
24
25// should be the last #include
26#include <boost/type_traits/detail/bool_trait_def.hpp>
27
28// is a type a function?
29// Please note that this implementation is unnecessarily complex:
30// we could just use !is_convertible<T*, const volatile void*>::value,
31// except that some compilers erroneously allow conversions from
32// function pointers to void*.
33
34namespace boost {
35
36#if !defined( __CODEGEARC__ )
37
38namespace detail {
39
40#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_TT_TEST_MS_FUNC_SIGS)
41template<bool is_ref = true>
42struct is_function_chooser
43    : ::boost::type_traits::false_result
44{
45};
46
47template <>
48struct is_function_chooser<false>
49{
50    template< typename T > struct result_
51        : ::boost::type_traits::is_function_ptr_helper<T*>
52    {
53    };
54};
55
56template <typename T>
57struct is_function_impl
58    : is_function_chooser< ::boost::is_reference<T>::value >
59        ::BOOST_NESTED_TEMPLATE result_<T>
60{
61};
62
63#else
64
65template <typename T>
66struct is_function_impl
67{
68#if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000)
69#pragma warning(push)
70#pragma warning(disable:6334)
71#endif
72    static T* t;
73    BOOST_STATIC_CONSTANT(
74        bool, value = sizeof(::boost::type_traits::is_function_ptr_tester(t))
75        == sizeof(::boost::type_traits::yes_type)
76        );
77#if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000)
78#pragma warning(pop)
79#endif
80};
81
82#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
83template <typename T>
84struct is_function_impl<T&> : public false_type
85{};
86#endif
87
88#endif
89
90} // namespace detail
91
92#endif // !defined( __CODEGEARC__ )
93
94#if defined( __CODEGEARC__ )
95BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_function,T,__is_function(T))
96#else
97BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_function,T,::boost::detail::is_function_impl<T>::value)
98#ifndef BOOST_NO_RVALUE_REFERENCES
99BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_function,T&&,false)
100#endif
101#endif
102} // namespace boost
103
104#include <boost/type_traits/detail/bool_trait_undef.hpp>
105
106#endif // BOOST_TT_IS_FUNCTION_HPP_INCLUDED
Note: See TracBrowser for help on using the repository browser.