*: suppress some warnings here and there (close #525)

This commit is contained in:
Michele Caini
2020-07-20 00:05:46 +02:00
parent 991244655a
commit 1354fdc613
2 changed files with 5 additions and 5 deletions

View File

@@ -579,7 +579,7 @@ public:
nullptr,
true,
&internal::meta_info<data_type>::resolve,
[]() -> decltype(internal::meta_data_node::set) {
[]() -> std::remove_const_t<decltype(internal::meta_data_node::set)> {
if constexpr(std::is_same_v<Type, data_type> || std::is_const_v<data_type>) {
return nullptr;
} else {
@@ -631,7 +631,7 @@ public:
nullptr,
false,
&internal::meta_info<underlying_type>::resolve,
[]() -> decltype(internal::meta_data_node::set) {
[]() -> std::remove_const_t<decltype(internal::meta_data_node::set)> {
if constexpr(std::is_same_v<decltype(Setter), std::nullptr_t> || (std::is_member_object_pointer_v<decltype(Setter)> && std::is_const_v<underlying_type>)) {
return nullptr;
} else {

View File

@@ -98,7 +98,7 @@ class delegate<Ret(Args...)> {
template<auto Candidate, std::size_t... Index>
[[nodiscard]] auto wrap(std::index_sequence<Index...>) ENTT_NOEXCEPT {
return [](const void *, Args... args) -> Ret {
const auto arguments = std::forward_as_tuple(std::forward<Args>(args)...);
[[maybe_unused]] const auto arguments = std::forward_as_tuple(std::forward<Args>(args)...);
return Ret(std::invoke(Candidate, std::forward<std::tuple_element_t<Index, std::tuple<Args...>>>(std::get<Index>(arguments))...));
};
}
@@ -106,7 +106,7 @@ class delegate<Ret(Args...)> {
template<auto Candidate, typename Type, std::size_t... Index>
[[nodiscard]] auto wrap(Type &, std::index_sequence<Index...>) ENTT_NOEXCEPT {
return [](const void *payload, Args... args) -> Ret {
const auto arguments = std::forward_as_tuple(std::forward<Args>(args)...);
[[maybe_unused]] const auto arguments = std::forward_as_tuple(std::forward<Args>(args)...);
Type *curr = static_cast<Type *>(const_cast<std::conditional_t<std::is_const_v<Type>, const void *, void *>>(payload));
return Ret(std::invoke(Candidate, *curr, std::forward<std::tuple_element_t<Index, std::tuple<Args...>>>(std::get<Index>(arguments))...));
};
@@ -115,7 +115,7 @@ class delegate<Ret(Args...)> {
template<auto Candidate, typename Type, std::size_t... Index>
[[nodiscard]] auto wrap(Type *, std::index_sequence<Index...>) ENTT_NOEXCEPT {
return [](const void *payload, Args... args) -> Ret {
const auto arguments = std::forward_as_tuple(std::forward<Args>(args)...);
[[maybe_unused]] const auto arguments = std::forward_as_tuple(std::forward<Args>(args)...);
Type *curr = static_cast<Type *>(const_cast<std::conditional_t<std::is_const_v<Type>, const void *, void *>>(payload));
return Ret(std::invoke(Candidate, curr, std::forward<std::tuple_element_t<Index, std::tuple<Args...>>>(std::get<Index>(arguments))...));
};