A
Armen Tsirunyan
Hi all.
Consider the following program
#include <iostream>
#include <typeinfo>
template <class T>
void f(T x)
{
std::cout << typeid(x).name() << std::endl;
}
int main()
{
f(2000000000);
f(3000000000u);
f(3000000000);
}
I am using Microsoft Visual Studio 2008 and on my machine int and long
are both 32 bits.
As far as I understood from the 2003 C++ standard, this program should
print
int
unsigned int
unsigned int
however it prints
int
unsigned int
unsigned long
Is this a bug of MSVC9.0 or I have misinterpreted the standard?
Also, please note that I am aware that the standard imposes no
considerable requirements on type_info::name(). So please let's not
say "the output is correct since name can be anything".
Also, if this indeed is a bug of MSVC (this is a bit off-top now) is
there any use reporting that bug to them, I mean do they care?
Thank you in advance for your comments,
Armen Tsirunyan.
Consider the following program
#include <iostream>
#include <typeinfo>
template <class T>
void f(T x)
{
std::cout << typeid(x).name() << std::endl;
}
int main()
{
f(2000000000);
f(3000000000u);
f(3000000000);
}
I am using Microsoft Visual Studio 2008 and on my machine int and long
are both 32 bits.
As far as I understood from the 2003 C++ standard, this program should
int
unsigned int
unsigned int
however it prints
int
unsigned int
unsigned long
Is this a bug of MSVC9.0 or I have misinterpreted the standard?
Also, please note that I am aware that the standard imposes no
considerable requirements on type_info::name(). So please let's not
say "the output is correct since name can be anything".
Also, if this indeed is a bug of MSVC (this is a bit off-top now) is
there any use reporting that bug to them, I mean do they care?
Thank you in advance for your comments,
Armen Tsirunyan.