I have a template, that takes a char argument like:
A<'T'>
I am storing my T in a variable like:
const char ch = str[0]; //str is a string from my program
constexpr char ch = str[0]; // this doesnt work either for me
I am trying to achieve this:
A<ch>();
I am using gcc 4.7 and have dabbled with constexpr but I havent been able to get that work
Any idea of a way to get this to work?
Any help is appreciated
This can only work if everything is a constant expression: