SWIG Features

SWIG Features

This information is based on the current release, SWIG-1.3.16.

Code Generation

SWIG current generates wrapper code for nine different target languages: In addition to this, an XML output module was recently added and work is in progress on a Pike module.

ANSI C

SWIG is capable of wrapping all of ANSI C. Features include:

ANSI C++

SWIG provides wrapping support for almost all of ANSI C++. The only major C++ feature not currently supported by SWIG is the wrapping of nested classes--a problem we're working on. SWIG also does not allow C++ virtual methods to be implemented in the target language (a subtle feature that might be useful in certain projects).

C++ users who rely on advanced template programming techniques (e.g., template meta-programming) should also be aware that SWIG currently requires manual instantiation of all template classes. Therefore, if your application somehow involves the instantiation of 50000 template classes, your mileage might vary.

Preprocessing

SWIG provides a full C preprocessor with the following features:

Customization features

SWIG provides control over most aspects of wrapper generation. Most of these customization options are fully integrated into the C++ type system--making it easy to apply customizations across inheritance hierarchies, template instantiations, and more. Features include: