diff --git a/R-package/src/xgboost_R.cc b/R-package/src/xgboost_R.cc index 0fe56be1711d..fcbccb145852 100644 --- a/R-package/src/xgboost_R.cc +++ b/R-package/src/xgboost_R.cc @@ -263,7 +263,7 @@ XGB_DLL SEXP XGDMatrixSetStrFeatureInfo_R(SEXP handle, SEXP field, SEXP array) { } std::vector vec(len); std::transform(str_info.cbegin(), str_info.cend(), vec.begin(), - [](auto const &str) { return str.c_str(); }); + [](std::string const &str) { return str.c_str(); }); CHECK_CALL(XGDMatrixSetStrFeatureInfo(R_ExternalPtrAddr(handle), name, vec.data(), len)); R_API_END(); return R_NilValue;