OAR

RTEMS GNU Tools On-Line Library


C++ Extensions

PREV UP NEXT Bookshelf Using and Porting the GNU Compiler Collection (GCC)

Chapter 5: Extensions to the C++ Language

The GNU compiler provides these extensions to the C++ language (and you can also use most of the C language extensions in your C++ programs). If you want to write code that checks whether these features are available, you can test for the GNU compiler the same way as for C programs: check for a predefined macro __GNUC__. You can also use __GNUG__ to test specifically for GNU C++ (see Standard Predefined).

  • Naming Results Giving a name to C++ function return values.
  • Min and Max C++ Minimum and maximum operators.
  • Destructors and Goto Goto is safe to use in C++ even when destructors are needed.
  • C++ Interface You can use a single C++ header file for both declarations and definitions.
  • Template Instantiation Methods for ensuring that exactly one copy of each needed template instantiation is emitted.
  • Bound member functions You can extract a function pointer to the method denoted by a `->*' or `.*' expression.
  • C++ Signatures You can specify abstract types to get subtype polymorphism independent from inheritance.


  • PREV UP NEXT Bookshelf Using and Porting the GNU Compiler Collection (GCC)

    Packaging copyright © 1988-2000 OAR Corporation
    Context copyright by each document's author. See Free Software Foundation for information.