Sun Studio 12 Update 1: C++ User's Guide

A.2.13.1 Examples

This option is useful for determining the changes made by the preprocessor. For example, the following program, foo.cc, generates the output shown in A.2.13.1 Examples


Example A–1 Preprocessor Example Program foo.cc


#if __cplusplus < 199711L
int power(int, int);
#else
template <> int power(int, int);
#endif

int main () {
  int x;
  x=power(2, 10);
}
.


Example A–2 Preprocessor Output of foo.cc Using -E Option


example% CC -E foo.cc
#4 "foo.cc"
template < > int power (int, int);


int main () {
int x;
x = power (2, 10);
}

Warnings

Output of this option might not be usable as input to a C++ compilation if the code contains templates under the "definitions-separate" model.

See also

–P