Fix bugging disallowing optionals to hold items without copy constructors (#390)

This commit is contained in:
Joel McKenzie
2025-03-23 21:34:56 +08:00
committed by GitHub
parent c2b323bf57
commit 46693806d1
2 changed files with 18 additions and 1 deletions
+17
View File
@@ -0,0 +1,17 @@
#include <rfl.hpp>
#include <string>
#include <gtest/gtest.h>
namespace test_optional {
struct Person {
std::string name;
std::optional<rfl::Box<Person>> spouse;
};
TEST(generic, test_optional) {
rfl::Generic generic;
// This failed to compile due to optional copying rather than moving
rfl::from_generic<Person>(generic);
}
} // namespace test_map