I have code like this:
template struct MyStruct {
T aType;
U anotherType;
};
class IWantToBeFriendsWithMyStruct
{
class IWantToBeFriendsWithMyStruct
{
template <typename T, typename U>
friend struct MyStruct;
};
Works in VS2008, and allows MyStruct to access the class.
According to this site, the correct syntax would be
class IWantToBeFriendsWithMyStruct
{
template <typename T, typename U> friend struct MyStruct;
}