mirror of
https://codeberg.org/DawnMagnet/reflect-cpp
synced 2026-11-28 05:46:18 +08:00
18 lines
373 B
C++
18 lines
373 B
C++
#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
|