Sun Studio 12: 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 from this option is not supported as input to the C++ compiler when templates are used.

See also

–P