Files
Structive/core/tests/compile_fail/incompatible_constraint.cpp
T
2026-08-08 21:21:23 +08:00

11 lines
434 B
C++

#include <structive/property/property.hpp>
#include <string>
struct Incompatible_Constraint {
int value{};
};
int main() {
auto only_string = structive::constraint<"string_only">([](const std::string&) { return true; });
auto schema = structive::object<Incompatible_Constraint>(structive::field<&Incompatible_Constraint::value>(structive::key<"value">, only_string));
return static_cast<int>(schema.property_count);
}