dev.gamez.lv Forum Index dev.gamez.lv
Latvian Game Developers Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups 

Templates

 
dev.gamez.lv Forum Index -> Programmēšana
View previous topic :: View next topic  
Author Message
anggelus



Joined: 23 Feb 2005
Posts: 383
Location: Rīga (LV)

PostPosted: Tue Apr 05, 2005 5:33 pm    Post subject: Templates

Man ir viena problēma.
šis template nekompilējas ar Visual Studio 2003, ar Visual Studio 6 viss darbojas.
Code:

template <class T> class IndexLock
{
public:
   IndexLock( T* obj, T::LockType lock ) :
      m_obj(obj) {
      obj->lockIndices( lock );
   }

   ~IndexLock() {
      m_obj->unlockIndices();
   }
   
private:
   T* m_obj;   

   IndexLock();
   IndexLock( const IndexLock& );
   IndexLock& operator=( const IndexLock& );
};

Itkā LockType neesot definēts.
Kāds nezin, kas par vainu?
_________________
No comprendo lo que dice.
Back to top
View user's profile Send e-mail
bubu
Indago Uzvarētājs
Indago Uzvarētājs


Joined: 23 Mar 2004
Posts: 3223
Location: Riga

PostPosted: Tue Apr 05, 2005 6:15 pm    Post subject:

Nu manuprāt tā jau nevar. Tai templeitei T var jau arī būt nedefinēts tāds LockType. Un tad jau izteiksmei T::LockType, manuprāt, nav jēgas. Tāpēc arī errors metās.
Back to top
View user's profile Send e-mail
chaosman



Joined: 28 Oct 2003
Posts: 64
Location: Rīga

PostPosted: Tue Apr 05, 2005 6:16 pm    Post subject: Re: Templates

IndexLock( T* obj, typename T::LockType lock )

Pameegini shitaa.
Back to top
View user's profile
anggelus



Joined: 23 Feb 2005
Posts: 383
Location: Rīga (LV)

PostPosted: Tue Apr 05, 2005 6:32 pm    Post subject:

chaosman Thx. Viss darbojas Smile
_________________
No comprendo lo que dice.
Back to top
View user's profile Send e-mail
Display posts from previous:   
dev.gamez.lv Forum Index -> Programmēšana All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group