• 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
Re: GCC 3.3 template compile error?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GCC 3.3 template compile error?


  • Subject: Re: GCC 3.3 template compile error?
  • From: David Fang <email@hidden>
  • Date: Sat, 20 Oct 2007 21:19:33 -0400 (EDT)

What am I doing wrong here?

template <class T>
class LevelValueScaleTable
{
private:
    T                m_initialValue;
    std::vector<T>    m_scaleTable;

    mutable T        m_cachedValue;
    mutable int        m_cachedScale;

public:
    LevelValueScaleTable() : m_initialValue(0), m_cachedScale(-1) {}

void Read(const LibXmlReader& reader, const xmlpp::Node* node)
{
m_scaleTable.clear();
m_initialValue = reader.getAttribute<T>(node, "initial"); // <-- error occurs here
...
------------------------------------------------------------------------
I have sometimes gotten this error when a name was not recognized, but I don't see that kind of problem here.

Are the arguments to getAttribute correct for type and constness? Do the parameters they correspond to depend on the template parameter for getAttribute?

Hi,
Sorry if this reply comes late, but I haven't been checking this list as regularly as before.


On your error line, you need:

m_initialValue = reader.template getAttribute<T>(node, "initial");
                        ^^^^^^^^

The 'template' keyword is a disambiguator when calling template member functions within a template context. Adding 'template' will make your code happy with gcc-3.3 through gcc-4 (and beyond).

Better late than never?  :)

Fang

David Fang
Computer Systems Laboratory
Electrical & Computer Engineering
Cornell University
http://www.csl.cornell.edu/~fang/
	-- (2400 baud? Netscape 3.0?? lynx??? No problem!)
_______________________________________________
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


References: 
 >GCC 3.3 template compile error? (From: "Tim Conkling" <email@hidden>)
 >Re: GCC 3.3 template compile error? (From: David Rowland <email@hidden>)

  • Prev by Date: Re: Using Boost in XCode
  • Next by Date: Re: hdiutil attach fails under some repeatable circumstances
  • Previous by thread: Re: GCC 3.3 template compile error?
  • Next by thread: Re: GCC 3.3 template compile error?
  • Index(es):
    • Date
    • Thread