Suppose I have a .cpp
file in which I have to include a third-party header file that declares some symbol (let's call it div
). I do not need this symbol, but I need to define my own div
symbol. However, the original symbol might be used by some other part of the header file. Is it possible to remove the symbol from global namespace (something similar to undef
ing a macro)?
I want something like this:
#include <string> //stdlib.h defines div symbol
//do some symbol removal magic here
std::string div;
to compile using gcc-4.7/clang with -std=c++11
option.