Intended use of std::is_trivially_copyable in GridPtr?
I stumbled over this during my test with gcc-4.9 and am wondering what the intended usage is. My tests revealed that a struct with a pointer inside of it is trivially copyable but I am not sure whether the code behaves how it is supposed to in this case.
#include <iostream>
#include <type_traits>
using namespace std;
struct C{
int* val;
};
struct B{
int i;
virtual void print(){
cout<<i<<std::endl;
}
};
int main()
{
cout<<is_trivially_copyable<int*>::value<<endl;
cout<<is_trivially_copyable<C>::value<<endl;
cout<<is_trivially_copyable<B>::value<<endl;
return 0;
}
Outputs:
1
1
0