Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / CodeWarrior / February 2004



Tip: Looking for answers? Try searching our database.

Member function specialization in CW 9.1

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Alexey Proskuryakov - 24 Feb 2004 09:29 GMT
Hi!

 When I was trying to compile my code with VC++ 7.1, it gave some errors
that might indicate that CW is a little too forgiving for incorrect syntax
of template specialization. So I wonder if that's the case, or not:

-----------------------------------------
template<typename T>
struct A {};

template<>
struct A<int> { void f(); };

template<> // (1)
void A<int>::f() {}
-----------------------------------------

 Here, the template A is specialized for T==int, and then a definition of
A<int>::f() is given. As A<int> isn't a template, but rather a normal class,
the "template<>" at (1) should give an error. VC++ 7.1 and Comeau both think
so, while CodeWarrior allows either variant, with specialization syntax or
without it.

- WBR, Alexey Proskuryakov
MW Ron - 24 Feb 2004 17:49 GMT
>Hi!
>
[quoted text clipped - 18 lines]
>so, while CodeWarrior allows either variant, with specialization syntax or
>without it.

I'll check with our C++ engineer and submit this as a possible bug.

Thanks for bringing this to our attention.

Ron

Signature

Announcing  CodeWarrior Development Tools for Windows v9.2
http://www.metrowerks.com/MW/Develop/Desktop/Windows/Professional/Default.htm
Ron Liechty - MWRon@metrowerks.com - <http://www.metrowerks.com>

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.