补全边角

This commit is contained in:
2026-08-08 21:21:23 +08:00
parent a6d6f8c6d3
commit c51c9d2937
24 changed files with 359 additions and 56 deletions
+16
View File
@@ -0,0 +1,16 @@
#include <structive/property/extensions/presentation.hpp>
#include <structive/property/property.hpp>
struct Consumer_Device : structive::Property_Object<Consumer_Device> {
int value{1};
};
template <>
struct structive::Type_Descriptor<Consumer_Device> {
static auto get() {
return object<Consumer_Device>(field<&Consumer_Device::value>(key<"value">, presentation::label<"Value">));
}
};
int main() {
Consumer_Device device;
device.write<&Consumer_Device::value>(2);
return device.read<&Consumer_Device::value>() == 2 ? 0 : 1;
}