vendredi 31 juillet 2015

Math.h macro collisions

Macro DOMAIN in math.h collides with enums and possibly other types. I don't know what to make of it.

#include <algorithm>

enum Type { DOMAIN };


int main(){
    Type t = Type::DOMAIN;
    return 0;

}

Compile with flag -std=c++11. The C99 version of this code compiles perfectly fine though:

#include <algorithm>

enum Type { DOMAIN };


int main(){
    Type t = DOMAIN;
    return 0;

}

Aucun commentaire:

Enregistrer un commentaire