can i create an especifique macro?

imagine that the macro is only used with some types and not change on all code, can i do it?
the vector have push_back() method. but i want use add() instead. if i use a normal macro, it will change all code and not only that method.
can i create a macro for change only on that method?
No, you can't use a macro, because macros do not understand types. Make a function instead:

1
2
3
4
void add(std::vector<int> &vs, int i)
{
  vs.push_back(i);
}
ok.. thanks
but it's possible to add that function on vector? or the best i add it on vector class itself?
Best you leave it as a free function. There's no reason to do what you're trying to do. No reason to do what you're trying to do. No reason to do what you're trying to do.
ok. thanks for all to all
Topic archived. No new replies allowed.