Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
* longlong support in DEC C++
@ 1997-08-28  4:00 Dirk Grunwald
  0 siblings, 0 replies; only message in thread
From: Dirk Grunwald @ 1997-08-28  4:00 UTC (permalink / raw)





When I try to compile the following..

--------------------
#include <stdlib.h>
#include <stream.h>
void
main()
{
    long long t_longlong = 30;
    cout << "And the magic number is " << t_longlong << "\n";
}
--------------------

using DEC C++, I get the following error. G++ compiles it just fine.
This is DEC C++ V5.4 and 5.5 (I'm wrapping the error message for
readability).

[foobar-75] cxx -c simple.C
cxx: Error: simple.C, line 10: In this statement, the argument list
         "cout<<"And the magic number is "<<t_longlong"
         matches more than one "ostream::operator <<".
    cout << "And the magic number is " << t_longlong << "\n";
----^
[foobar-76] g++ -c simple.C

Obviously, the DEC C++ compiler is treating 'long long' as something
else internally. I can find no stream converter for 'long long'. If I
provide the function....

inline ostream& operator<<(ostream& s, long long t)
{
  s << (long) t;
  return s;
}

then all works as desired. Is "long long" a "long long" child in DEC
C++? I realize it's an abomination, but you'd like to have consistency
in the language. This will become increasingly important as people
move applicatsion from Sun's idea of a 64-bit architecture to the
Alpha.


-- 
Dirk Grunwald                 Assoc. Prof, Univ. of Colorado at Boulder



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1997-08-28  4:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1997-08-28  4:00 longlong support in DEC C++ Dirk Grunwald

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox