linux - Does the GCC compiler support classic C++? -


this question related process of porting on hp-ux executable. on hp-ux, executable compiled , linked using hp-ux acc compiler. given compiler way in 1996, doesn't appear supports standard c++ (the standard c++ used today). rather, compiles based on standard c++ hp-ux calls classic c++. wondering if gcc supported option classic c++?

thanks.

haven't found in gcc docs, might mistaken.

you can port classic standard c++, using following 2 guidelines (from hp documentation):

(1.) iostream headers:

<iostream.h> maps <iostream>

<fstream.h> maps <fstream> , optionally <iostream>

<strstream.h> maps <strstream>

<iomanip.h> maps <iomanip>

note new header file <iosfwd> can used if declaration of ostream , istream needed , not specific insertion , extraction operators. replace cases following used:

class ostream; // replace #include <iosfwd> ostream& operator<<(ostream&, foo); // change based on (2) below 

(2.) source mapping:

do 1 (or more) of following. these changes apply both iostream headers , container headers. add following using directive. work -aa or -ap.

namespace std {} using namespace std; cout << "hi guy" << endl; 

add specific using declarations. works -aa.

using std::cout; using std::endl; cout << "hi guy" << endl; 

add std:: before each symbol. works -aa.

std::cout << "hi guy" << std::endl; 

Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -