• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
subclass variable not defined in scope?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

subclass variable not defined in scope?


  • Subject: subclass variable not defined in scope?
  • From: Bob Sabiston <email@hidden>
  • Date: Wed, 21 Sep 2005 16:20:50 -0500

Hello again,

  Still trying to compile this codewarrior project.  I've gotten to some code from the Wild Magic library that I use, and it is choking on the following:

 error: 'm_afTuple' was not declared in this scope

from this code:

template <class Real>
Vector2<Real>::Vector2 (Real fX, Real fY)
{
    m_afTuple[0] = fX;
    m_afTuple[1] = fY;
}


The class Vector2 is a subclass of Vector, like this:

template <class Real>
class WML_ITEM Vector2 : public Vector<2,Real>
{
...
};

And the offending variable m_afTuple is defined in the base class template:

template <int N, class Real>
class WML_ITEM Vector
{
public:
...

protected:
    // support for comparisons
    int CompareArrays (const Vector& rkV) const;

    Real m_afTuple[N];
};


I thought that the 'protected' status was causing the error, but I moved it into the public section and still got the error.
Does anyone know what could be causing the error?  Is it something to do with templates maybe?  
Thanks very much,
Bob


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: subclass variable not defined in scope?
      • From: Cameron Hayne <email@hidden>
  • Prev by Date: Re: why can't you initialize variable in case statements
  • Next by Date: Re: why can't you initialize variable in case statements
  • Previous by thread: Re: Specifying Where The Build Product Should Be Placed
  • Next by thread: Re: subclass variable not defined in scope?
  • Index(es):
    • Date
    • Thread