Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!apple!rutgers!att!ulysses!andante!alice!bs From: bs@alice.UUCP (Bjarne Stroustrup) Newsgroups: comp.lang.c++ Subject: Re: C++ design Summary: type system Keywords: information Message-ID: <9478@alice.UUCP> Date: 13 Jun 89 19:44:05 GMT References: <9474@alice.UUCP> Organization: AT&T Bell Laboratories, Murray Hill NJ Lines: 24 C++ is not simply a set of features grafted onto C. The C++ type system provides coherent checking of all expressions. This system can - when necessary - be broken by explicit use of casts or explicit use of the ellipsis (...) in a function declaration. The simple system of built-in types and standard onversions can be augmented by user-defined types (classes) and user-defined conversions so that new types with essentially the same status as the built-in ones can be provided. The general idea of these mechanisms (classes and operator overloading) is to make C++ extensible but not mutable. It is not possible to, say, redefine + to mean subtraction for integers, though a programmer (with a warped sense of humor) can define his/her own INT class where + means subtraction. Where user-defined types are used ambiguity control is used to make sure that ambiguities are either resolved or reported as errors at compile time. Similar ambiguity control is used for name lookup where multiple inheritance is used. A C++ program consistes of many separately compiled parts. Consistency of the type and name usage is ensured by the use of header files containing the sets of declarations specifying interfaces. In release 1.*, of C++ there was no check on the consistency of the use of these interfaces. In 2.0, consistency is checked at link time.