passing endl into a function

I have a class where I have overloaded the << operator to append incoming strings to a member string. When I'm done appending though I would like to be able to pass the endl character in with the same << operator and have it be recognized and perform a special function.

Is there a way to do this? I tried overloading << to accept a char, but that didn't work either.
hi!
take a look at
http://stackoverflow.com/questions/1134388/stdendl-is-of-unknown-type-when-overloading-operator

it is the same problem. As the first answer there says,
" std::endl is a function, and they way std::cout works with it, is that it has an operator<< defined to take in a function pointer wjavascript:editbox1.editSend()ith the same signature as std::endl (...)"
http://www.cplusplus.com/reference/iostream/ostream/operator%3C%3C/
ostream& operator<< (ostream& ( *pf )(ostream&));
ostream& operator<< (ios& ( *pf )(ios&));
ostream& operator<< (ios_base& ( *pf )(ios_base&));

http://www.cplusplus.com/reference/iostream/manipulators/endl/
ostream& endl ( ostream& os );
Ok?
Topic archived. No new replies allowed.