samedi 27 juin 2015

Macro with zero arguments

I can't figure out what is wrong with this code. When I pass 1 argument to LOG_INFO, it works fine, but fails with 0 arguments.

#define LOG_INFO(...) CLOG(INFO, "default", ##__VA_ARGS__)

LOG_INFO() << "Log using default file";

error:
expected primary-expression before ‘)’ token

Aucun commentaire:

Enregistrer un commentaire