I was reading the book C++: How to program (Deitel, 6th Edition), and on the page 602 I implement my own String (training). But I want to implement my own StringStream. So, how can I make a loop like stringstream, and accept all kind of data?
1 2 3
double PI = 3.14;
a << "The value of PI with precision 2 is " << PI;
Should I use templates? How do std::ostream loops work?