Stringified template argument

Posted by pythonic metaphor on Stack Overflow See other posts from Stack Overflow or by pythonic metaphor
Published on 2010-06-16T20:39:43Z Indexed on 2010/06/16 20:42 UTC
Read the original article Hit count: 173

Filed under:
|
|

Is it possible to get a stringified version of a template argument name?

Something like this, if only we were running the preprocessor:

template <typename T>
struct Named{
    const char* name(){ return "Named<" #T ">"; }
};

© Stack Overflow or respective owner

Related posts about c++

Related posts about template