|
|
@@ -164,8 +164,8 @@ using meta_function_helper_t = meta_function_helper<Type, Candidate>::type;
|
|
|
* @param value Value to wrap.
|
|
|
* @return A meta any containing the returned value, if any.
|
|
|
*/
|
|
|
-template<typename Policy = as_value_t, typename Type>
|
|
|
-[[nodiscard]] std::enable_if_t<is_meta_policy_v<Policy>, meta_any> meta_dispatch(const meta_ctx &ctx, [[maybe_unused]] Type &&value) {
|
|
|
+template<meta_policy Policy = as_value_t, typename Type>
|
|
|
+[[nodiscard]] meta_any meta_dispatch(const meta_ctx &ctx, [[maybe_unused]] Type &&value) {
|
|
|
if constexpr(std::is_same_v<Policy, as_cref_t>) {
|
|
|
static_assert(std::is_lvalue_reference_v<Type>, "Invalid type");
|
|
|
return meta_any{ctx, std::in_place_type<const std::remove_reference_t<Type> &>, std::as_const(value)};
|
|
|
@@ -185,8 +185,8 @@ template<typename Policy = as_value_t, typename Type>
|
|
|
* @param value Value to wrap.
|
|
|
* @return A meta any containing the returned value, if any.
|
|
|
*/
|
|
|
-template<typename Policy = as_value_t, typename Type>
|
|
|
-[[nodiscard]] std::enable_if_t<is_meta_policy_v<Policy>, meta_any> meta_dispatch(Type &&value) {
|
|
|
+template<meta_policy Policy = as_value_t, typename Type>
|
|
|
+[[nodiscard]] meta_any meta_dispatch(Type &&value) {
|
|
|
return meta_dispatch<Policy, Type>(locator<meta_ctx>::value_or(), std::forward<Type>(value));
|
|
|
}
|
|
|
|
|
|
@@ -313,8 +313,8 @@ template<typename Type, auto Data>
|
|
|
* @param instance An opaque instance of the underlying type, if required.
|
|
|
* @return A meta any containing the value of the underlying variable.
|
|
|
*/
|
|
|
-template<typename Type, auto Data, typename Policy = as_value_t>
|
|
|
-[[nodiscard]] std::enable_if_t<is_meta_policy_v<Policy>, meta_any> meta_getter(meta_handle instance) {
|
|
|
+template<typename Type, auto Data, meta_policy Policy = as_value_t>
|
|
|
+[[nodiscard]] meta_any meta_getter(meta_handle instance) {
|
|
|
if constexpr(std::is_member_pointer_v<decltype(Data)> || std::is_function_v<std::remove_reference_t<std::remove_pointer_t<decltype(Data)>>>) {
|
|
|
if constexpr(!std::is_array_v<std::remove_cvref_t<std::invoke_result_t<decltype(Data), Type &>>>) {
|
|
|
if constexpr(std::is_invocable_v<decltype(Data), Type &>) {
|
|
|
@@ -352,8 +352,8 @@ template<typename Type, auto Data, typename Policy = as_value_t>
|
|
|
* @param args Parameters to use to _invoke_ the object.
|
|
|
* @return A meta any containing the returned value, if any.
|
|
|
*/
|
|
|
-template<typename Type, typename Policy = as_value_t, typename Candidate>
|
|
|
-[[nodiscard]] std::enable_if_t<is_meta_policy_v<Policy>, meta_any> meta_invoke(meta_handle instance, Candidate &&candidate, meta_any *const args) {
|
|
|
+template<typename Type, meta_policy Policy = as_value_t, typename Candidate>
|
|
|
+[[nodiscard]] meta_any meta_invoke(meta_handle instance, Candidate &&candidate, meta_any *const args) {
|
|
|
return internal::meta_invoke<Type, Policy>(*instance.operator->(), std::forward<Candidate>(candidate), args, std::make_index_sequence<meta_function_helper_t<Type, std::remove_reference_t<Candidate>>::args_type::size>{});
|
|
|
}
|
|
|
|
|
|
@@ -366,8 +366,8 @@ template<typename Type, typename Policy = as_value_t, typename Candidate>
|
|
|
* @param args Parameters to use to invoke the function.
|
|
|
* @return A meta any containing the returned value, if any.
|
|
|
*/
|
|
|
-template<typename Type, auto Candidate, typename Policy = as_value_t>
|
|
|
-[[nodiscard]] std::enable_if_t<is_meta_policy_v<Policy>, meta_any> meta_invoke(meta_handle instance, meta_any *const args) {
|
|
|
+template<typename Type, auto Candidate, meta_policy Policy = as_value_t>
|
|
|
+[[nodiscard]] meta_any meta_invoke(meta_handle instance, meta_any *const args) {
|
|
|
return internal::meta_invoke<Type, Policy>(*instance.operator->(), Candidate, args, std::make_index_sequence<meta_function_helper_t<Type, std::remove_reference_t<decltype(Candidate)>>::args_type::size>{});
|
|
|
}
|
|
|
|
|
|
@@ -436,8 +436,8 @@ template<typename Type, typename Policy = as_value_t, typename Candidate>
|
|
|
* @param args Parameters to use to _invoke_ the object.
|
|
|
* @return A meta any containing the returned value, if any.
|
|
|
*/
|
|
|
-template<typename Type, typename Policy = as_value_t, typename Candidate>
|
|
|
-[[nodiscard]] std::enable_if_t<is_meta_policy_v<Policy>, meta_any> meta_construct(Candidate &&candidate, meta_any *const args) {
|
|
|
+template<typename Type, meta_policy Policy = as_value_t, typename Candidate>
|
|
|
+[[nodiscard]] meta_any meta_construct(Candidate &&candidate, meta_any *const args) {
|
|
|
return meta_construct<Type, Policy>(locator<meta_ctx>::value_or(), std::forward<Candidate>(candidate), args);
|
|
|
}
|
|
|
|
|
|
@@ -455,8 +455,8 @@ template<typename Type, typename Policy = as_value_t, typename Candidate>
|
|
|
* @param args Parameters to use to invoke the function.
|
|
|
* @return A meta any containing the returned value, if any.
|
|
|
*/
|
|
|
-template<typename Type, auto Candidate, typename Policy = as_value_t>
|
|
|
-[[nodiscard]] std::enable_if_t<is_meta_policy_v<Policy>, meta_any> meta_construct(const meta_ctx &ctx, meta_any *const args) {
|
|
|
+template<typename Type, auto Candidate, meta_policy Policy = as_value_t>
|
|
|
+[[nodiscard]] meta_any meta_construct(const meta_ctx &ctx, meta_any *const args) {
|
|
|
return meta_construct<Type, Policy>(ctx, Candidate, args);
|
|
|
}
|
|
|
|
|
|
@@ -468,8 +468,8 @@ template<typename Type, auto Candidate, typename Policy = as_value_t>
|
|
|
* @param args Parameters to use to invoke the function.
|
|
|
* @return A meta any containing the returned value, if any.
|
|
|
*/
|
|
|
-template<typename Type, auto Candidate, typename Policy = as_value_t>
|
|
|
-[[nodiscard]] std::enable_if_t<is_meta_policy_v<Policy>, meta_any> meta_construct(meta_any *const args) {
|
|
|
+template<typename Type, auto Candidate, meta_policy Policy = as_value_t>
|
|
|
+[[nodiscard]] meta_any meta_construct(meta_any *const args) {
|
|
|
return meta_construct<Type, Candidate, Policy>(locator<meta_ctx>::value_or(), args);
|
|
|
}
|
|
|
|