language: C++ 4.7.2 (gcc-4.7.2)
date: 280 days 16 hours ago
link:
visibility: public
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <iostream>
#include <vector>
 
template<class T>
struct MyVector
{
    typedef std::vector<T> Type;
};
 
template<class T>
void func( const typename MyVector<T>::Type& myVec )
{
    for( typename MyVector<T>::Type::const_iterator p = myVec.begin(); p != myVec.end(); p++)
    {
        std::cout<<*p<<"\t";
    }
}
 
int main()
{
    MyVector<int>::Type myVec;
    myVec.push_back( 10 );
    myVec.push_back( 20 );
 
    func<int>( myVec );
}