proper copy and equals for structure and pointer