extract namespace with require for cpp