Commit a8ada31a authored by Joe Loser's avatar Joe Loser Committed by Facebook Github Bot

Use _t variants of type traits (#994)

Summary:
- Instead of wrapping a type trait with `_t` use the standard library's
  `_t` type trait variant. This is safe since Folly requires C++14,
  whereas previously the use of `_t` was supported prior to C++14.
Pull Request resolved: https://github.com/facebook/folly/pull/994

Reviewed By: vitaut

Differential Revision: D13634598

Pulled By: yfeldblum

fbshipit-source-id: 09ed9fc1444f507b7422b690b36926cb57616e9e
parent 349b2329
...@@ -1216,8 +1216,8 @@ typename std::enable_if< ...@@ -1216,8 +1216,8 @@ typename std::enable_if<
Expected<Tgt, ConversionCode>>::type Expected<Tgt, ConversionCode>>::type
convertTo(const Src& value) noexcept { convertTo(const Src& value) noexcept {
if /* constexpr */ ( if /* constexpr */ (
folly::_t<std::make_unsigned<Tgt>>(std::numeric_limits<Tgt>::max()) < std::make_unsigned_t<Tgt>(std::numeric_limits<Tgt>::max()) <
folly::_t<std::make_unsigned<Src>>(std::numeric_limits<Src>::max())) { std::make_unsigned_t<Src>(std::numeric_limits<Src>::max())) {
if (greater_than<Tgt, std::numeric_limits<Tgt>::max()>(value)) { if (greater_than<Tgt, std::numeric_limits<Tgt>::max()>(value)) {
return makeUnexpected(ConversionCode::ARITH_POSITIVE_OVERFLOW); return makeUnexpected(ConversionCode::ARITH_POSITIVE_OVERFLOW);
} }
......
...@@ -343,7 +343,7 @@ inline exception_wrapper::exception_wrapper( ...@@ -343,7 +343,7 @@ inline exception_wrapper::exception_wrapper(
namespace exception_wrapper_detail { namespace exception_wrapper_detail {
template <class Ex> template <class Ex>
Ex&& dont_slice(Ex&& ex) { Ex&& dont_slice(Ex&& ex) {
assert(typeid(ex) == typeid(_t<std::decay<Ex>>) || assert(typeid(ex) == typeid(std::decay_t<Ex>) ||
!"Dynamic and static exception types don't match. Exception would " !"Dynamic and static exception types don't match. Exception would "
"be sliced when storing in exception_wrapper."); "be sliced when storing in exception_wrapper.");
return std::forward<Ex>(ex); return std::forward<Ex>(ex);
...@@ -479,12 +479,12 @@ template <class Ex> ...@@ -479,12 +479,12 @@ template <class Ex>
template <class CatchFn, bool IsConst> template <class CatchFn, bool IsConst>
struct exception_wrapper::ExceptionTypeOf { struct exception_wrapper::ExceptionTypeOf {
using type = arg_type<_t<std::decay<CatchFn>>>; using type = arg_type<std::decay_t<CatchFn>>;
static_assert( static_assert(
std::is_reference<type>::value, std::is_reference<type>::value,
"Always catch exceptions by reference."); "Always catch exceptions by reference.");
static_assert( static_assert(
!IsConst || std::is_const<_t<std::remove_reference<type>>>::value, !IsConst || std::is_const<std::remove_reference_t<type>>::value,
"handle() or with_exception() called on a const exception_wrapper " "handle() or with_exception() called on a const exception_wrapper "
"and asked to catch a non-const exception. Handler will never fire. " "and asked to catch a non-const exception. Handler will never fire. "
"Catch exception by const reference to fix this."); "Catch exception by const reference to fix this.");
...@@ -550,7 +550,7 @@ struct exception_wrapper::HandleStdExceptReduce { ...@@ -550,7 +550,7 @@ struct exception_wrapper::HandleStdExceptReduce {
return return
[th = std::forward<ThrowFn>(th), &ca](auto&& continuation) -> StdEx* { [th = std::forward<ThrowFn>(th), &ca](auto&& continuation) -> StdEx* {
if (auto e = const_cast<StdEx*>(th(continuation))) { if (auto e = const_cast<StdEx*>(th(continuation))) {
if (auto e2 = dynamic_cast<_t<std::add_pointer<Ex>>>(e)) { if (auto e2 = dynamic_cast<std::add_pointer_t<Ex>>(e)) {
ca(*e2); ca(*e2);
} else { } else {
return e; return e;
......
...@@ -62,7 +62,7 @@ template <template <class> class T, class... As> ...@@ -62,7 +62,7 @@ template <template <class> class T, class... As>
using AllOf = StrictConjunction<T<As>...>; using AllOf = StrictConjunction<T<As>...>;
template <bool If, class T> template <bool If, class T>
using AddConstIf = _t<std::conditional<If, const T, T>>; using AddConstIf = std::conditional_t<If, const T, T>;
template <class Fn, class A> template <class Fn, class A>
FOLLY_ALWAYS_INLINE FOLLY_ATTR_VISIBILITY_HIDDEN auto fold(Fn&&, A&& a) { FOLLY_ALWAYS_INLINE FOLLY_ATTR_VISIBILITY_HIDDEN auto fold(Fn&&, A&& a) {
...@@ -206,12 +206,12 @@ class exception_wrapper final { ...@@ -206,12 +206,12 @@ class exception_wrapper final {
static VTable const uninit_; static VTable const uninit_;
template <class Ex> template <class Ex>
using IsStdException = std::is_base_of<std::exception, _t<std::decay<Ex>>>; using IsStdException = std::is_base_of<std::exception, std::decay_t<Ex>>;
template <bool B, class T> template <bool B, class T>
using AddConstIf = exception_wrapper_detail::AddConstIf<B, T>; using AddConstIf = exception_wrapper_detail::AddConstIf<B, T>;
template <class CatchFn> template <class CatchFn>
using IsCatchAll = using IsCatchAll =
std::is_same<arg_type<_t<std::decay<CatchFn>>>, AnyException>; std::is_same<arg_type<std::decay_t<CatchFn>>, AnyException>;
struct Unknown {}; struct Unknown {};
...@@ -221,7 +221,7 @@ class exception_wrapper final { ...@@ -221,7 +221,7 @@ class exception_wrapper final {
// and runtime_error can be safely stored internally. // and runtime_error can be safely stored internally.
struct Buffer { struct Buffer {
using Storage = using Storage =
_t<std::aligned_storage<2 * sizeof(void*), alignof(std::exception)>>; std::aligned_storage_t<2 * sizeof(void*), alignof(std::exception)>;
Storage buff_; Storage buff_;
Buffer() : buff_{} {} Buffer() : buff_{} {}
...@@ -239,16 +239,16 @@ class exception_wrapper final { ...@@ -239,16 +239,16 @@ class exception_wrapper final {
struct OnHeapTag {}; struct OnHeapTag {};
template <class T> template <class T>
using PlacementOf = _t<std::conditional< using PlacementOf = std::conditional_t<
!IsStdException<T>::value, !IsStdException<T>::value,
ThrownTag, ThrownTag,
_t<std::conditional< std::conditional_t<
sizeof(T) <= sizeof(Buffer::Storage) && sizeof(T) <= sizeof(Buffer::Storage) &&
alignof(T) <= alignof(Buffer::Storage) && alignof(T) <= alignof(Buffer::Storage) &&
noexcept(T(std::declval<T&&>())) && noexcept(T(std::declval<T&&>())) &&
noexcept(T(std::declval<T const&>())), noexcept(T(std::declval<T const&>())),
InSituTag, InSituTag,
OnHeapTag>>>>; OnHeapTag>>;
static std::exception const* as_exception_or_null_(std::exception const& ex); static std::exception const* as_exception_or_null_(std::exception const& ex);
static std::exception const* as_exception_or_null_(AnyException); static std::exception const* as_exception_or_null_(AnyException);
...@@ -429,7 +429,7 @@ class exception_wrapper final { ...@@ -429,7 +429,7 @@ class exception_wrapper final {
//! converted to an `exception_wrapper`. //! converted to an `exception_wrapper`.
template < template <
class Ex, class Ex,
class Ex_ = _t<std::decay<Ex>>, class Ex_ = std::decay_t<Ex>,
FOLLY_REQUIRES( FOLLY_REQUIRES(
Conjunction<IsStdException<Ex_>, IsRegularExceptionType<Ex_>>::value)> Conjunction<IsStdException<Ex_>, IsRegularExceptionType<Ex_>>::value)>
/* implicit */ exception_wrapper(Ex&& ex); /* implicit */ exception_wrapper(Ex&& ex);
...@@ -443,7 +443,7 @@ class exception_wrapper final { ...@@ -443,7 +443,7 @@ class exception_wrapper final {
//! `folly::in_place` as the first parameter. //! `folly::in_place` as the first parameter.
template < template <
class Ex, class Ex,
class Ex_ = _t<std::decay<Ex>>, class Ex_ = std::decay_t<Ex>,
FOLLY_REQUIRES(IsRegularExceptionType<Ex_>::value)> FOLLY_REQUIRES(IsRegularExceptionType<Ex_>::value)>
exception_wrapper(in_place_t, Ex&& ex); exception_wrapper(in_place_t, Ex&& ex);
......
...@@ -353,7 +353,7 @@ struct FunctionTraits<ReturnType(Args...)> { ...@@ -353,7 +353,7 @@ struct FunctionTraits<ReturnType(Args...)> {
template <typename F> template <typename F>
using ResultOf = using ResultOf =
SafeResultOf<CallableResult<_t<std::decay<F>>&, Args...>, ReturnType>; SafeResultOf<CallableResult<std::decay_t<F>&, Args...>, ReturnType>;
template <typename Fun> template <typename Fun>
static ReturnType callSmall(Data& p, Args&&... args) { static ReturnType callSmall(Data& p, Args&&... args) {
...@@ -389,9 +389,8 @@ struct FunctionTraits<ReturnType(Args...) const> { ...@@ -389,9 +389,8 @@ struct FunctionTraits<ReturnType(Args...) const> {
using OtherSignature = NonConstSignature; using OtherSignature = NonConstSignature;
template <typename F> template <typename F>
using ResultOf = SafeResultOf< using ResultOf =
CallableResult<const _t<std::decay<F>>&, Args...>, SafeResultOf<CallableResult<const std::decay_t<F>&, Args...>, ReturnType>;
ReturnType>;
template <typename Fun> template <typename Fun>
static ReturnType callSmall(Data& p, Args&&... args) { static ReturnType callSmall(Data& p, Args&&... args) {
...@@ -429,7 +428,7 @@ struct FunctionTraits<ReturnType(Args...) noexcept> { ...@@ -429,7 +428,7 @@ struct FunctionTraits<ReturnType(Args...) noexcept> {
template <typename F> template <typename F>
using ResultOf = using ResultOf =
SafeResultOf<CallableResult<_t<std::decay<F>>&, Args...>, ReturnType>; SafeResultOf<CallableResult<std::decay_t<F>&, Args...>, ReturnType>;
template <typename Fun> template <typename Fun>
static ReturnType callSmall(Data& p, Args&&... args) noexcept { static ReturnType callSmall(Data& p, Args&&... args) noexcept {
...@@ -465,9 +464,8 @@ struct FunctionTraits<ReturnType(Args...) const noexcept> { ...@@ -465,9 +464,8 @@ struct FunctionTraits<ReturnType(Args...) const noexcept> {
using OtherSignature = NonConstSignature; using OtherSignature = NonConstSignature;
template <typename F> template <typename F>
using ResultOf = SafeResultOf< using ResultOf =
CallableResult<const _t<std::decay<F>>&, Args...>, SafeResultOf<CallableResult<const std::decay_t<F>&, Args...>, ReturnType>;
ReturnType>;
template <typename Fun> template <typename Fun>
static ReturnType callSmall(Data& p, Args&&... args) noexcept { static ReturnType callSmall(Data& p, Args&&... args) noexcept {
...@@ -920,7 +918,7 @@ class FunctionRef<ReturnType(Args...)> final { ...@@ -920,7 +918,7 @@ class FunctionRef<ReturnType(Args...)> final {
template <typename Fun> template <typename Fun>
static ReturnType call(void* object, Args&&... args) { static ReturnType call(void* object, Args&&... args) {
using Pointer = _t<std::add_pointer<Fun>>; using Pointer = std::add_pointer_t<Fun>;
return static_cast<ReturnType>(invoke( return static_cast<ReturnType>(invoke(
static_cast<Fun&&>(*static_cast<Pointer>(object)), static_cast<Fun&&>(*static_cast<Pointer>(object)),
static_cast<Args&&>(args)...)); static_cast<Args&&>(args)...));
...@@ -951,7 +949,7 @@ class FunctionRef<ReturnType(Args...)> final { ...@@ -951,7 +949,7 @@ class FunctionRef<ReturnType(Args...)> final {
typename Fun, typename Fun,
typename std::enable_if< typename std::enable_if<
Conjunction< Conjunction<
Negation<std::is_same<FunctionRef, _t<std::decay<Fun>>>>, Negation<std::is_same<FunctionRef, std::decay_t<Fun>>>,
is_invocable_r<ReturnType, Fun&&, Args&&...>>::value, is_invocable_r<ReturnType, Fun&&, Args&&...>>::value,
int>::type = 0> int>::type = 0>
constexpr /* implicit */ FunctionRef(Fun&& fun) noexcept constexpr /* implicit */ FunctionRef(Fun&& fun) noexcept
......
...@@ -355,7 +355,7 @@ class Optional { ...@@ -355,7 +355,7 @@ class Optional {
private: private:
template <class T> template <class T>
friend constexpr Optional<_t<std::decay<T>>> make_optional(T&&); friend constexpr Optional<std::decay_t<T>> make_optional(T&&);
template <class T, class... Args> template <class T, class... Args>
friend constexpr Optional<T> make_optional(Args&&... args); friend constexpr Optional<T> make_optional(Args&&... args);
template <class T, class U, class... As> template <class T, class U, class... As>
...@@ -456,9 +456,9 @@ void swap(Optional<T>& a, Optional<T>& b) noexcept(noexcept(a.swap(b))) { ...@@ -456,9 +456,9 @@ void swap(Optional<T>& a, Optional<T>& b) noexcept(noexcept(a.swap(b))) {
} }
template <class T> template <class T>
constexpr Optional<_t<std::decay<T>>> make_optional(T&& v) { constexpr Optional<std::decay_t<T>> make_optional(T&& v) {
using PrivateConstructor = using PrivateConstructor =
typename folly::Optional<_t<std::decay<T>>>::PrivateConstructor; typename folly::Optional<std::decay_t<T>>::PrivateConstructor;
return {PrivateConstructor{}, std::forward<T>(v)}; return {PrivateConstructor{}, std::forward<T>(v)};
} }
......
...@@ -52,7 +52,7 @@ inline PolyVal<I>::PolyVal(T&& t) { ...@@ -52,7 +52,7 @@ inline PolyVal<I>::PolyVal(T&& t) {
"This Poly<> requires copyability, and the source object is not " "This Poly<> requires copyability, and the source object is not "
"copyable"); "copyable");
// The static and dynamic types should match; otherwise, this will slice. // The static and dynamic types should match; otherwise, this will slice.
assert(typeid(t) == typeid(_t<std::decay<T>>) || assert(typeid(t) == typeid(std::decay_t<T>) ||
!"Dynamic and static exception types don't match. Object would " !"Dynamic and static exception types don't match. Object would "
"be sliced when storing in Poly."); "be sliced when storing in Poly.");
if (inSitu<U>()) { if (inSitu<U>()) {
......
...@@ -1265,8 +1265,9 @@ struct ComparableAsStringPiece { ...@@ -1265,8 +1265,9 @@ struct ComparableAsStringPiece {
* operator== through conversion for Range<const char*> * operator== through conversion for Range<const char*>
*/ */
template <class T, class U> template <class T, class U>
_t<std::enable_if<detail::ComparableAsStringPiece<T, U>::value, bool>> std::enable_if_t<detail::ComparableAsStringPiece<T, U>::value, bool> operator==(
operator==(const T& lhs, const U& rhs) { const T& lhs,
const U& rhs) {
return StringPiece(lhs) == StringPiece(rhs); return StringPiece(lhs) == StringPiece(rhs);
} }
...@@ -1274,8 +1275,9 @@ operator==(const T& lhs, const U& rhs) { ...@@ -1274,8 +1275,9 @@ operator==(const T& lhs, const U& rhs) {
* operator!= through conversion for Range<const char*> * operator!= through conversion for Range<const char*>
*/ */
template <class T, class U> template <class T, class U>
_t<std::enable_if<detail::ComparableAsStringPiece<T, U>::value, bool>> std::enable_if_t<detail::ComparableAsStringPiece<T, U>::value, bool> operator!=(
operator!=(const T& lhs, const U& rhs) { const T& lhs,
const U& rhs) {
return StringPiece(lhs) != StringPiece(rhs); return StringPiece(lhs) != StringPiece(rhs);
} }
...@@ -1283,8 +1285,9 @@ operator!=(const T& lhs, const U& rhs) { ...@@ -1283,8 +1285,9 @@ operator!=(const T& lhs, const U& rhs) {
* operator< through conversion for Range<const char*> * operator< through conversion for Range<const char*>
*/ */
template <class T, class U> template <class T, class U>
_t<std::enable_if<detail::ComparableAsStringPiece<T, U>::value, bool>> std::enable_if_t<detail::ComparableAsStringPiece<T, U>::value, bool> operator<(
operator<(const T& lhs, const U& rhs) { const T& lhs,
const U& rhs) {
return StringPiece(lhs) < StringPiece(rhs); return StringPiece(lhs) < StringPiece(rhs);
} }
...@@ -1292,8 +1295,9 @@ operator<(const T& lhs, const U& rhs) { ...@@ -1292,8 +1295,9 @@ operator<(const T& lhs, const U& rhs) {
* operator> through conversion for Range<const char*> * operator> through conversion for Range<const char*>
*/ */
template <class T, class U> template <class T, class U>
_t<std::enable_if<detail::ComparableAsStringPiece<T, U>::value, bool>> std::enable_if_t<detail::ComparableAsStringPiece<T, U>::value, bool> operator>(
operator>(const T& lhs, const U& rhs) { const T& lhs,
const U& rhs) {
return StringPiece(lhs) > StringPiece(rhs); return StringPiece(lhs) > StringPiece(rhs);
} }
...@@ -1301,8 +1305,9 @@ operator>(const T& lhs, const U& rhs) { ...@@ -1301,8 +1305,9 @@ operator>(const T& lhs, const U& rhs) {
* operator< through conversion for Range<const char*> * operator< through conversion for Range<const char*>
*/ */
template <class T, class U> template <class T, class U>
_t<std::enable_if<detail::ComparableAsStringPiece<T, U>::value, bool>> std::enable_if_t<detail::ComparableAsStringPiece<T, U>::value, bool> operator<=(
operator<=(const T& lhs, const U& rhs) { const T& lhs,
const U& rhs) {
return StringPiece(lhs) <= StringPiece(rhs); return StringPiece(lhs) <= StringPiece(rhs);
} }
...@@ -1310,8 +1315,9 @@ operator<=(const T& lhs, const U& rhs) { ...@@ -1310,8 +1315,9 @@ operator<=(const T& lhs, const U& rhs) {
* operator> through conversion for Range<const char*> * operator> through conversion for Range<const char*>
*/ */
template <class T, class U> template <class T, class U>
_t<std::enable_if<detail::ComparableAsStringPiece<T, U>::value, bool>> std::enable_if_t<detail::ComparableAsStringPiece<T, U>::value, bool> operator>=(
operator>=(const T& lhs, const U& rhs) { const T& lhs,
const U& rhs) {
return StringPiece(lhs) >= StringPiece(rhs); return StringPiece(lhs) >= StringPiece(rhs);
} }
......
...@@ -93,10 +93,8 @@ template < ...@@ -93,10 +93,8 @@ template <
typename T, typename T,
typename Tag = detail::DefaultTag, typename Tag = detail::DefaultTag,
typename Make = detail::DefaultMake<T>, typename Make = detail::DefaultMake<T>,
typename TLTag = _t<std::conditional< typename TLTag = std::
std::is_same<Tag, detail::DefaultTag>::value, conditional_t<std::is_same<Tag, detail::DefaultTag>::value, void, Tag>>
void,
Tag>>>
class SingletonThreadLocal : private detail::SingletonThreadLocalBase { class SingletonThreadLocal : private detail::SingletonThreadLocalBase {
private: private:
struct Unique final : UniqueBase { struct Unique final : UniqueBase {
......
...@@ -201,7 +201,7 @@ class FlatCombining { ...@@ -201,7 +201,7 @@ class FlatCombining {
static_assert( static_assert(
std::is_nothrow_constructible< std::is_nothrow_constructible<
folly::Function<void()>, folly::Function<void()>,
_t<std::decay<Func>>>::value, std::decay_t<Func>>::value,
"Try using a smaller function object that can fit in folly::Function " "Try using a smaller function object that can fit in folly::Function "
"without allocation, or use the custom interface of requestFC() to " "without allocation, or use the custom interface of requestFC() to "
"manage the requested function's arguments and results explicitly " "manage the requested function's arguments and results explicitly "
......
...@@ -59,7 +59,7 @@ namespace detail { ...@@ -59,7 +59,7 @@ namespace detail {
// may be fulfilled. Assumes the stored functor to be noexcept-destructible. // may be fulfilled. Assumes the stored functor to be noexcept-destructible.
template <typename T, typename F> template <typename T, typename F>
class CoreCallbackState { class CoreCallbackState {
using DF = _t<std::decay<F>>; using DF = std::decay_t<F>;
public: public:
CoreCallbackState(Promise<T>&& promise, F&& func) noexcept( CoreCallbackState(Promise<T>&& promise, F&& func) noexcept(
......
...@@ -44,7 +44,7 @@ struct is_propagate_const : std::false_type {}; ...@@ -44,7 +44,7 @@ struct is_propagate_const : std::false_type {};
template <typename Pointer> template <typename Pointer>
struct is_propagate_const<propagate_const<Pointer>> : std::true_type {}; struct is_propagate_const<propagate_const<Pointer>> : std::true_type {};
template <typename T> template <typename T>
using is_decay_propagate_const = is_propagate_const<_t<std::decay<T>>>; using is_decay_propagate_const = is_propagate_const<std::decay_t<T>>;
namespace propagate_const_adl { namespace propagate_const_adl {
using std::swap; using std::swap;
...@@ -61,7 +61,7 @@ template <typename Pointer> ...@@ -61,7 +61,7 @@ template <typename Pointer>
class propagate_const { class propagate_const {
public: public:
using element_type = using element_type =
_t<std::remove_reference<decltype(*std::declval<Pointer&>())>>; std::remove_reference_t<decltype(*std::declval<Pointer&>())>;
constexpr propagate_const() = default; constexpr propagate_const() = default;
FOLLY_CPP14_CONSTEXPR propagate_const(propagate_const&&) = default; FOLLY_CPP14_CONSTEXPR propagate_const(propagate_const&&) = default;
...@@ -110,8 +110,8 @@ class propagate_const { ...@@ -110,8 +110,8 @@ class propagate_const {
template < template <
typename OtherPointer, typename OtherPointer,
typename = _t< typename =
std::enable_if<std::is_convertible<OtherPointer&&, Pointer>::value>>> std::enable_if_t<std::is_convertible<OtherPointer&&, Pointer>::value>>
FOLLY_CPP14_CONSTEXPR propagate_const& operator=( FOLLY_CPP14_CONSTEXPR propagate_const& operator=(
propagate_const<OtherPointer>&& other) { propagate_const<OtherPointer>&& other) {
pointer_ = static_cast<OtherPointer&&>(other.pointer_); pointer_ = static_cast<OtherPointer&&>(other.pointer_);
......
...@@ -31,7 +31,7 @@ template class folly::propagate_const<std::shared_ptr<int>>; ...@@ -31,7 +31,7 @@ template class folly::propagate_const<std::shared_ptr<int>>;
template <typename T> template <typename T>
static bool is_const(T&&) { static bool is_const(T&&) {
return std::is_const<_t<std::remove_reference<T>>>::value; return std::is_const<std::remove_reference_t<T>>::value;
} }
template <typename T> template <typename T>
......
...@@ -481,8 +481,8 @@ class Histogram { ...@@ -481,8 +481,8 @@ class Histogram {
private: private:
template <typename S, typename = std::enable_if_t<std::is_integral<S>::value>> template <typename S, typename = std::enable_if_t<std::is_integral<S>::value>>
static constexpr _t<std::make_unsigned<S>> to_unsigned(S s) { static constexpr std::make_unsigned_t<S> to_unsigned(S s) {
return static_cast<_t<std::make_unsigned<S>>>(s); return static_cast<std::make_unsigned_t<S>>(s);
} }
template < template <
typename S, typename S,
......
...@@ -1107,7 +1107,7 @@ void testRangeFunc(C&& x, size_t n) { ...@@ -1107,7 +1107,7 @@ void testRangeFunc(C&& x, size_t n) {
const auto& cx = x; const auto& cx = x;
// type, conversion checks // type, conversion checks
using R1Iter = using R1Iter =
_t<std::conditional<_t<std::is_reference<C>>::value, int*, int const*>>; std::conditional_t<_t<std::is_reference<C>>::value, int*, int const*>;
Range<R1Iter> r1 = range(std::forward<C>(x)); Range<R1Iter> r1 = range(std::forward<C>(x));
Range<const int*> r2 = range(std::forward<C>(x)); Range<const int*> r2 = range(std::forward<C>(x));
Range<const int*> r3 = range(cx); Range<const int*> r3 = range(cx);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment