```
int lim;    
do{
      cin>>lim;
      switch(lim)
      {
      case 1: {mpa<1,int,const char*> C; }break;
      case 2: {mpa<2,int,const char*> C; }break;
      case 3: {mpa<3,int,const char*> C; }break;
      case 4: {mpa<4,int,const char*> C; }break;
      case 5: {mpa<5,int,const char*> C; }break;
      default: cout<<"Incorrect number, please repeat\n";
      }
 }while(lim<1 || lim>5);

```

I want to pass a value(1,2,3,4 or 5) to the template int a,typename T1,typename T2. I need different instantiations of this template. But object C will be destroyed after switch. How to apply different instantiations to the same name of object?