Do the strict aliasing rules in C++20 allow `reint

2019-07-11 04:16发布

问题:

Do the C++20's strict aliasing rules [basic.lval]/11 arbitrarily allow following...

  1. cast between char* and char8_t*
string str = "string";
u8string u8str { (char8_t*) &*str.data() }; // c++20 u8string

u8string u8str2 = u8"zß水