Ich möchte Folgendes tun:
template <typename T>
struct foo
{
template <typename S>
friend struct foo<S>;
private:
// ...
};
aber mein Compiler (VC8) verschluckt sich daran:
error C3857: 'foo<T>': multiple template parameter lists are not allowed
Ich möchte alle möglichen Instanziierungen von haben template struct foo
Freunde von foo<T>
für alle T
.
Wie mache ich das?
EDIT: Das
template <typename T>
struct foo
{
template <typename>
friend struct foo;
private:
// ...
};
scheint zu kompilieren, aber ist es richtig? Freunde und Vorlagen haben eine sehr unnatürliche Syntax.