I have a base class for pieces
class piece;
and an array containing derived objects
piece* board[8][8];
Advantag
Alternatively, if your set of classes is limited - i.e. you know the number, use a variant and visitors. For example, boost::variant And the board is made up of a 2D array of this type. Now to interrogate, you can use visitors...
boost::variant