This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


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

std::cout and long long problem


Hi,

System: Redhat Linux 7.0 (i386)
Compiler: gcc version 2.97 20010211 (experimental) (from CodeSourcery)

Does std::cout need to support the long long type?
What does the Standard say about long long?
The following code fails compilation:


#include <iostream>


int main(int , char **)
{
  unsigned long long f = 0; 
  std::cout << f << std::endl;
  return 0;

}


% g++ d.cc

d.cc: In function `int main(int, char**)':
d.cc:8: ambiguous overload for `ostream& << long long unsigned int&' operator
/usr/local/include/g++-v3/bits/std_ostream.h:88: candidates are:
   std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT,
   _Traits>::operator<<(long int) [with _CharT = char, _Traits =
   std::char_traits<char>]
/usr/local/include/g++-v3/bits/std_ostream.h:91:
   std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT,
   _Traits>::operator<<(long unsigned int) [with _CharT = char, _Traits =
   std::char_traits<char>]

[snip]
-- 
Craig Rodrigues        
http://www.gis.net/~craigr    
rodrigc@mediaone.net          


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