Listing 8

// scripting
// a and b are of type widget
a.mouse_pos.left { 10 }
a.rect.width { b.rect.width / 2 }
a.rect.top { b.rect.top }

// C++ code
// widget.h
struct widget : reflectable_properties_object<widget> {
    trivial_property<point> mouse_pos;
    trivial_property<rectangle> rect;
};
// widget.cpp
register_reflect r("mouse_pos", &widget::mouse_pos);
register_reflect r("rect", &widget::rect);