Re[2]: GCC 3.3 template compile error?
Re[2]: GCC 3.3 template compile error?
- Subject: Re[2]: GCC 3.3 template compile error?
- From: Peter Mulholland <email@hidden>
- Date: Sun, 14 Oct 2007 01:05:23 +0100
Hello Tim,
Sunday, October 14, 2007, 12:56:27 AM, you wrote:
> class LibXmlReader
> {
> public:
> template <class T> T getAttribute(const xmlpp::Node* node, const
> std::string& attrName) const;
> ...
> };
Try:
template <class T> typename T getAttribute(const xmlpp::Node* node, const
std::string& attrName) const;
> Also, this code compiles fine with GCC 4 on my Mac, and with VC++ 7.1 on my
> Windows PC. It causes GCC 3.3, compiling for PPC, to complain.
IMHO GCC has always been dodgy at handling C++ templates. The GCC docs
claim they are following "the standard", but personally I think it is
just awkward, and an excuse for poor parsing.
Unless you really need to support 10.2 and earlier, I would just
compile your PPC code with GCC 4, which is 10.3.9 minimum. GCC 3 has
many known issues, none of which will be fixed now.
--
Best regards,
Peter mailto:email@hidden
_______________________________________________
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