Simple implementation CGD in C++11