I'm wondering whether what I'm trying to achieve is possible in `C++`

Suppose I have a template

```
template<typename T>
struct Foo { 
    static void foo();
};

```

and a non-constexpr `char c`.
Now, I want to create an instance of `Foo` and do something with it, depending on the value of my character:

```
if (c == 'i')
    Foo<int>::foo();
else if (c == 'f')
    Foo<float>::foo();
....

```

Is there a more elegant way of doing this? I was thinking of maybe writing a `char trait`, like this:

```
template<char c>
struct char_trait {};

template<>
struct char_trait<'i'> {
    using type = int;
};

```

But since `c` is non-constexpr this won't make much sense.

I would appreciate some hints