KASKADE 7 development version
is_function.hh
Go to the documentation of this file.
1/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2/* */
3/* This file is part of the library KASKADE 7 */
4/* https://www.zib.de/research/projects/kaskade7-finite-element-toolbox */
5/* */
6/* Copyright (C) 2002-2012 Zuse Institute Berlin */
7/* */
8/* KASKADE 7 is distributed under the terms of the ZIB Academic License. */
9/* see $KASKADE/academic.txt */
10/* */
11/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
12/*
13 * is_function.hh
14 *
15 * Created on: 20.04.2012
16 * Author: Lars Lubkoll
17 */
18
19#ifndef IS_FUNCTION_HH_
20#define IS_FUNCTION_HH_
21
22namespace Kaskade
23{
24 /* * * * * * * * * * * * * * * * * no function * * * * * * * * * * * * * * * */
26
31 template <typename T>
33 {
34 static bool const isMemberFunction = false;
35 static bool const value = false;
36 };
37
38 /* * * * * * * * * * * * * * * * member function * * * * * * * * * * * * * * */
42 template <typename ReturnType, typename ClassName, typename... Arguments>
43 struct IsFunction<ReturnType (ClassName::*)(Arguments...)>
44 {
45 static bool const isMemberFunction = true;
46 static bool const value = true;
47 };
48
49 template <typename ReturnType, typename ClassName, typename... Arguments>
50 struct IsFunction<ReturnType (ClassName::*)(Arguments...) const>
51 {
52 static bool const isMemberFunction = true;
53 static bool const value = true;
54 };
55
56 template <typename ReturnType, typename ClassName, typename... Arguments>
57 struct IsFunction<ReturnType (ClassName::*)(Arguments...) volatile>
58 {
59 static bool const isMemberFunction = true;
60 static bool const value = true;
61 };
62
63 template <typename ReturnType, typename ClassName, typename... Arguments>
64 struct IsFunction<ReturnType (ClassName::*)(Arguments...) const volatile>
65 {
66 static bool const isMemberFunction = true;
67 static bool const value = true;
68 };
69 /* * * * * * * * * * * * * * * * free function * * * * * * * * * * * * * * */
70 template <typename ReturnType, typename... Arguments>
71 struct IsFunction<ReturnType (*)(Arguments...)>{
72 static bool const isMemberFunction = false;
73 static bool const value = true;
74 };
78}
79
80#endif /* IS_FUNCTION_HH_ */
Checks if type is a function or member function.
Definition: is_function.hh:33
static bool const value
Definition: is_function.hh:35
static bool const isMemberFunction
Definition: is_function.hh:34