You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
2.0 KiB

  1. #pragma once
  2. beg_namespace_cpphibernate_driver_mariadb
  3. {
  4. namespace __impl
  5. {
  6. /* make_modifier_tags_impl */
  7. template<typename X, typename = void>
  8. struct make_modifier_tag_impl
  9. {
  10. template <typename ...T_args>
  11. static constexpr decltype(auto) apply(T_args&&... args)
  12. { static_assert(sizeof...(args) == -1, "Invalid parameters for make_modifier_tag(...)!"); }
  13. };
  14. template<typename T_modifier>
  15. struct make_modifier_tag_impl<
  16. mp::list<T_modifier>,
  17. mp::enable_if_c<
  18. modifier::is_limit_modifier<mp::decay_t<T_modifier>>::value
  19. || modifier::is_offset<mp::decay_t<T_modifier>>::value>>
  20. {
  21. static constexpr decltype(auto) apply(T_modifier&&)
  22. { return T_modifier { }; }
  23. };
  24. }
  25. constexpr decltype(auto) make_modifier_tag = misc::make_generic_predicate<__impl::make_modifier_tag_impl> { };
  26. namespace __impl
  27. {
  28. /* make_modifier_tags_impl */
  29. template<typename X, typename = void>
  30. struct make_modifier_tags_impl
  31. {
  32. template <typename ...T_args>
  33. static constexpr decltype(auto) apply(T_args&&... args)
  34. { static_assert(sizeof...(args) == -1, "Invalid parameters for make_modifier_tags(...)!"); }
  35. };
  36. template<typename T_modifiers>
  37. struct make_modifier_tags_impl<
  38. mp::list<T_modifiers>,
  39. mp::enable_if_c<
  40. modifier::is_modifiers<mp::decay_t<T_modifiers>>::value>>
  41. {
  42. static constexpr decltype(auto) apply(T_modifiers&& modifiers)
  43. {
  44. return hana::transform(
  45. modifiers,
  46. make_modifier_tag);
  47. }
  48. };
  49. }
  50. constexpr decltype(auto) make_modifier_tags = misc::make_generic_predicate<__impl::make_modifier_tags_impl> { };
  51. }
  52. end_namespace_cpphibernate_driver_mariadb