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

memory: make to_address [[nodiscard]]

Michele Caini 4 лет назад
Родитель
Сommit
98f785d199
1 измененных файлов с 1 добавлено и 1 удалено
  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.
  */
 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>>>) {
         return ptr;
     } else {