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,, generates the output shown in A.2.13.1 Examples

Example A–1 Preprocessor Example Program

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

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

Example A–2 Preprocessor Output of Using -E Option

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

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


Output from this option is not supported as input to the C++ compiler when templates are used.

See also