<p>I have code like this:</p>

<pre><code>template &lt;typename T, typename U&gt; struct MyStruct {
    T aType;
    U anotherType;
};

class IWantToBeFriendsWithMyStruct
{
    friend struct MyStruct; //what is the correct syntax here ?
};
</code></pre>

<p>What is the correct syntax to give friendship to the template ?</p>

```
```
class IWantToBeFriendsWithMyStruct
{
    template <typename T, typename U>
    friend struct MyStruct;
};
```
```
Works in VS2008, and allows MyStruct to access the class.