fork download
  1. #include <iostream>
  2. #include <vector>
  3.  
  4. template<class T>
  5. struct MyVector
  6. {
  7. typedef std::vector<T> Type;
  8. };
  9.  
  10. template<class T>
  11. void func( const typename MyVector<T>::Type& myVec )
  12. {
  13. for( typename MyVector<T>::Type::const_iterator p = myVec.begin(); p != myVec.end(); p++)
  14. {
  15. std::cout<<*p<<"\t";
  16. }
  17. }
  18.  
  19. int main()
  20. {
  21. MyVector<int>::Type myVec;
  22. myVec.push_back( 10 );
  23. myVec.push_back( 20 );
  24.  
  25. func<int>( myVec );
  26. }
Success #stdin #stdout 0.01s 2856KB
stdin
Standard input is empty
stdout
10	20