some C++ code for abstract algebraic structures