Background
I have a container class which uses vector
1) Yes, except since AddChar is public there's no reason it needs to be a friend
.
2) This is arguable. <<
is sort of in the position of being the operator whose overloading for "weird" things is at least grudgingly accepted.
3) Nothing obvious. As always, profiling is your friend. You may want to consider passing the string parameters to AddChar
and operator<<
by const reference (const std::string&
) to avoid unnecessary copying.