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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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();
}