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.
take a look at

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 (...)"
ostream& operator<< (ostream& ( *pf )(ostream&));
ostream& operator<< (ios& ( *pf )(ios&));
ostream& operator<< (ios_base& ( *pf )(ios_base&));
ostream& endl ( ostream& os );
Topic archived. No new replies allowed.