From 58ff96293896f1052b68194ad4752b3bce9f32b0 Mon Sep 17 00:00:00 2001 From: BlackMATov Date: Mon, 7 Feb 2022 04:30:31 +0700 Subject: [PATCH] fix dtor --- TODO.md | 2 +- headers/meta.hpp/meta_states/dtor.hpp | 2 +- untests/meta_states/function_tests.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/TODO.md b/TODO.md index e7e6ecb..2d53ed8 100644 --- a/TODO.md +++ b/TODO.md @@ -1,6 +1,5 @@ # meta.hpp -- exception class - metadata * argument defaults @@ -10,3 +9,4 @@ - (?) enum_type::create, number_type::create, and so on - (?) move-only value type support - (?) type names +- (?) properties diff --git a/headers/meta.hpp/meta_states/dtor.hpp b/headers/meta.hpp/meta_states/dtor.hpp index 2beda6c..08b0d3b 100644 --- a/headers/meta.hpp/meta_states/dtor.hpp +++ b/headers/meta.hpp/meta_states/dtor.hpp @@ -25,7 +25,7 @@ namespace meta_hpp::detail class_type* raw_ptr = ptr.cast(); if ( raw_ptr ) { - raw_ptr->~Class(); + std::unique_ptr{raw_ptr}.reset(); } } diff --git a/untests/meta_states/function_tests.cpp b/untests/meta_states/function_tests.cpp index 880eadf..67a5275 100644 --- a/untests/meta_states/function_tests.cpp +++ b/untests/meta_states/function_tests.cpp @@ -27,7 +27,7 @@ namespace static int arg_unbounded_const_arr(const ivec2 vs[]) { return vs[0].x + vs[0].y + vs[1].x + vs[1].y; } }; - bool operator==(const ivec2& l, const ivec2& r) noexcept { + [[maybe_unused]] bool operator==(const ivec2& l, const ivec2& r) noexcept { return l.x == r.x && l.y == r.y; } }