mardi 30 décembre 2014

Is it possible to convert a type T to a string/char* in C++11/14?

This is a follow up questions from How to convert typename T to string in c++


I am asking because I would really like to generate nice error messages like



static_assert(one_of<T,Components...>::value,
"Unable to access T because you didn't
use it in filter<Components...>.");


Would print



Unable to access Foo because you did not use it in filter<Bar,Baz,Bat>.


Is something like this now possible in C++11 / 14?


Aucun commentaire:

Enregistrer un commentaire