dimanche 3 avril 2016

Error: defaulted definition of default constructor is not constexpr

I get compiler error by Clang 3.8 and GCC 5.3 if I want to declare my default-ed default constructors as constexpr. According to this stackoverflow question it just should work fine:

struct A
{
    constexpr A() = default;

    int x;
};

however:

Error: defaulted definition of default constructor is not constexpr

Have you got any clue what is actually going on?

Aucun commentaire:

Enregistrer un commentaire