4 ms·
> Can we hide the actual memory layout without big overhead using C++ inline/template functions/classes? Not super easily because the array type needs to know
by kllrnohj 7y ago
> Can we hide the actual memory layout without big overhead using C++ inline/template functions/classes?
Not super easily because the array type needs to know the fields of the class it's containing to do the re-write. This is where you need more substantial codegen to enter the picture. Something like the metaclasses proposal should handle it just fine. Or macros in the meantime.
- gpderetta 7y agoI posted this elsethread: https://godbolt.org/z/rBeWOA https://godbolt.org/z/rBeWOA But yes, better reflection is needed to make it truly generic.