<html>
<head>
<title>SWIG:Examples:go:template</title>
</head>

<body bgcolor="#ffffff">


<tt>SWIG/Examples/go/template/</tt>
<hr>

<H2>C++ template support</H2>

<p>
This example illustrates how C++ templates can be used from Go using
SWIG.

<h2>The C++ Code</h2>

Let's take a templated function and a templated class as follows:

<blockquote>
<pre>
/* File : example.h */

// Some template definitions

template<class T> T max(T a, T b) { return  a&gt;b ? a : b; }

template<class T> class vector {
  T *v;
 