2 // Copyright (c) 2017 Intel Corporation
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
18 #include <type_traits>
19 #include "api/CPP/meta_utils.hpp"
20 #include "internal_primitive.h"
33 //helper type for deducing return type from member function pointer
34 //doesn't require passing arguments like std::result_of
36 struct deduce_ret_type;
38 template <class Ret, class C, class... Args>
39 struct deduce_ret_type<Ret(C::*)(Args...)>
45 using deduce_ret_type_t = typename deduce_ret_type<T>::type;
48 struct is_primitive : public std::integral_constant<bool,
49 std::is_base_of<primitive, T>::value &&
50 !std::is_same<primitive, typename std::remove_cv<T>::type>::value &&
51 std::is_same<T, typename std::remove_cv<T>::type>::value> {};
54 struct is_api_primitive : public std::integral_constant<bool,
55 is_primitive<T>::value &&
56 !std::is_base_of<internal_primitive, T>::value> {};
59 struct is_internal_primitive : public std::integral_constant<bool,
60 std::is_base_of<internal_primitive, T>::value &&
61 !std::is_same<internal_primitive, typename std::remove_cv<T>::type>::value &&
62 std::is_same<T, typename std::remove_cv<T>::type>::value> {};