2008-12-01から1日間の記事一覧

C++0x 拡張friend宣言

C++

C++03 のfriend宣言に以下のような制限があるため 識別子がtypedef-nameまたはtemplate type-parameterになる場合、elaborated-type-specifierは不適格です。 以下の friend 宣言は不適格になります。 template <class T> class X { friend class T; // エラー!frien</class>…