jeudi 21 juin 2018

Difference between return {} and return Object{}

Is there any significant difference between this two functions?

struct Object {
    Object(int i) : i{i}
    {
    }

    int i;
};

Object f() { return {1}; }
Object g() { return Object{1}; }

Aucun commentaire:

Enregistrer un commentaire