Просмотр исходного кода

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

Michele Caini 5 лет назад
Родитель
Сommit
1354fdc613
2 измененных файлов с 5 добавлено и 5 удалено
  1. 2 2
      src/entt/meta/factory.hpp
  2. 3 3
      src/entt/signal/delegate.hpp

+ 2 - 2
src/entt/meta/factory.hpp

@@ -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 {

+ 3 - 3
src/entt/signal/delegate.hpp

@@ -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))...));
         };