Topic: A question about parameterized functions.


Author: "Michael Kochetkov" <mkochetk@elvis.ruuuu>
Date: 1999/04/15
Raw View
Hi, all,
I really doubt of the case... What do you think of the code below?

With regards,
Michael Kochetkov.

template<class T>
class A {
};

template<class T>
void f1( T ) {
}

template<class T>
void f1( A<T> ) {
}

// VC6.0 & Watcom 11.0 do not distinguish this f1 functions
// Borland, Metroworks and GCC treat them right.
void main ( void ) {
f1(A<int>());
f1(1);
/*
I am aware of the following well-formed code:
f1<int>(A<int>());
f1<int>(1);
*/
}
---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]