Browse Source

memory: make to_address [[nodiscard]]

Michele Caini 4 năm trước cách đây
mục cha
commit
98f785d199
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      src/entt/core/memory.hpp

+ 1 - 1
src/entt/core/memory.hpp

@@ -18,7 +18,7 @@ namespace entt {
  * @return A raw pointer that represents the address of the original pointer.
  * @return A raw pointer that represents the address of the original pointer.
  */
  */
 template<typename Type>
 template<typename Type>
-constexpr auto to_address(Type &&ptr) ENTT_NOEXCEPT {
+[[nodiscard]] constexpr auto to_address(Type &&ptr) ENTT_NOEXCEPT {
     if constexpr(std::is_pointer_v<std::remove_const_t<std::remove_reference_t<Type>>>) {
     if constexpr(std::is_pointer_v<std::remove_const_t<std::remove_reference_t<Type>>>) {
         return ptr;
         return ptr;
     } else {
     } else {