mirror of
https://codeberg.org/DawnMagnet/reflect-cpp
synced 2026-12-07 03:06:18 +08:00
revert the rename
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
#include "test_all_of.hpp"
|
||||
|
||||
#include <iostream>
|
||||
#include <rfl.hpp>
|
||||
#include <rfl/flexbuf.hpp>
|
||||
#include <source_location>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "write_and_read.hpp"
|
||||
|
||||
namespace test_all_of {
|
||||
|
||||
void test() {
|
||||
std::cout << std::source_location::current().function_name() << std::endl;
|
||||
|
||||
using Age = rfl::Validator<unsigned int,
|
||||
rfl::AllOf<rfl::Minimum<0>, rfl::Maximum<130>>>;
|
||||
|
||||
struct Person {
|
||||
rfl::Field<"firstName", std::string> first_name;
|
||||
rfl::Field<"lastName", std::string> last_name;
|
||||
rfl::Field<"age", Age> age;
|
||||
};
|
||||
|
||||
const auto homer =
|
||||
Person{.first_name = "Homer", .last_name = "Simpson", .age = 45};
|
||||
|
||||
write_and_read(homer);
|
||||
}
|
||||
} // namespace test_all_of
|
||||
Reference in New Issue
Block a user