hasField fixed for cpp