Skip to main content
GameDev.net gamedev.net
🔒 Locked

Template problem

Started by The C modest god Mar 6, 2004 at 5:08 AM 0 replies 200+ views
Original Post
The C modest god
The C modest god
I have the following code: template class StreamList { public: void Allocate (DWORD ObjectsAmount); void Copy (StreamList & SourceList); void Enlarge (DWORD ObjectsAmount); T & operator[] (DWORD Index); StreamList (); SteramList (DWORD ObjectsAmount); ~StreamList(); DWORD ObjectsAmount; private: T * pObjects; }; template StreamList::StreamList(DWORD ObjectsAmount) { this->pObjects = new T [ObjectsAmount]; this->ObjectsAmount = ObjectsAmount; } However, it says on the constructor with DWORD that it is unable to resolve function overload. Why is that?
It's all about the wheel.Never blindly trust technoligy.I love my internal organs.Real men don't shower. Quote: Original post by Toolmaker Quote:
The C modest god
The C modest god
quote:
Original post by The C modest god
I have the following code:

template
class StreamList {
public:
void Allocate (DWORD ObjectsAmount);
void Copy (StreamList & SourceList);
void Enlarge (DWORD ObjectsAmount);
T & operator[] (DWORD Index);

StreamList ();
SteramList (DWORD ObjectsAmount);
~StreamList();

DWORD ObjectsAmount;
private:
T * pObjects;
};

template
StreamList::StreamList(DWORD ObjectsAmount)
{
this->pObjects = new T [ObjectsAmount];
this->ObjectsAmount = ObjectsAmount;
}

However, it says on the constructor with DWORD that it is unable to resolve function overload.
Why is that?



Never mind, found my problem.
It was a typo error, you can see it yourself
It's all about the wheel.Never blindly trust technoligy.I love my internal organs.Real men don't shower. Quote: Original post by Toolmaker Quote:

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.