This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Templates in gcc / Msvc++ 5


Chad Loder wrote:
Hello...I have been doing some messing around with partial specialization
of template classes in C++. The cygnus gcc compiled this without errors,
but MSVC++ 5.0 did not like it...does anyone know what the status of
templates in the respective compilers is (e.g., egcs, new versions, etc.)?

-chad

template<class T>
class common {
public:
};

template<class T>
class generic : public common<T> {
public:
};

template<class T>
class generic<T *> : public common<T*>{
public:
};
 

Our application is very large, and makes heavy use of templates.  It was originallydeveloped on various UNIX platforms, and we have ported it to NT, using Borland
5.0.1.

We have attempted to port this to VC++ (both 4.2 and 5.0) and can't get it to compile.

One problem is in using templated classes as function arguements.  The compiler flattens
the templated arguement, and ignores differences in the template parameter(s).

i.e.  func(TClass<int>)  and func(TClass<float>)  resolve to func(TClass).

You end up with duplicate symbol errors.

Microsoft has essentially that this is not a critical bug for them, and don't plan
to fix it any time soon.

(This statement came from Microsoft personnel at the Professional Developers Conferencd
a couple of months ago.)
 

----------------------------------------------------
| Chad Loder - Somerville, MA, USA                 |
| EMail:     cloder@acm.org                        |
| Home Page: http://www.ccs.neu.edu/home/cloder    |
----------------------------------------------------

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

 
-- 
Name:     Jim Winsor              |    
E-Mail:   jwinsor@i2.com          |  
Phone:    214-860-6420  (office)  |     
          972-612-9727  (home)    |
 
Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]