Fix ptrdiff_t namespace in Span. (#3588)

Fix #3587.
This commit is contained in:
trivialfis 2018-08-15 06:04:55 +08:00 committed by Rory Mitchell
parent 2c502784ff
commit 9265964ee7

View File

@ -32,7 +32,7 @@
#include <xgboost/logging.h> // CHECK
#include <cinttypes> // int64_t
#include <type_traits> // remove_cv_t
#include <type_traits>
/*!
* The version number 1910 is picked up from GSL.
@ -237,9 +237,9 @@ class SpanIterator {
/*!
* The extent E of the span returned by subspan is determined as follows:
*
* - If Count is not std::dynamic_extent, Count;
* - Otherwise, if Extent is not std::dynamic_extent, Extent - Offset;
* - Otherwise, std::dynamic_extent.
* - If Count is not dynamic_extent, Count;
* - Otherwise, if Extent is not dynamic_extent, Extent - Offset;
* - Otherwise, dynamic_extent.
*/
template <detail::ptrdiff_t Extent,
detail::ptrdiff_t Offset,
@ -269,7 +269,7 @@ struct IsAllowedElementTypeConversion : public std::integral_constant<
template <class T>
struct IsSpanOracle : std::false_type {};
template <class T, std::ptrdiff_t Extent>
template <class T, detail::ptrdiff_t Extent>
struct IsSpanOracle<Span<T, Extent>> : std::true_type {};
template <class T>
@ -434,7 +434,7 @@ class Span {
XGBOOST_DEVICE Span(const Container& _cont) : size_(_cont.size()), // NOLINT
data_(_cont.data()) {}
template <class U, ptrdiff_t OtherExtent,
template <class U, detail::ptrdiff_t OtherExtent,
class = typename std::enable_if<
detail::IsAllowedElementTypeConversion<U, T>::value &&
detail::IsAllowedExtentConversion<OtherExtent, Extent>::value>>