From 703261e78f9639ccb58751f51ff3073a7311b118 Mon Sep 17 00:00:00 2001 From: QuellaZhang <36754348+QuellaZhang@users.noreply.github.com> Date: Wed, 20 Jul 2022 07:15:39 +0000 Subject: [PATCH] [MSVC][std:c++latest] Fix compiler error (#8093) Co-authored-by: QuellaZhang --- src/common/column_matrix.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/column_matrix.h b/src/common/column_matrix.h index f16d1252f..b7f0bc2c2 100644 --- a/src/common/column_matrix.h +++ b/src/common/column_matrix.h @@ -242,13 +242,13 @@ class ColumnMatrix { num_nonzeros_.resize(n_features, 0); auto get_bin_idx = [&](auto bin_id, auto rid, bst_feature_t fid) { if (type_[fid] == kDenseColumn) { - ColumnBinT* begin = &local_index[feature_offsets_[fid]]; + ColumnBinT* begin = reinterpret_cast(&local_index[feature_offsets_[fid]]); begin[rid] = bin_id - index_base_[fid]; // not thread-safe with bool vector. FIXME(jiamingy): We can directly assign // kMissingId to the index to avoid missing flags. missing_flags_[feature_offsets_[fid] + rid] = false; } else { - ColumnBinT* begin = &local_index[feature_offsets_[fid]]; + ColumnBinT* begin = reinterpret_cast(&local_index[feature_offsets_[fid]]); begin[num_nonzeros_[fid]] = bin_id - index_base_[fid]; row_ind_[feature_offsets_[fid] + num_nonzeros_[fid]] = rid; ++num_nonzeros_[fid];