SHARE
TWEET

Untitled

a guest Apr 23rd, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //template<typename, typename T, typename... Args>
  2. //struct is_constructible_impl : std::false_type { };
  3. //
  4. //template<typename T, typename... Args>
  5. //struct is_constructible_impl<decltype(T(std::declval<Args>()...), void()), T, Args...> : std::true_type { };
  6. //
  7. //template<typename T, typename... Args>
  8. //struct is_constructible : is_constructible_impl<void, T, Args...> { };
  9. //
  10. //template<typename T, typename... Args>
  11. //constexpr bool is_constructible_v = is_constructible<T, Args...>::value;
  12. //
  13. //template<template<typename...> typename T, typename... Args>
  14. //struct bar { };
  15. //
  16. //template<typename T, template<typename...> typename U>
  17. //struct is_specialization_of : std::false_type { };
  18. //
  19. //template<template<typename...> typename T, typename... Args>
  20. //struct is_specialization_of<T<Args...>, T> : std::true_type { };
  21. //
  22. //template<typename T, template<typename...> typename U>
  23. //constexpr bool is_specialization_of_v = is_specialization_of<T, U>::value;
  24.  
  25. //template<typename T, template<typename...> typename U>
  26. //struct transfer_arguments { };
  27. //
  28. //template<template<typename...> typename T, template<typename...> typename U, typename... Args>
  29. //struct transfer_arguments<T<Args...>, U>
  30. //{
  31. //  using type = U<Args...>;
  32. //};
  33. //
  34. //template<typename T, template<typename...> typename U>
  35. //using transfer_arguments_t = typename transfer_arguments<T, U>::type;
  36.  
  37. //template<typename T, typename = void>
  38. //struct is_class_impl : std::false_type { };
  39. //
  40. //template<typename T>
  41. //struct is_class_impl<T, std::enable_if_t<!std::is_union_v<T>, std::void_t<char T::*>>> : std::true_type { };
  42. //
  43. //template<typename T>
  44. //struct is_class : is_class_impl<T> { };
  45. //
  46. //template<typename T>
  47. //constexpr bool is_class_v = is_class<T>::value;
  48. //
  49. template<typename, typename F, typename... Args>
  50. struct is_invokeable_impl : std::false_type { };
  51.  
  52. template<typename F, typename... Args>
  53. struct is_invokeable_impl<decltype(std::declval<F>()(std::declval<Args>()...), void()), F, Args...> : std::true_type { };
  54.  
  55. template<typename F, typename... Args>
  56. struct is_invokeable : is_invokeable_impl<void, F, Args...> { };
  57.  
  58. template<typename F, typename... Args>
  59. constexpr bool is_invokeable_v = is_invokeable<F, Args...>::value;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top