I overloaded the << operator of a class. How do I have to overload the operator if I want to use it on pointers, like the following?
class A { std::str
You need to dereference the pointer first.
A *ptr = new A(); (*ptr) << "Something";
The only other way is the way you described above
Edit: Andre's solution below is workable as well, but like he said it may not be a good idea.