Merge change 1366

* changes:
  converted to C++