#include <vector>
class A
{
std::vector<int> vec;
void swap( A & other) noexcept(noexcept(vec.swap(other.vec)))
{
vec.swap(other.vec);
}
};
int main()
{
}
This code compiles under clang(3.4) but not under gcc (4.7.1). Anyone can tell me what I am doing wrong?
EDIT
gcc error message is :
error: invalid use of incomplete type ‘class A’
error: forward declaration of ‘class A’