T
Tom Richardson
The following code gives the output "1.21.21.2" with msvc6,
while it gives "1.2T34" with g++.
What's up with this?
Regards, Tom
----
#include <iostream>
using namespace std;
template<class T>
void plum() { cout << "T"; }
template<>
void plum<double>() { cout << 1.2; }
template<>
void plum<int>() { cout << 34; }
int main()
{
plum<double>();
plum<bool>();
plum<int>();
return 0;
}
while it gives "1.2T34" with g++.
What's up with this?
Regards, Tom
----
#include <iostream>
using namespace std;
template<class T>
void plum() { cout << "T"; }
template<>
void plum<double>() { cout << 1.2; }
template<>
void plum<int>() { cout << 34; }
int main()
{
plum<double>();
plum<bool>();
plum<int>();
return 0;
}