Fix cpp deprecation. (#10010)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright 2019-2023 by XGBoost Contributors
|
||||
* Copyright 2019-2024, XGBoost Contributors
|
||||
* \file array_interface.h
|
||||
* \brief View of __array_interface__
|
||||
*/
|
||||
@@ -12,7 +12,7 @@
|
||||
#include <limits> // for numeric_limits
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <type_traits> // std::alignment_of,std::remove_pointer_t
|
||||
#include <type_traits> // for alignment_of, remove_pointer_t, invoke_result_t
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
@@ -643,7 +643,7 @@ auto DispatchDType(ArrayInterfaceHandler::Type dtype, Fn dispatch) {
|
||||
}
|
||||
}
|
||||
|
||||
return std::result_of_t<Fn(std::int8_t)>();
|
||||
return std::invoke_result_t<Fn, std::int8_t>();
|
||||
}
|
||||
|
||||
template <std::int32_t D, typename Fn>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright 2020-2023, XGBoost contributors
|
||||
* Copyright 2020-2024, XGBoost contributors
|
||||
*/
|
||||
#ifndef XGBOOST_DATA_PROXY_DMATRIX_H_
|
||||
#define XGBOOST_DATA_PROXY_DMATRIX_H_
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <any> // for any, any_cast
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <type_traits> // for invoke_result_t
|
||||
#include <utility>
|
||||
|
||||
#include "adapter.h"
|
||||
@@ -171,10 +172,10 @@ decltype(auto) HostAdapterDispatch(DMatrixProxy const* proxy, Fn fn, bool* type_
|
||||
LOG(FATAL) << "Unknown type: " << proxy->Adapter().type().name();
|
||||
}
|
||||
if constexpr (get_value) {
|
||||
return std::result_of_t<Fn(
|
||||
decltype(std::declval<std::shared_ptr<ArrayAdapter>>()->Value()))>();
|
||||
return std::invoke_result_t<
|
||||
Fn, decltype(std::declval<std::shared_ptr<ArrayAdapter>>()->Value())>();
|
||||
} else {
|
||||
return std::result_of_t<Fn(decltype(std::declval<std::shared_ptr<ArrayAdapter>>()))>();
|
||||
return std::invoke_result_t<Fn, decltype(std::declval<std::shared_ptr<ArrayAdapter>>())>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user