13

テンプレートクラスがある場合:

template<typename Layout>
class LayoutHandler : Handler {
};

パラメータ Layout をクラスのユーザーに公開したいと思います。それで:

template<typename Layout>
class LayoutHandler : Handler {
public:
    typedef Layout Layout; // using the same name
};

VS2012 はこのコードをコンパイルして、期待どおりの結果を得ることができます。(私はそれをチェックするために std::is_same を使用します。) これは標準の C++03 または C++11 で許可されていますか?

4

2 に答える 2