I'm not sure if this is a compiler bug or if I misunderstand constexpr:
struct S{};
constexpr S s1{};
constexpr S s2;
struct test{
static constexpr auto t1 = s1;
static constexpr auto t2 = s2; //error here
};
GCC 4.8 is giving me an odd error "error: field initializer is not constant". Is s2 really not a constant? If so why?
For clarity I actually am using a bunch of empty structs in my code (for meta programming http://ift.tt/1ykn7Em) so I really am interested in this specific example.
Aucun commentaire:
Enregistrer un commentaire