0
#include <vector>
class A
{
    std::vector<int> vec;

    void swap( A & other) noexcept(noexcept(vec.swap(other.vec)))
    {
        vec.swap(other.vec);
    }

};

int main()
{
}

このコードは、clang(3.4) ではコンパイルできますが、gcc (4.7.1) ではコンパイルできません。誰が私が間違っているのか教えてもらえますか?

編集

gcc エラー メッセージは次のとおりです。

error: invalid use of incomplete type ‘class A’
error: forward declaration of ‘class A’
4

1 に答える 1