jeudi 24 novembre 2016

Are they equivalent between implicit ctor, no-parameter-empty-body ctor and explicit default ctor?

struct A1
{
    int n;        
};

struct A2
{
    int n;
    A2(){}        
};

struct A3
{
    int n;
    A3() = default;        
};

My question is:

Does the C++ standard guarantee the classes A1, A2, A3 are completely equivalent to each other?

Aucun commentaire:

Enregistrer un commentaire