I have macro in which i pass an argument:
#define bind(id) function[function_id::id] = std::bind(otherFunction::id, std::placeholders::_1)
In that case id
expands to whatever I write into macro while using it. However I would like to add some characters to one of them, like this:
#define bind(id) function[function_id::id] = std::bind(otherFunction::add_id, std::placeholders::_1)
So that first replacement of id
is original and second is with sufix add_
. When I do that second expansion with add_
won't expand, so I end up with add_id
instead of add_whatever_I_wanted
.
In that case I've tried to use brackets and write it like that:
#define bind(id) function[function_id::id] = std::bind(otherFunction::add_(id), std::placeholders::_1)
And it worked partially, now id
is wrapped into brackets and expansion result is
add_(whatever_I_wanted)
Instead of
add_whatever_I_wanted
It's killing me as I want to use it quite often. Is there any workaround?