C++ User's Guide |
The C++ Compiler
This chapter provides a brief conceptual overview of SunTM C++ and the C++ compiler.
1.1 Standards Conformance
The C++ compiler (
CC
) supports the ISO International Standard for C++, ISO IS 14882:1998, Programming Language--C++. TheREADME
file that accompanies the current release describes any departures from requirements in the standard.On SPARCTM platforms, the compiler provides support for the optimization-exploiting features of SPARC V8 and SPARC V9, including the UltraSPARCTM implementation. These features are defined in the SPARC Architecture Manuals, Version 8 (ISBN 0-13-825001-4), and Version 9 (ISBN 0-13-099227-5), published by Prentice-Hall for SPARC International.
In this document, "Standard" means conforming to the versions of the standards listed above. "Nonstandard" or "Extension" refers to features that go beyond these versions of these standards.
The responsible standards bodies may revise these standards from time to time. The versions of the applicable standards to which the C++ compiler conforms may be revised or replaced, resulting in features in future releases of the Sun C++ compiler that create incompatibilities with earlier releases.
1.2 Operating Environments
The C++ compiler (
CC
) integrates with other Sun development tools, such as Sun WorkShopTM and the C compiler. The Sun C++ compiler and its runtime library are part of Sun Visual WorkShopTM C++. You can use these components to develop threaded applications in multiprocessor SolarisTM 2.6, Solaris 7, and in Solaris 8 operating environments.
Note For Solaris 7, the name of the operating environment is Solaris 7, but code and path or package path names might use Solaris 2.7 or SunOSTM 5.7. Always follow the code or path as it is written.
The Sun WorkShop 6 C++ compiler is available in the Solaris 2.6, Solaris 7, and Solaris 8 operating environments on SPARC and IA devices.
Note Features that are unique to a particular operating environment or hardware platform are so indicated. However, most aspects of the compilers on these systems are the same, including functionality, behavior, and features. The multiprocessor features are available as part of the Sun WorkShop on the SPARC platform with Solaris 2.6, Solaris 7, and Solaris 8 software, and require a Sun WorkShop license.
See the C++
README
files for details.1.3
READMEs
The
READMEs
directory contains files that describe new features, software incompatibilities, bugs, and information that was discovered after the manuals were printed. In a default installation, theREADME
files are in/opt/SUNWspro/READMEs
.The
README
files for all compilers are easily accessed by the-xhelp=readme
command-line option. For example,CC
-xhelp=readme
displays the C++README
file directly.To access the HTML version of a
README
, in your Netscape Communicator 4.0 or compatible version browser, open the following file:(If your Sun WorkShop software is not installed in the
/opt
directory, ask your system administrator for the equivalent path on your system.) Your browser displays an index of Sun WorkShop 6 HTML documents. To open aREADME,
find its entry in the index, then click its title.1.4 Man Pages
Online manual (
man
) pages provide immediate documentation about a command, function, subroutine, or collection of such things.You can display a man page by running the command:
example%man
topicThroughout the C++ documentation, man page references appear with the topic name and man section number:
CC(
1) is accessed withman
CC
. Other sections, denoted byieee_flags
(3M) for example, are accessed using the-s
option on theman
command:
example%man -s 3M ieee_flags
1.5 Licensing
The C++ compiler uses network licensing, as described in the Sun WorkShop Installation and Licensing Reference.
If you invoke the compiler, and a license is available, the compiler starts. If no license is available, your request for a license is put in a queue, and your compiler continues when a license becomes available. A single license can be used for any number of simultaneous compiles by a single user on a single machine.
To run C++ and the various utilities, several licenses might be required, depending on the package you have purchased.
1.6 New Features of the C++ Compiler
The Sun WorkShop 6 C++ compiler offers the following new features:
- Compliance with the C++ ISO standard, including:
- Class template partial specialization
- Explicit function template arguments
- Member templates
- Sub-aggregate initialization
- Extern inline functions
- Ordering of static variable destruction
- Definitions-separate template organization allowed for all
-instances
options- Prefetch instructions
The following features were introduced in version 5.0 of the C++ compiler:
- Implementation of the following C++ ISO standards:
- Namespaces and Koenig lookup
- Type
bool
- Array
new
and arraydelete
- Extended support for templates
- The C++ standard library
- Covariant return types on virtual functions
- Compatibility with C++ 4.0, 4.01, 4.1, and 4.2
- Sun WorkShop Memory Monitor for garbage collection and identifying memory leaks
- SPARC V9 support on Solaris 7 and Solaris 8 operating environments
- Binary and source compatibility features to aid a smooth transition to ISO C++
- Multithread-safe C++ standard library
The C++ compiler package also includes:
- Online
README
files containing new or changed features, latest known software and documentation bugs, and other late-breaking information- Man pages that concisely describe a user command or library function
- The C++ name demangling tool set (
dem
andc++filt
)Tools.h++
class library to simplify your programming1.7 C++ Utilities
The following C++ utilities are now incorporated into traditional UNIX® tools and are bundled with the UNIX operating system:
lex
--Generates programs used in simple lexical analysis of textyacc
--Generates a C function to parse the input stream according to syntaxprof
--Produces an execution profile of modules in a programgprof
--Profiles program runtime performance by proceduretcov
--Profiles program runtime performance by statementSee Analyzing Program Performance With Sun WorkShop and associated man pages for further information on these UNIX tools.
1.8 Native-Language Support
This release of C++ supports the development of applications in languages other than English, including most European languages and Japanese. As a result, you can easily switch your application from one native language to another. This feature is known as internationalization.
In general, the C++ compiler implements internationalization as follows:
- C++ recognizes ASCII characters from international keyboards (in other words, it has keyboard independence and is 8-bit clean).
- C++ allows the printing of some messages in the native language.
- C++ allows native-language characters in comments, strings, and data.
Variable names cannot be internationalized and must be in the English character set.
You can change your application from one native language to another by setting the locale. For information on this and other native-language support features, see the operating environment documentation.
Sun Microsystems, Inc. Copyright information. All rights reserved. Feedback |
Library | Contents | Previous | Next | Index |