lundi 13 septembre 2021

c++11: Why a in-class initialization of a static constexpr not a definition?

Consider the simple following:

class Test {
public:
    static constexpr int a = 1;
}

This is not considered a definition and hence needs the below definition outside of the class.

constexpr int Test::a;

Why?

Aucun commentaire:

Enregistrer un commentaire