|
-
April 17th, 2002, 03:54 PM
#1
template question..
I defined a class template like this:
template <class I> class MyTemp
{
I* i;
public:
MyTemp(I j=0) { i = new I; *i = j; }
~MyTemp() { delete i; }
};
and a class B like this:
class B
{
int i;
public:
B(): i(0) {}
B(int j): i(j) {}
};
when I try to do this: MyTemp<B> b; I receive a compiler error.
Can anyone explain me why?
Thanx for every help.
Paolo.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|