00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef HAS_REQUIREMENTS_HH
00018 # define HAS_REQUIREMENTS_HH
00019
00020 # include "../type_traits/try_first.hh"
00021 # include "../type_traits/identity.hh"
00022
00023 namespace catsfoot {
00024
00025 namespace details {
00026 template <typename T, typename = typename T::requirements>
00027 std::true_type has_requirements_helper(try_first, T&&) {
00028 static_assert(always_false<T>::value,
00029 "Cannot use this function");
00030 return 0;
00031 }
00032
00033 template <typename T>
00034 std::false_type has_requirements_helper(try_second, T&&) {
00035 static_assert(always_false<T>::value,
00036 "Cannot use this function");
00037 return 0;
00038 }
00039
00041 template <typename T>
00042 struct has_requirements:
00043 public identity<
00044 decltype(has_requirements_helper(try_first(),
00045 std::declval<T>()))>::type
00046 {
00047 };
00048
00049 }
00050
00051 }
00052
00053 #endif