It asks the precompiler to concatenate two tokens.
#define DECLARE_DELETE_PTR(type) \
void DeletePtr_##type(string &operand) \
{\
}\
DECLARE_DELETE_PTR(int)
would give :
void DeletePtr_int(string &operand)
//^^^ the macro argument is int, so the precompiler replaces it here
{
}
Indeed, in the macro code, the argument type
is concatenated with the rest of the command. If the macro argument is int
, then it's just a simple subsitution giving the above result. Remember that since it's a pre-processor directive, it happens entirely at compile time.
If you're on linux, I recommand giving a look at the cpp
command to try and understand better.
As for your second question, the difference is that it's simply two different operators.
Just as the name implies -> it turns its argument into a c-string (I've just tried that). For example :
std::cout << MAKE_STRINGS(Hello World) << std::endl;
would turn into:
std::cout << "Hello World" << std::endl
Or, more interesting :
std::cout << MAKE_STRINGS("Hello" World) << std::endl;
becomes:
std::cout << "\"Hello\" World" << std::endl;
It appears it also takes care of escaping special characters, but I could be wrong - that comes from experimentation from 3 minutes ago.