jeudi 10 juin 2021

why can not use default constructor?

I define a class as follow:

class A
{
public:
    A() = default;

    inline static constexpr int i = 10;
};

It run ok, but the compiler make an error("E1790:default constructor can not be used") when i compile the program on visual studio 2019.

Aucun commentaire:

Enregistrer un commentaire