and here I have error message: "'dataType' is not a valid template type argument for parameter 'DT'"
How can I solve it? i must somehow convert char* dataType(for example double) to legal class name.
No, you can't do that either. You can't have a conditional typedef.
You simply can't do what you want. If you want to do something like that, you may want to look at an interpreted language. You might try http://www.ruby-lang.org