/* -*- C++ -*- */ /************************************************************************* * Copyright(c) 1995~2005 Masaharu Goto (root-cint@cern.ch) * * For the licensing terms see the file COPYING * ************************************************************************/ #include #include #include #include using namespace std; template void func(T dmy) { vector x; for(int i=0;i<5;i++) { x.push_back((T)i); } typename vector::iterator first = x.begin(); typename vector::iterator last = x.end(); while(first!=last) { T tmp = *first++; printf("%d ",(int)(tmp)); } printf("%s\n",typeid(x).name()); } template void lfunc(T dmy) { list x; for(int i=0;i<5;i++) { x.push_back((T)i); } typename list::iterator first = x.begin(); typename list::iterator last = x.end(); while(first!=last) { printf("%d ",(int)*first++); } printf("%s\n",typeid(x).name()); } main() { func(double()); func(float()); func(int()); func(char()); func(short()); func(long()); #if 1 func((unsigned int)0); func((unsigned char)0); func((unsigned short)0); func((unsigned long)0); #endif lfunc(double()); lfunc(int()); lfunc(long()); lfunc(float()); #if 0 // Need to compile list containers lfunc(char()); lfunc(short()); #endif }