class Shape
{
virtual void out() = 0;
};
std::ostream& operator<<(std::ostream& os, Shape& a)
{
return os << a.out();
}
I want to create an abstract base class and be able to simply use cout << Triangle/Square etc. later on, with Triangle, Square being derived classes from Shape.
It works fine if I simply say return os << "test"; so I'm guessing it's something to do with a.out() not getting called properly, I just can't seem to pinpoint the problem.
aby const reference.