
ISized interface
Posted Thursday, 18 March, 2010 - 19:06 by kvark| Project: | The Open Toolkit library |
| Version: | all versions |
| Component: | Code |
| Category: | feature request |
| Priority: | minor |
| Assigned: | Unassigned |
| Status: | closed |
Description
It would be pretty useful to me if data structures like Vector* and Quaternion* are exposing some ISized interface that provides SizeInBytes-similar property.
Right now I'm using Marshal.SizeOf for that, because the data is hid under generics.


Comments
#1
Submitting the Math patch.
It's just a matter of 2 clicks to accept, if you agree on it.
#2
I am currently using a class like this:
it calls for the Marshal once and looks like the function you need. If this is a performance/design failure please let me know so I will switch to ISized interface usage.
#3
Thanks, this way looks good.
I hope it works correctly :)
#4
Works good :)
#5
Check out
OpenTK.BlittableValueTypeandOpenTK.BlittableValueType<T>, they implement exactly this.