@@ -280,6 +280,11 @@ public:
vtable = poly_vtable<Concept>::template instance<Type>();
}
+ /*! @brief Destroys contained object */
+ void reset() {
+ *this = poly{};
+ }
+
/**
* @brief Returns false if a poly is empty, true otherwise.
* @return False if the poly is empty, true otherwise.
@@ -99,6 +99,11 @@ TEST(PolyDeduced, Functionalities) {
ASSERT_TRUE(move);
ASSERT_FALSE(copy);
ASSERT_EQ(move->get(), 3);
+ move.reset();
+ ASSERT_FALSE(move);
+ ASSERT_EQ(move.type(), entt::type_info{});
TEST(PolyDeduced, Owned) {
@@ -105,6 +105,11 @@ TEST(PolyDefined, Functionalities) {
TEST(PolyDefined, Owned) {