Ich habe Code wie folgt aus:Wie markieren Sie eine Strukturvorlage als Freund?
template <typename T, typename U> struct MyStruct {
T aType;
U anotherType;
};
class IWantToBeFriendsWithMyStruct
{
friend struct MyStruct; //what is the correct syntax here ?
};
Was ist die korrekte Syntax Freundschaft zu der Vorlage zu geben?
cool! das funktioniert (ich kann noch nicht wählen, werde ich bei der Registrierung) – David
Beachten Sie, dass dies gibt alle Arten von MyStruct Zugang zu IWantToBeFriends, es ist auch möglich, bestimmte Spezialisierungen von MyStruct Zugriff zu gewähren. –
Es funktioniert auch in g ++. –