samedi 30 juillet 2016

Making std::to_string work with void pointers (and do we really want to)

I have some code which std::to_string()'s a variable whose type is a template parameter. Now, sometimes this parameter needs to be a void. No problem, right? I should just get the same thing as I would when I std::cout << my_ptr, right? ... Unfortunately not, this doesn't happen.

  • Is it "legitimate" for me to want this to work?
  • Is there anything better than overloading std::to_string for void*'s and using an std::stringstream for the operator<< ?

Aucun commentaire:

Enregistrer un commentaire