samedi 30 mai 2015

Union. User-Defined Constructor or non-trivial default constructor

Current Error: vec4 has a user-defined constructor or non-trivial default constructor.

Hello,

I looked up a few things on this bug, by going into what a non-trivial default constructor is and got no where. The code is currently this

union 
{
    float elements[4 * 4];
    vec4 columns[4];
};

To my current knowledge as long as i was to flag the constructor as default i would be fine which i did here.

    vec4() = default;
    vec4(const float& x, const float& y, const float& z, const float& w);

If anyone has any knowledge on what is going on here, or can help can help me reach a conclusion that would be great!

Thanks

Aucun commentaire:

Enregistrer un commentaire