[TYPE_SAFE_UNION] use std::aligned_union instead of stack_based_memory_block (#2349)
* [TYPE_SAFE_UNION] use std::aligned_union instead of stack_based_memory_block. std::aligned_union was specifically designed to do this kind of stuff and we are better off trusting the standard library deciding what the correct storage type should be and what the appropriate alignment should be
* [TYPE_SAFE_UNION] as per Davis' suggestion, std::aligned_union can take Len parameter 0. Also, the content's of validate_type() has been bugging me for ages, so i created is_any which is based on std::is_same. I've also replaced is_same_type with std::is_same
Co-authored-by:
Peter Featherstone <peter@grampus-server.com>
Showing
Please register or sign in to comment