Re: name resolution of inherited templated classes?

  • From: Tyler Littlefield <tyler@xxxxxxxxxxxxx>
  • To: programmingblind@xxxxxxxxxxxxx
  • Date: Wed, 28 Jul 2010 21:05:17 -0600

hello,
I've played around with this some again today, and still having the same 
issues. I moved VariableContainer up to Entity, but it doesn't seem as if the 
template is being resolved before, so it's causing a problem. Is there a 
workaround?
                Thanks,
Tyler Littlefield
        http://tds-solutions.net
        Twitter: sorressean

On Jul 28, 2010, at 7:33 AM, Dave wrote:

> I'll take a crack at this one.  Are your subclasses taking class
> templates as well?  If so, then take a look at 35.19 of:
> http://www.parashift.com/c++-faq-lite/templates.html#faq-35.19
> 
> Not sure what context you're calling Get() from, but likely the second
> or third workaround they mentioned could help.
> 
> On 7/27/10, Tyler Littlefield <tyler@xxxxxxxxxxxxx> wrote:
>> Hello all,
>> I'm working on my game engine again, and ran into a bit of a problem.
>> I have a function that is called when a command is ran, which gets passed a
>> pointer to the player that called it.
>> What I'm trying to do is get a variable from my VariableContainer class,
>> which finds the variant and returns the value. So, basically:
>> Player inherits Entity (which is a game object), and Entity inherits the
>> templated VariableContainer class.
>> In my command I have something like:
>> int str=mobile->Get("strength");
>> When I compile, it says that the get function could not be found in class
>> 'Player'.
>> Is there a workaround to this? I tried adding a Get function into Entity
>> which would do:
>> VariableContainer::Get("bla") and return that, but that failed also.
>> 
>>              Thanks,
>> Tyler Littlefield
>>      http://tds-solutions.net
>>      Twitter: sorressean
>> 
>> __________
>> View the list's information and change your settings at
>> //www.freelists.org/list/programmingblind
>> 
>> 
> __________
> View the list's information and change your settings at 
> //www.freelists.org/list/programmingblind
> 

__________
View the list's information and change your settings at
//www.freelists.org/list/programmingblind

Other related posts: