Is there any support for strong type aliasing? I see it on the roadmap but
I'm guessing no progress has been done on that front?
The specific use-case I'm dealing with is time & wanting to ensure the
correct units and epoch can be used (e.g. define a function taking a
monotonic_clock::timepoint and return a strongly typed 64-bit integer
nanoseconds that's typed to represent network time so that when the other
side reads it it needs to reverse convert.
More advanced would be to be able to define a Vector3f data type that I
know will only ever have 3 floats that I can reuse in a bunch of places
without paying for the cost of it being a separate struct (.e.g it would
take an "offset" field number & use up offset + N). So something like:
group@N Vector3f {
x @N[0] :float;
y @N[1] :float;
z @N[2] :float;
}
struct MyAwesomeStruct {
...
vec3 @10 :Vector3f@10;
vec3 @12 :Vector3f@12;
}
The actual syntax that would make sense I have no opinion on. This is
intended to just communicate what I would like the behaviour to look like.
It would ideally actually be typed in C++ too rather than purely a
convenience schema syntax.
--
You received this message because you are subscribed to the Google Groups
"Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/capnproto/4e2ff46a-449c-4d45-916d-7edcd25362f7%40googlegroups.com.