Advertisement
frasl

Untitled

Feb 18th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. template <typename T, typename U> struct is_convertible_test {
  2.     static std::true_type test(U);
  3.     static std::false_type test(...);
  4.     static T make_T();
  5.  
  6.     enum {
  7.         value = std::is_same<decltype(test(make_T())), std::true_type>::value
  8.     };
  9. };
  10.  
  11. template <typename T, typename U> struct is_base_of_test {
  12.     enum {
  13.         value = is_convertible_test<U, T>::value && !(is_convertible_test<T, U>::value)
  14.     };
  15. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement