|
- #pragma once
-
- #include "modifier.h"
- #include "modifiers.h"
-
- namespace cpphibernate
- {
-
- namespace __impl
- {
-
- /* modifiers_t */
-
- template<typename... T_modifiers>
- using modifiers_t = hana::basic_tuple<T_modifiers...>;
-
- /* modifiers_builder */
-
- template<typename T, typename>
- struct modifiers_builder
- {
- template<typename... T_args>
- static constexpr decltype(auto) apply(T_args&&...)
- { static_assert(sizeof...(T_args) == -1, "Invalid parameters for make_modifiers(...)!"); }
- };
-
- template<typename... T_args>
- struct modifiers_builder<
- mp::list<T_args...>,
- mp::enable_if_t<
- mp::is_true_v<is_modifier_v<mp::decay_t<T_args>>...>>>
- {
- static constexpr decltype(auto) apply(T_args&&... args)
- {
- using modifiers_type = modifiers_t<T_args...>;
- return modifiers_type(std::forward<T_args>(args)...);
- }
- };
-
- /* is_modifiers_impl */
-
- template<typename T, typename = void>
- struct is_modifiers_impl
- : mp::false_t
- { };
-
- template<typename... T>
- struct is_modifiers_impl<
- modifiers_t<T...>,
- mp::enable_if_t<mp::is_true_v<is_modifier_v<mp::decay_t<T>>...>>>
- : mp::true_t
- { };
-
- }
-
- /* is_modifiers */
-
- template<typename T>
- struct is_modifiers
- : public __impl::is_modifiers_impl<T>
- { };
-
- }
|