C++ Logo

std-discussion

Advanced search

Re: Value of non-active data member byte in constexpr union?

From: language.lawyer_at <language.lawyer_at_[hidden]>
Date: Fri, 17 Mar 2023 01:46:53 +0500
> When you assign to b[0] a is no longer the active member of the union
> and therefore reading from it
Why do you call `return reinterpret_cast<unsigned char const *>(&s)[1]` «reading from `a`»? (or `a[1]`, whatever)

Received on 2023-03-16 20:46:57