可能性の重複:
What is forward declaration in c++?ヘッダーファイルに空のクラス宣言がありますか?
私は、コードの一部は、この単純な例ではやっていることについて質問があります。私は友人のクラスを探し、その動作を理解していますが、実際にトップクラスの宣言(つまりロボット)が何を理解していません。ハッピークラスはロボットオブジェクトを使用できますが、プライベートパーツにアクセスすることはできません。情報があればわかります。
#include <stdlib.h>
#include <stdexcept>
template <typename T> // What is this called when included
class Robot; // is there a special name for defining a class in this way
template <typename T>
class Happy
{
friend class Joe<T>;
friend class Robot<Happy<T> >;
// ...
};
http://stackoverflow.com/questions/4926105/what-is-forward-declaration-in-c – mydogisbox