Note that there are some explanatory texts on larger screens.

plurals
  1. POInitialize static union within class
    primarykey
    data
    text
    <p>I use open-source code that declared static union inside class like this.</p> <p><strong><em><code>VAD.h</code></em></strong>:</p> <pre><code>class VD { public: static union Wu { const short w[2 * 64]; const double y[16]; } wu; }; </code></pre> <p><strong><em><code>VAD.cpp</code></em></strong>:</p> <pre><code>VD:: Wu VD:: wu = { 0x0000, 0x7FFF, 0x0000, 0x7FFF, 0x0000, 0x7FFF, 0x0C8B, 0x7F61, 0x18F8, 0x7D89, 0x2527, 0x7A7C, 0x18F8, 0x7D89, 0x30FB, 0x7641, 0x471C, 0x6A6D, 0x2527, 0x7A7C, 0x471C, 0x6A6D, 0x62F1, 0x5133, 0x30FB, 0x7641, 0x5A82, 0x5A82, 0x7641, 0x30FB, 0x3C56, 0x70E2, 0x6A6D, 0x471C, 0x7F61, 0x0C8B, 0x471C, 0x6A6D, 0x7641, 0x30FB, 0x7D89, -0x18F8, 0x5133, 0x62F1, 0x7D89, 0x18F8, 0x70E2, -0x3C56, 0x5A82, 0x5A82, 0x7FFF, 0x0000, 0x5A82, -0x5A82, 0x62F1, 0x5133, 0x7D89, -0x18F8, 0x3C56, -0x70E2, 0x6A6D, 0x471C, 0x7641, -0x30FB, 0x18F8, -0x7D89, 0x70E2, 0x3C56, 0x6A6D, -0x471C, -0x0C8B, -0x7F61, 0x7641, 0x30FB, 0x5A82, -0x5A82, -0x30FB, -0x7641, 0x7A7C, 0x2527, 0x471C, -0x6A6D, -0x5133, -0x62F1, 0x7D89, 0x18F8, 0x30FB, -0x7641, -0x6A6D, -0x471C, 0x7F61, 0x0C8B, 0x18F8, -0x7D89, -0x7A7C, -0x2527, 0x0000, 0x7FFF, 0x0000, 0x7FFF, 0x0000, 0x7FFF, 0x30FB, 0x7641, 0x5A82, 0x5A82, 0x7641, 0x30FB, 0x5A82, 0x5A82, 0x7FFF, 0x0000, 0x5A82, -0x5A82, 0x7641, 0x30FB, 0x5A82, -0x5A82, -0x30FB, -0x7641 }; </code></pre> <p>when I compiled this code using VC++ 6.0 on windows..this error occured:</p> <blockquote> <p>public: static union VD::Wu VD::wu' : non-aggregates cannot be initialized with initializer list</p> </blockquote> <p>anyone can help me please?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload