A class:
Is it wrong to do that? I'm working on my first sizable C++ project and I'm doing this for most small functions to save clutter in my .cpp files.Code:struct pos{ int x; int y; int z; pos(){} pos(int a, int b, int c){x = a;y = b;z = c;} pos(const pos& p){x = p.x;y = p.y;z = p.z;} pos operator=(pos p){x = p.x;y = p.y;z = p.z;} bool operator==(pos p) {return bool((x == p.x) && (y == p.y) && (z == p.z));} };