I know I can use reinterpret_cast
, but it seems weird that I can not go from char to "universal" type like std::byte.
Is this just unfortunate mistake/limitation, or there is a reason for this?
int main(){
std::string s{"abc"};
std::byte* ptr = static_cast<std::byte*>(s.data());
}