补全边角
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
#include <structive/property/property.hpp>
|
||||
struct Capability_Mismatch {
|
||||
const int value{};
|
||||
};
|
||||
int main() {
|
||||
auto schema = structive::object<Capability_Mismatch>(structive::field<&Capability_Mismatch::value>(structive::key<"value">, structive::read_write));
|
||||
return static_cast<int>(schema.property_count);
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
#include <structive/property/property.hpp>
|
||||
struct Duplicate_Key {
|
||||
int left{};
|
||||
int right{};
|
||||
};
|
||||
int main() {
|
||||
auto schema = structive::object<Duplicate_Key>(structive::field<&Duplicate_Key::left>(structive::key<"value">), structive::field<&Duplicate_Key::right>(structive::key<"value">));
|
||||
return static_cast<int>(schema.property_count);
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
#include <structive/property/property.hpp>
|
||||
struct Duplicate_Storage {
|
||||
int value{};
|
||||
};
|
||||
int main() {
|
||||
auto schema = structive::object<Duplicate_Storage>(structive::field<&Duplicate_Storage::value>(structive::key<"first">), structive::field<&Duplicate_Storage::value>(structive::key<"second">));
|
||||
return static_cast<int>(schema.property_count);
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
#include <structive/property/property.hpp>
|
||||
struct Foreign {
|
||||
int value{};
|
||||
};
|
||||
struct Local {
|
||||
int value{};
|
||||
};
|
||||
int main() {
|
||||
auto schema = structive::object<Local>(structive::synchronization(structive::sync_independent<&Foreign::value>()), structive::field<&Local::value>(structive::key<"value">));
|
||||
return static_cast<int>(schema.property_count);
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
#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);
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
#include <structive/property/property.hpp>
|
||||
struct Missing_Key {
|
||||
int value{};
|
||||
};
|
||||
int main() {
|
||||
auto schema = structive::object<Missing_Key>(structive::field<&Missing_Key::value>());
|
||||
return static_cast<int>(schema.property_count);
|
||||
}
|
||||
Reference in New Issue
Block a user