improve targetform c++ code for langc++ compat