Streams have a void* conversion operator.
Something like:Originally Posted by Programmer_P
In the next version of the C++ standard library we expect it to become:Code:operator void*() const;
Code:explicit operator bool() const;
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
Ok, thanks. I'll definitely employ that approach in future programs then. I see no reason to switch ReplaceStrsInLines to use that approach now, as the other one seems to work just fine.
Ok, nevermind. I realized what's breaking it, and that is that my function does not expect for one search string to be part of another search string. Since I was passing the search strings "C_html_element" and "_element", it broke my function.
Alright, I guess I'll have to avoid using such use cases then, or find a way to make the function work with it.
Last edited by Programmer_P; 03-09-2011 at 11:40 AM.
I'm an alien from another world. Planet Earth is only my vacation home, and I'm not liking it.