programming/C++
Template(2)
설은
2009. 11. 17. 20:32
template <class T>
class MyVector
{
T *base;
int usage;
int capacity;
public:
void Foo();
}
template <class T>
void MyVoector<T>::Foo() //헤더파일에
{
....
}
void main()
{
MyVector<int> *mv = new myVector<int>();
mv -> Foo();
}
-------------------------------------------------
class myVector <int>
{
int * base;
......
}
class MyVector
{
T *base;
int usage;
int capacity;
public:
void Foo();
}
template <class T>
void MyVoector<T>::Foo() //헤더파일에
{
....
}
void main()
{
MyVector<int> *mv = new myVector<int>();
mv -> Foo();
}
-------------------------------------------------
class myVector <int>
{
int * base;
......
}