You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When T is an aggregate type, eg struct Rect { int x; int y; int width; int height; }
It would be great to be able to access members of Property, i.e that:
Property<Rect> r;
auto widthProp = makeBoundProperty(r.width);
This slightly overlaps with what @lemirep is asking about in #28, except in my case the aggregate does not contain Property<> members. The desired behaviour can be done using a function argument to makeBoundProperty : the question is whether some overload of operator-dot (and ->, presumably) could synthesise the access.
The text was updated successfully, but these errors were encountered:
There's an interesting case here that widthProp could in simple cases be write-able. However, this would need a different API, to track const- vs non-const bindings, I guess.
So you could do:
Property<Rect> r;
auto widthProp = makeBoundPropery(r.width);
widthProp = 99;
and this would trigger bindings on r
I can guess making this work for arbitrary deep nesting is impossible, but for the common case of types such as color, date or vec3 / mat4, it feels like it would be useful enough to support.
There's an interesting case here that widthProp could in simple cases be write-able. However, this would need a different API, to track const- vs non-const bindings, I guess.
I'd say this is a separate issue, that also came up frequently, which is two-way bindings. (i.e. assign the "result" of a binding and if it's direct, write it into the source).
Otherwise adding support for . and -> operators is definitely interesting, but will need more research.
When T is an aggregate type, eg
struct Rect { int x; int y; int width; int height; }
It would be great to be able to access members of Property, i.e that:
This slightly overlaps with what @lemirep is asking about in #28, except in my case the aggregate does not contain
Property<>
members. The desired behaviour can be done using a function argument tomakeBoundProperty
: the question is whether some overload of operator-dot (and->
, presumably) could synthesise the access.The text was updated successfully, but these errors were encountered: