There are several reasons why new code should be written using the extensionless version of the header files instead of the. Or it may get built against the old style library. It may fail to compile because the compiler tries to use the new style library, but the code relies on functionality only present in the old iostream library. It may fail to compile due to simple lack of the header. Hence, if a given piece of code using iostream.h is compiled on a randomly chosen, recent compiler, the results are unpredictable. Instead they either leave out the old style headers completely, so that code depending on iostream.h simply won't compile, or they have the old style header include the new style header and use using directives to pull the declarations from the std namespace into the root namespace. However, many compilers in recent years have taken a different approach. This was often coupled with deprecation warnings when the old headers were included. From the period following this decision by the Standards Committee to about 2002 this was the common decision by many compiler vendors. h extension and the new style headers without. This allowed compiler vendors to ship the old style C++ library headers with the. To ease transition, the C++ Standards Committee declared that code including the standard C++ headers would use include directives that lack an extension. Essentially, while some of the old code would work with the new library, a lot still didn't. Other functional differences included the change in several enumerations that controlled I/O. For one thing the standard library version was heavily templated. The version of the iostream library that the Standards Committee produced was quite a bit different from the CFront implementation. This process focused both on the core language and the standard library, of which the iostream library was to be part. Sometime later, the C++ language entered the standardization process. Hence when other compiler vendors implemented C++, they copied the iostream library (amongst others). Now CFront, its library and The C++ Programming Langauge formed the de facto standard for C++ for some time. This version of the iostream library lived in the headers iostream.h, fstream.h and so on. It was developed at Bell Labs by Bjarne Stroustrup and shipped with the original C++ compiler, CFront and described in the first edition of Stroustrup's The C++ Programming Language. The original iostream library was written to challenge the claim that a terse, type safe I/O system needed special language support. h forms are deprecated without explaining what the difference is and why, in fact, using the extensionless version is superior. This is often given with only the explanation that the. A frequent piece of advice is often given to new C++ programmers is to use instead of or instead of.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |