If I use this code:
template <typename Streamable>
/* ... */
std::stringstream ss;
ss << function_yielding_a_Streamable();
auto last_char = ss.str().back();
then (I believe) a copy of the string in ss
's buffer will need to be created, just for me to get the last character, and it will then be destroyed. Can I do something better instead? Perhaps using the seekp()
method?