vendredi 2 août 2019

How to declare constexpr c-string member? [duplicate]

This question already has an answer here:

How to declare constexpr c-string member ? Non-member constexpr c-string can be declared this way:

constexpr char id_[] = "aaa";

so I have though that I can declare it this way:

struct T
{
    const static constexpr char id_[] = "aaa";
};

but I get undefined reference error.

Aucun commentaire:

Enregistrer un commentaire