1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150
|
/*
* Copyright 2002 - 2016, The libsigc++ Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#ifndef SIGC_MEMBER_METHOD_TRAITS_H
#define SIGC_MEMBER_METHOD_TRAITS_H
#include <sigc++config.h>
namespace sigc
{
namespace internal
{
template<typename>
struct member_method_is_const;
template<typename T_obj, typename T_result, typename... T_arg>
struct member_method_is_const<T_result (T_obj::*)(T_arg...)>
{
constexpr static bool value = false;
};
template<typename T_obj, typename T_result, typename... T_arg>
struct member_method_is_const<T_result (T_obj::*)(T_arg...) volatile>
{
constexpr static bool value = false;
};
template<typename T_obj, typename T_result, typename... T_arg>
struct member_method_is_const<T_result (T_obj::*)(T_arg...) const>
{
constexpr static bool value = true;
};
template<typename T_obj, typename T_result, typename... T_arg>
struct member_method_is_const<T_result (T_obj::*)(T_arg...) const volatile>
{
constexpr static bool value = true;
};
template<typename>
struct member_method_is_volatile;
template<typename T_obj, typename T_result, typename... T_arg>
struct member_method_is_volatile<T_result (T_obj::*)(T_arg...)>
{
constexpr static bool value = false;
};
template<typename T_obj, typename T_result, typename... T_arg>
struct member_method_is_volatile<T_result (T_obj::*)(T_arg...) const>
{
constexpr static bool value = false;
};
template<typename T_obj, typename T_result, typename... T_arg>
struct member_method_is_volatile<T_result (T_obj::*)(T_arg...) volatile>
{
constexpr static bool value = true;
};
template<typename T_obj, typename T_result, typename... T_arg>
struct member_method_is_volatile<T_result (T_obj::*)(T_arg...) const volatile>
{
constexpr static bool value = true;
};
// member method class:
template<typename T_result, typename... T_arg>
struct member_method_class
{
};
template<typename T_obj, typename T_result, typename... T_arg>
struct member_method_class<T_result (T_obj::*)(T_arg...)>
{
using type = T_obj;
};
template<typename T_obj, typename T_result, typename... T_arg>
struct member_method_class<T_result (T_obj::*)(T_arg...) volatile>
{
using type = T_obj;
};
template<typename T_obj, typename T_result, typename... T_arg>
struct member_method_class<T_result (T_obj::*)(T_arg...) const>
{
using type = T_obj;
};
template<typename T_obj, typename T_result, typename... T_arg>
struct member_method_class<T_result (T_obj::*)(T_arg...) const volatile>
{
using type = T_obj;
};
// member method result:
template<typename T_result, typename... T_arg>
struct member_method_result
{
};
template<typename T_obj, typename T_result, typename... T_arg>
struct member_method_result<T_result (T_obj::*)(T_arg...)>
{
using type = T_result;
};
template<typename T_obj, typename T_result, typename... T_arg>
struct member_method_result<T_result (T_obj::*)(T_arg...) volatile>
{
using type = T_result;
};
template<typename T_obj, typename T_result, typename... T_arg>
struct member_method_result<T_result (T_obj::*)(T_arg...) const>
{
using type = T_result;
};
template<typename T_obj, typename T_result, typename... T_arg>
struct member_method_result<T_result (T_obj::*)(T_arg...) const volatile>
{
using type = T_result;
};
} // namespace internal
} // namespace sigc
#endif /* SIGC_MEMBER_METHOD_TRAITS_H */
|