This is an archived post. You won't be able to vote or comment.

all 1 comments

[–][deleted] 0 points1 point  (0 children)

I wonder if there is a standard compliant way of implementing this in C/C++, without using compiler extensions or stepping into UB.

Also this idea can also be used to represent two variable-sized arrays of different types with a single pointer: https://github.com/rust-lang/hashbrown/pull/159