Fix NDK Build. (#5886)

* Explicit cast for slice.
This commit is contained in:
Jiaming Yuan
2020-07-14 18:34:19 +08:00
committed by GitHub
parent 970b4b3fa2
commit 3cae287dea

View File

@@ -227,7 +227,8 @@ XGB_DLL int XGDMatrixSliceDMatrixEx(DMatrixHandle handle,
<< "slice does not support group structure";
}
DMatrix* dmat = static_cast<std::shared_ptr<DMatrix>*>(handle)->get();
*out = new std::shared_ptr<DMatrix>(dmat->Slice({idxset, len}));
*out = new std::shared_ptr<DMatrix>(
dmat->Slice({idxset, static_cast<std::size_t>(len)}));
API_END();
}