In C++, when I am using std::cout
like that:
std::cout << "myString" << std::endl;
Is there anything that will be allocated on the heap by std::cout? Or will std::cout do everything on the stack (meaning that std::cout and its underlying functions won't do any new/malloc/etc...
)?
I want to know if heavily using std::cout could cause some heap fragmentation
operator<<(std::ostream&, T)
won't invokenew
. This is obviously true for any user-definedT
. – Ramp