Guest User

Untitled

a guest
Nov 14th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. template<template<typename> typename F>
  2. struct bool_metafunc
  3. {
  4. template<typename T>
  5. struct negate
  6. {
  7. static constexpr bool value = !(F<T>::value);
  8. };
  9.  
  10. template<template<typename> typename Other>
  11. struct binary_op
  12. {
  13. template<typename T>
  14. struct logic_or
  15. {
  16. static constexpr bool value = F<T>::value || Other<T>::value;
  17. };
  18.  
  19. template<typename T>
  20. struct logic_and
  21. {
  22. static constexpr bool value = F<T>::value && Other<T>::value;
  23. };
  24. };
  25. };
  26.  
  27. template<typename T>
  28. using integr_or_float = typename mvg::bool_metafunc<std::is_integral>::binary_op<std::is_floating_point>::logic_or<T>;
Add Comment
Please, Sign In to add comment