[C++]: fixed #195 by adding const to static generated methods