misc: Replace enable_if<>::type with enable_if_t<>.
This new abreviated form was added for C++14. Now that we're using that version of the standard, we can move over to it. Change-Id: Ia291d2b1e73e503c37593b1e1c4c1b3011abc63b Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/36477 Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br> Maintainer: Gabe Black <gabe.black@gmail.com> Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
@@ -74,13 +74,13 @@ template <typename T, typename Enabled=void>
|
||||
struct IsAapcs32Composite : public std::false_type {};
|
||||
|
||||
template <typename T>
|
||||
struct IsAapcs32Composite<T, typename std::enable_if<
|
||||
struct IsAapcs32Composite<T, typename std::enable_if_t<
|
||||
(std::is_array<T>::value ||
|
||||
std::is_class<T>::value ||
|
||||
std::is_union<T>::value) &&
|
||||
// VarArgs is technically a composite type, but it's not a normal argument.
|
||||
!IsVarArgs<T>::value
|
||||
>::type> : public std::true_type
|
||||
>> : public std::true_type
|
||||
{};
|
||||
|
||||
// Homogeneous Aggregates
|
||||
@@ -130,9 +130,8 @@ struct Aapcs32ArgumentBase
|
||||
*/
|
||||
|
||||
template <typename Integer>
|
||||
struct Result<Aapcs32, Integer, typename std::enable_if<
|
||||
std::is_integral<Integer>::value && (sizeof(Integer) < sizeof(uint32_t))
|
||||
>::type>
|
||||
struct Result<Aapcs32, Integer, typename std::enable_if_t<
|
||||
std::is_integral<Integer>::value && (sizeof(Integer) < sizeof(uint32_t))>>
|
||||
{
|
||||
static void
|
||||
store(ThreadContext *tc, const Integer &i)
|
||||
@@ -144,9 +143,8 @@ struct Result<Aapcs32, Integer, typename std::enable_if<
|
||||
};
|
||||
|
||||
template <typename Integer>
|
||||
struct Result<Aapcs32, Integer, typename std::enable_if<
|
||||
std::is_integral<Integer>::value && (sizeof(Integer) == sizeof(uint32_t))
|
||||
>::type>
|
||||
struct Result<Aapcs32, Integer, typename std::enable_if_t<
|
||||
std::is_integral<Integer>::value && (sizeof(Integer) == sizeof(uint32_t))>>
|
||||
{
|
||||
static void
|
||||
store(ThreadContext *tc, const Integer &i)
|
||||
@@ -156,9 +154,8 @@ struct Result<Aapcs32, Integer, typename std::enable_if<
|
||||
};
|
||||
|
||||
template <typename Integer>
|
||||
struct Result<Aapcs32, Integer, typename std::enable_if<
|
||||
std::is_integral<Integer>::value && (sizeof(Integer) == sizeof(uint64_t))
|
||||
>::type>
|
||||
struct Result<Aapcs32, Integer, typename std::enable_if_t<
|
||||
std::is_integral<Integer>::value && (sizeof(Integer) == sizeof(uint64_t))>>
|
||||
{
|
||||
static void
|
||||
store(ThreadContext *tc, const Integer &i)
|
||||
@@ -176,9 +173,9 @@ struct Result<Aapcs32, Integer, typename std::enable_if<
|
||||
};
|
||||
|
||||
template <typename Integer>
|
||||
struct Argument<Aapcs32, Integer, typename std::enable_if<
|
||||
struct Argument<Aapcs32, Integer, typename std::enable_if_t<
|
||||
std::is_integral<Integer>::value && (sizeof(Integer) <= sizeof(uint32_t))
|
||||
>::type> : public Aapcs32ArgumentBase
|
||||
>> : public Aapcs32ArgumentBase
|
||||
{
|
||||
static Integer
|
||||
get(ThreadContext *tc, Aapcs32::State &state)
|
||||
@@ -195,9 +192,9 @@ struct Argument<Aapcs32, Integer, typename std::enable_if<
|
||||
};
|
||||
|
||||
template <typename Integer>
|
||||
struct Argument<Aapcs32, Integer, typename std::enable_if<
|
||||
struct Argument<Aapcs32, Integer, typename std::enable_if_t<
|
||||
std::is_integral<Integer>::value && (sizeof(Integer) > sizeof(uint32_t))
|
||||
>::type> : public Aapcs32ArgumentBase
|
||||
>> : public Aapcs32ArgumentBase
|
||||
{
|
||||
static Integer
|
||||
get(ThreadContext *tc, Aapcs32::State &state)
|
||||
@@ -236,8 +233,8 @@ struct Argument<Aapcs32, Integer, typename std::enable_if<
|
||||
*/
|
||||
|
||||
template <typename Float>
|
||||
struct Result<Aapcs32, Float, typename std::enable_if<
|
||||
std::is_floating_point<Float>::value>::type>
|
||||
struct Result<Aapcs32, Float, typename std::enable_if_t<
|
||||
std::is_floating_point<Float>::value>>
|
||||
{
|
||||
static void
|
||||
store(ThreadContext *tc, const Float &f, Aapcs32::State &state)
|
||||
@@ -248,8 +245,8 @@ struct Result<Aapcs32, Float, typename std::enable_if<
|
||||
};
|
||||
|
||||
template <typename Float>
|
||||
struct Argument<Aapcs32, Float, typename std::enable_if<
|
||||
std::is_floating_point<Float>::value>::type> : public Aapcs32ArgumentBase
|
||||
struct Argument<Aapcs32, Float, typename std::enable_if_t<
|
||||
std::is_floating_point<Float>::value>> : public Aapcs32ArgumentBase
|
||||
{
|
||||
static Float
|
||||
get(ThreadContext *tc, Aapcs32::State &state)
|
||||
@@ -270,8 +267,8 @@ struct Argument<Aapcs32, Float, typename std::enable_if<
|
||||
*/
|
||||
|
||||
template <typename Composite>
|
||||
struct Result<Aapcs32, Composite, typename std::enable_if<
|
||||
IsAapcs32Composite<Composite>::value>::type>
|
||||
struct Result<Aapcs32, Composite, typename std::enable_if_t<
|
||||
IsAapcs32Composite<Composite>::value>>
|
||||
{
|
||||
static void
|
||||
store(ThreadContext *tc, const Composite &composite,
|
||||
@@ -298,8 +295,8 @@ struct Result<Aapcs32, Composite, typename std::enable_if<
|
||||
};
|
||||
|
||||
template <typename Composite>
|
||||
struct Argument<Aapcs32, Composite, typename std::enable_if<
|
||||
IsAapcs32Composite<Composite>::value>::type> :
|
||||
struct Argument<Aapcs32, Composite, typename std::enable_if_t<
|
||||
IsAapcs32Composite<Composite>::value>> :
|
||||
public Aapcs32ArgumentBase
|
||||
{
|
||||
static Composite
|
||||
@@ -444,13 +441,13 @@ namespace GuestABI
|
||||
*/
|
||||
|
||||
template <typename Integer>
|
||||
struct Result<Aapcs32Vfp, Integer, typename std::enable_if<
|
||||
std::is_integral<Integer>::value>::type> : public Result<Aapcs32, Integer>
|
||||
struct Result<Aapcs32Vfp, Integer, typename std::enable_if_t<
|
||||
std::is_integral<Integer>::value>> : public Result<Aapcs32, Integer>
|
||||
{};
|
||||
|
||||
template <typename Integer>
|
||||
struct Argument<Aapcs32Vfp, Integer, typename std::enable_if<
|
||||
std::is_integral<Integer>::value>::type> :
|
||||
struct Argument<Aapcs32Vfp, Integer, typename std::enable_if_t<
|
||||
std::is_integral<Integer>::value>> :
|
||||
public Argument<Aapcs32, Integer>
|
||||
{};
|
||||
|
||||
@@ -460,8 +457,8 @@ struct Argument<Aapcs32Vfp, Integer, typename std::enable_if<
|
||||
*/
|
||||
|
||||
template <typename Float>
|
||||
struct Result<Aapcs32Vfp, Float, typename std::enable_if<
|
||||
std::is_floating_point<Float>::value>::type>
|
||||
struct Result<Aapcs32Vfp, Float, typename std::enable_if_t<
|
||||
std::is_floating_point<Float>::value>>
|
||||
{
|
||||
static void
|
||||
store(ThreadContext *tc, const Float &f, Aapcs32Vfp::State &state)
|
||||
@@ -479,8 +476,8 @@ struct Result<Aapcs32Vfp, Float, typename std::enable_if<
|
||||
};
|
||||
|
||||
template <typename Float>
|
||||
struct Argument<Aapcs32Vfp, Float, typename std::enable_if<
|
||||
std::is_floating_point<Float>::value>::type> : public Aapcs32ArgumentBase
|
||||
struct Argument<Aapcs32Vfp, Float, typename std::enable_if_t<
|
||||
std::is_floating_point<Float>::value>> : public Aapcs32ArgumentBase
|
||||
{
|
||||
static Float
|
||||
get(ThreadContext *tc, Aapcs32Vfp::State &state)
|
||||
@@ -510,16 +507,16 @@ struct Argument<Aapcs32Vfp, Float, typename std::enable_if<
|
||||
*/
|
||||
|
||||
template <typename Composite>
|
||||
struct Result<Aapcs32Vfp, Composite, typename std::enable_if<
|
||||
struct Result<Aapcs32Vfp, Composite, typename std::enable_if_t<
|
||||
IsAapcs32Composite<Composite>::value &&
|
||||
!IsAapcs32HomogeneousAggregate<Composite>::value>::type> :
|
||||
!IsAapcs32HomogeneousAggregate<Composite>::value>> :
|
||||
public Result<Aapcs32, Composite>
|
||||
{};
|
||||
|
||||
template <typename Composite>
|
||||
struct Argument<Aapcs32Vfp, Composite, typename std::enable_if<
|
||||
struct Argument<Aapcs32Vfp, Composite, typename std::enable_if_t<
|
||||
IsAapcs32Composite<Composite>::value &&
|
||||
!IsAapcs32HomogeneousAggregate<Composite>::value>::type> :
|
||||
!IsAapcs32HomogeneousAggregate<Composite>::value>> :
|
||||
public Argument<Aapcs32, Composite>
|
||||
{};
|
||||
|
||||
@@ -535,8 +532,8 @@ template <typename E, size_t N>
|
||||
struct Aapcs32ArrayType<E[N]> { using Type = E; };
|
||||
|
||||
template <typename HA>
|
||||
struct Argument<Aapcs32Vfp, HA, typename std::enable_if<
|
||||
IsAapcs32HomogeneousAggregate<HA>::value>::type> :
|
||||
struct Argument<Aapcs32Vfp, HA, typename std::enable_if_t<
|
||||
IsAapcs32HomogeneousAggregate<HA>::value>> :
|
||||
public Aapcs32ArgumentBase
|
||||
{
|
||||
static bool
|
||||
@@ -586,7 +583,7 @@ struct Argument<Aapcs32Vfp, HA, typename std::enable_if<
|
||||
|
||||
template <typename HA>
|
||||
struct Result<Aapcs32Vfp, HA,
|
||||
typename std::enable_if<IsAapcs32HomogeneousAggregate<HA>::value>::type>
|
||||
typename std::enable_if_t<IsAapcs32HomogeneousAggregate<HA>::value>>
|
||||
{
|
||||
static bool
|
||||
useBaseABI(Aapcs32Vfp::State &state)
|
||||
|
||||
@@ -77,9 +77,9 @@ struct IsAapcs64ShortVector : public std::false_type {};
|
||||
|
||||
template <typename E, size_t N>
|
||||
struct IsAapcs64ShortVector<E[N],
|
||||
typename std::enable_if<
|
||||
typename std::enable_if_t<
|
||||
(std::is_integral<E>::value || std::is_floating_point<E>::value) &&
|
||||
(sizeof(E) * N == 8 || sizeof(E) * N == 16)>::type> :
|
||||
(sizeof(E) * N == 8 || sizeof(E) * N == 16)>> :
|
||||
public std::true_type
|
||||
{};
|
||||
|
||||
@@ -91,7 +91,7 @@ template <typename T, typename Enabled=void>
|
||||
struct IsAapcs64Composite : public std::false_type {};
|
||||
|
||||
template <typename T>
|
||||
struct IsAapcs64Composite<T, typename std::enable_if<
|
||||
struct IsAapcs64Composite<T, typename std::enable_if_t<
|
||||
(std::is_array<T>::value ||
|
||||
std::is_class<T>::value ||
|
||||
std::is_union<T>::value) &&
|
||||
@@ -99,7 +99,7 @@ struct IsAapcs64Composite<T, typename std::enable_if<
|
||||
!IsVarArgs<T>::value &&
|
||||
// Short vectors are also composite types, but don't treat them as one.
|
||||
!IsAapcs64ShortVector<T>::value
|
||||
>::type> : public std::true_type
|
||||
>> : public std::true_type
|
||||
{};
|
||||
|
||||
// Homogeneous Aggregates
|
||||
@@ -116,8 +116,8 @@ struct IsAapcs64Hfa : public std::false_type {};
|
||||
|
||||
template <typename E, size_t N>
|
||||
struct IsAapcs64Hfa<E[N],
|
||||
typename std::enable_if<std::is_floating_point<E>::value &&
|
||||
N <= 4>::type> : public std::true_type
|
||||
typename std::enable_if_t<std::is_floating_point<E>::value && N <= 4>> :
|
||||
public std::true_type
|
||||
{};
|
||||
|
||||
// An Homogeneous Short-Vector Aggregate (HVA) is an Homogeneous Aggregate with
|
||||
@@ -129,8 +129,8 @@ struct IsAapcs64Hva : public std::false_type {};
|
||||
|
||||
template <typename E, size_t N>
|
||||
struct IsAapcs64Hva<E[N],
|
||||
typename std::enable_if<IsAapcs64ShortVector<E>::value &&
|
||||
N <= 4>::type> : public std::true_type
|
||||
typename std::enable_if_t<IsAapcs64ShortVector<E>::value && N <= 4>> :
|
||||
public std::true_type
|
||||
{};
|
||||
|
||||
// A shorthand to test if a type is an HVA or an HFA.
|
||||
@@ -138,8 +138,8 @@ template <typename T, typename Enabled=void>
|
||||
struct IsAapcs64Hxa : public std::false_type {};
|
||||
|
||||
template <typename T>
|
||||
struct IsAapcs64Hxa<T, typename std::enable_if<
|
||||
IsAapcs64Hfa<T>::value || IsAapcs64Hva<T>::value>::type> :
|
||||
struct IsAapcs64Hxa<T, typename std::enable_if_t<
|
||||
IsAapcs64Hfa<T>::value || IsAapcs64Hva<T>::value>> :
|
||||
public std::true_type
|
||||
{};
|
||||
|
||||
@@ -174,9 +174,9 @@ struct Aapcs64ArgumentBase
|
||||
*/
|
||||
|
||||
template <typename Float>
|
||||
struct Argument<Aapcs64, Float, typename std::enable_if<
|
||||
struct Argument<Aapcs64, Float, typename std::enable_if_t<
|
||||
std::is_floating_point<Float>::value ||
|
||||
IsAapcs64ShortVector<Float>::value>::type> :
|
||||
IsAapcs64ShortVector<Float>::value>> :
|
||||
public Aapcs64ArgumentBase
|
||||
{
|
||||
static Float
|
||||
@@ -192,9 +192,9 @@ struct Argument<Aapcs64, Float, typename std::enable_if<
|
||||
};
|
||||
|
||||
template <typename Float>
|
||||
struct Result<Aapcs64, Float, typename std::enable_if<
|
||||
struct Result<Aapcs64, Float, typename std::enable_if_t<
|
||||
std::is_floating_point<Float>::value ||
|
||||
IsAapcs64ShortVector<Float>::value>::type>
|
||||
IsAapcs64ShortVector<Float>::value>>
|
||||
{
|
||||
static void
|
||||
store(ThreadContext *tc, const Float &f)
|
||||
@@ -213,9 +213,9 @@ struct Result<Aapcs64, Float, typename std::enable_if<
|
||||
|
||||
// This will pick up Addr as well, which should be used for guest pointers.
|
||||
template <typename Integer>
|
||||
struct Argument<Aapcs64, Integer, typename std::enable_if<
|
||||
std::is_integral<Integer>::value && (sizeof(Integer) <= 8)
|
||||
>::type> : public Aapcs64ArgumentBase
|
||||
struct Argument<Aapcs64, Integer, typename std::enable_if_t<
|
||||
std::is_integral<Integer>::value && (sizeof(Integer) <= 8)>> :
|
||||
public Aapcs64ArgumentBase
|
||||
{
|
||||
static Integer
|
||||
get(ThreadContext *tc, Aapcs64::State &state)
|
||||
@@ -231,9 +231,9 @@ struct Argument<Aapcs64, Integer, typename std::enable_if<
|
||||
};
|
||||
|
||||
template <typename Integer>
|
||||
struct Argument<Aapcs64, Integer, typename std::enable_if<
|
||||
std::is_integral<Integer>::value && (sizeof(Integer) > 8)
|
||||
>::type> : public Aapcs64ArgumentBase
|
||||
struct Argument<Aapcs64, Integer, typename std::enable_if_t<
|
||||
std::is_integral<Integer>::value && (sizeof(Integer) > 8)>> :
|
||||
public Aapcs64ArgumentBase
|
||||
{
|
||||
static Integer
|
||||
get(ThreadContext *tc, Aapcs64::State &state)
|
||||
@@ -256,9 +256,8 @@ struct Argument<Aapcs64, Integer, typename std::enable_if<
|
||||
};
|
||||
|
||||
template <typename Integer>
|
||||
struct Result<Aapcs64, Integer, typename std::enable_if<
|
||||
std::is_integral<Integer>::value && (sizeof(Integer) <= 8)
|
||||
>::type>
|
||||
struct Result<Aapcs64, Integer, typename std::enable_if_t<
|
||||
std::is_integral<Integer>::value && (sizeof(Integer) <= 8)>>
|
||||
{
|
||||
static void
|
||||
store(ThreadContext *tc, const Integer &i)
|
||||
@@ -268,9 +267,8 @@ struct Result<Aapcs64, Integer, typename std::enable_if<
|
||||
};
|
||||
|
||||
template <typename Integer>
|
||||
struct Result<Aapcs64, Integer, typename std::enable_if<
|
||||
std::is_integral<Integer>::value && (sizeof(Integer) > 8)
|
||||
>::type>
|
||||
struct Result<Aapcs64, Integer, typename std::enable_if_t<
|
||||
std::is_integral<Integer>::value && (sizeof(Integer) > 8)>>
|
||||
{
|
||||
static void
|
||||
store(ThreadContext *tc, const Integer &i)
|
||||
@@ -293,8 +291,8 @@ template <typename E, size_t N>
|
||||
struct Aapcs64ArrayType<E[N]> { using Type = E; };
|
||||
|
||||
template <typename HA>
|
||||
struct Argument<Aapcs64, HA, typename std::enable_if<
|
||||
IsAapcs64Hxa<HA>::value>::type> : public Aapcs64ArgumentBase
|
||||
struct Argument<Aapcs64, HA, typename std::enable_if_t<
|
||||
IsAapcs64Hxa<HA>::value>> : public Aapcs64ArgumentBase
|
||||
{
|
||||
static HA
|
||||
get(ThreadContext *tc, Aapcs64::State &state)
|
||||
@@ -318,7 +316,7 @@ struct Argument<Aapcs64, HA, typename std::enable_if<
|
||||
|
||||
template <typename HA>
|
||||
struct Result<Aapcs64, HA,
|
||||
typename std::enable_if<IsAapcs64Hxa<HA>::value>::type>
|
||||
typename std::enable_if_t<IsAapcs64Hxa<HA>::value>>
|
||||
{
|
||||
static HA
|
||||
store(ThreadContext *tc, const HA &ha)
|
||||
@@ -337,9 +335,9 @@ struct Result<Aapcs64, HA,
|
||||
*/
|
||||
|
||||
template <typename Composite>
|
||||
struct Argument<Aapcs64, Composite, typename std::enable_if<
|
||||
IsAapcs64Composite<Composite>::value && !IsAapcs64Hxa<Composite>::value
|
||||
>::type> : public Aapcs64ArgumentBase
|
||||
struct Argument<Aapcs64, Composite, typename std::enable_if_t<
|
||||
IsAapcs64Composite<Composite>::value && !IsAapcs64Hxa<Composite>::value>> :
|
||||
public Aapcs64ArgumentBase
|
||||
{
|
||||
static Composite
|
||||
get(ThreadContext *tc, Aapcs64::State &state)
|
||||
@@ -382,9 +380,8 @@ struct Argument<Aapcs64, Composite, typename std::enable_if<
|
||||
};
|
||||
|
||||
template <typename Composite>
|
||||
struct Result<Aapcs64, Composite, typename std::enable_if<
|
||||
IsAapcs64Composite<Composite>::value && !IsAapcs64Hxa<Composite>::value
|
||||
>::type>
|
||||
struct Result<Aapcs64, Composite, typename std::enable_if_t<
|
||||
IsAapcs64Composite<Composite>::value && !IsAapcs64Hxa<Composite>::value>>
|
||||
{
|
||||
static void
|
||||
store(ThreadContext *tc, const Composite &c)
|
||||
|
||||
@@ -48,8 +48,8 @@ namespace GuestABI
|
||||
|
||||
template <typename ABI>
|
||||
struct Result<ABI, SyscallReturn,
|
||||
typename std::enable_if<std::is_base_of<
|
||||
ArmFreebsdProcessBits::SyscallABI, ABI>::value>::type>
|
||||
typename std::enable_if_t<std::is_base_of<
|
||||
ArmFreebsdProcessBits::SyscallABI, ABI>::value>>
|
||||
{
|
||||
static void
|
||||
store(ThreadContext *tc, const SyscallReturn &ret)
|
||||
|
||||
@@ -56,8 +56,8 @@ namespace GuestABI
|
||||
|
||||
template <typename ABI>
|
||||
struct Result<ABI, SyscallReturn,
|
||||
typename std::enable_if<std::is_base_of<
|
||||
ArmLinuxProcessBits::SyscallABI, ABI>::value>::type>
|
||||
typename std::enable_if_t<std::is_base_of<
|
||||
ArmLinuxProcessBits::SyscallABI, ABI>::value>>
|
||||
{
|
||||
static void
|
||||
store(ThreadContext *tc, const SyscallReturn &ret)
|
||||
|
||||
@@ -94,9 +94,9 @@ namespace GuestABI
|
||||
|
||||
template <typename ABI, typename Arg>
|
||||
struct Argument<ABI, Arg,
|
||||
typename std::enable_if<
|
||||
typename std::enable_if_t<
|
||||
std::is_base_of<ArmProcess32::SyscallABI, ABI>::value &&
|
||||
ABI::template IsWide<Arg>::value>::type>
|
||||
ABI::template IsWide<Arg>::value>>
|
||||
{
|
||||
static Arg
|
||||
get(ThreadContext *tc, typename ABI::State &state)
|
||||
|
||||
@@ -595,7 +595,7 @@ namespace GuestABI
|
||||
|
||||
template <typename Arg>
|
||||
struct Argument<ArmSemihosting::Abi64, Arg,
|
||||
typename std::enable_if<std::is_integral<Arg>::value>::type>
|
||||
typename std::enable_if_t<std::is_integral<Arg>::value>>
|
||||
{
|
||||
static Arg
|
||||
get(ThreadContext *tc, ArmSemihosting::Abi64::State &state)
|
||||
@@ -606,7 +606,7 @@ struct Argument<ArmSemihosting::Abi64, Arg,
|
||||
|
||||
template <typename Arg>
|
||||
struct Argument<ArmSemihosting::Abi32, Arg,
|
||||
typename std::enable_if<std::is_integral<Arg>::value>::type>
|
||||
typename std::enable_if_t<std::is_integral<Arg>::value>>
|
||||
{
|
||||
static Arg
|
||||
get(ThreadContext *tc, ArmSemihosting::Abi32::State &state)
|
||||
@@ -619,8 +619,8 @@ struct Argument<ArmSemihosting::Abi32, Arg,
|
||||
};
|
||||
|
||||
template <typename Abi>
|
||||
struct Argument<Abi, ArmSemihosting::InPlaceArg, typename std::enable_if<
|
||||
std::is_base_of<ArmSemihosting::AbiBase, Abi>::value>::type>
|
||||
struct Argument<Abi, ArmSemihosting::InPlaceArg, typename std::enable_if_t<
|
||||
std::is_base_of<ArmSemihosting::AbiBase, Abi>::value>>
|
||||
{
|
||||
static ArmSemihosting::InPlaceArg
|
||||
get(ThreadContext *tc, typename Abi::State &state)
|
||||
|
||||
@@ -264,7 +264,7 @@ namespace Gcn3ISA
|
||||
* primitive types (i.e., 8b to 64b primitives).
|
||||
*/
|
||||
template<bool Condition = (NumDwords == 1 || NumDwords == 2) && Const>
|
||||
typename std::enable_if<Condition, const DataType>::type
|
||||
typename std::enable_if_t<Condition, const DataType>
|
||||
operator[](size_t idx) const
|
||||
{
|
||||
assert(idx < NumVecElemPerVecReg);
|
||||
@@ -307,7 +307,7 @@ namespace Gcn3ISA
|
||||
* primitive types (i.e., 8b to 64b primitives).
|
||||
*/
|
||||
template<bool Condition = (NumDwords == 1 || NumDwords == 2) && !Const>
|
||||
typename std::enable_if<Condition, DataType&>::type
|
||||
typename std::enable_if_t<Condition, DataType&>
|
||||
operator[](size_t idx)
|
||||
{
|
||||
assert(!scalar);
|
||||
@@ -392,7 +392,7 @@ namespace Gcn3ISA
|
||||
* that we need to perform computation on.
|
||||
*/
|
||||
template<bool Condition = NumDwords == 1 || NumDwords == 2>
|
||||
typename std::enable_if<Condition, DataType>::type
|
||||
typename std::enable_if_t<Condition, DataType>
|
||||
rawData() const
|
||||
{
|
||||
assert(sizeof(DataType) <= sizeof(srfData));
|
||||
@@ -491,7 +491,7 @@ namespace Gcn3ISA
|
||||
* bit access to scalar data. primarily used for setting vcc bits.
|
||||
*/
|
||||
template<bool Condition = NumDwords == 1 || NumDwords == 2>
|
||||
typename std::enable_if<Condition, void>::type
|
||||
typename std::enable_if_t<Condition, void>
|
||||
setBit(int bit, int bit_val)
|
||||
{
|
||||
DataType &sgpr = *((DataType*)srfData.data());
|
||||
@@ -499,7 +499,7 @@ namespace Gcn3ISA
|
||||
}
|
||||
|
||||
template<bool Condition = (NumDwords == 1 || NumDwords == 2) && !Const>
|
||||
typename std::enable_if<Condition, ScalarOperand&>::type
|
||||
typename std::enable_if_t<Condition, ScalarOperand&>
|
||||
operator=(DataType rhs)
|
||||
{
|
||||
std::memcpy((void*)srfData.data(), (void*)&rhs, sizeof(DataType));
|
||||
|
||||
@@ -88,16 +88,16 @@ class VecPredRegT
|
||||
|
||||
/// Reset the register to an all-false value.
|
||||
template<bool Condition = !Const>
|
||||
typename std::enable_if<Condition, void>::type
|
||||
typename std::enable_if_t<Condition, void>
|
||||
reset() { container.reset(); }
|
||||
|
||||
/// Reset the register to an all-true value.
|
||||
template<bool Condition = !Const>
|
||||
typename std::enable_if<Condition, void>::type
|
||||
typename std::enable_if_t<Condition, void>
|
||||
set() { container.set(); }
|
||||
|
||||
template<bool Condition = !Const>
|
||||
typename std::enable_if<Condition, MyClass&>::type
|
||||
typename std::enable_if_t<Condition, MyClass&>
|
||||
operator=(const MyClass& that)
|
||||
{
|
||||
container = that.container;
|
||||
@@ -111,7 +111,7 @@ class VecPredRegT
|
||||
}
|
||||
|
||||
template<bool Condition = !Const>
|
||||
typename std::enable_if<Condition, bool&>::type
|
||||
typename std::enable_if_t<Condition, bool&>
|
||||
operator[](size_t idx)
|
||||
{
|
||||
return container[idx * (Packed ? 1 : sizeof(VecElem))];
|
||||
@@ -128,7 +128,7 @@ class VecPredRegT
|
||||
|
||||
/// Write a raw value in an element of the predicate register
|
||||
template<bool Condition = !Const>
|
||||
typename std::enable_if<Condition, void>::type
|
||||
typename std::enable_if_t<Condition, void>
|
||||
set_raw(size_t idx, uint8_t val)
|
||||
{
|
||||
container.set_bits(idx * (Packed ? 1 : sizeof(VecElem)),
|
||||
|
||||
@@ -192,11 +192,11 @@ class VecRegT
|
||||
|
||||
/** Zero the container. */
|
||||
template<bool Condition = !Const>
|
||||
typename std::enable_if<Condition, void>::type
|
||||
typename std::enable_if_t<Condition, void>
|
||||
zero() { container.zero(); }
|
||||
|
||||
template<bool Condition = !Const>
|
||||
typename std::enable_if<Condition, MyClass&>::type
|
||||
typename std::enable_if_t<Condition, MyClass&>
|
||||
operator=(const MyClass& that)
|
||||
{
|
||||
container = that.container;
|
||||
@@ -211,7 +211,7 @@ class VecRegT
|
||||
|
||||
/** Index operator. */
|
||||
template<bool Condition = !Const>
|
||||
typename std::enable_if<Condition, VecElem&>::type
|
||||
typename std::enable_if_t<Condition, VecElem&>
|
||||
operator[](size_t idx)
|
||||
{
|
||||
return container.template raw_ptr<VecElem>()[idx];
|
||||
@@ -475,18 +475,18 @@ class LaneData
|
||||
|
||||
public:
|
||||
template <typename T> explicit
|
||||
LaneData(typename std::enable_if<sizeof(T) == ByteSz, const T&>::type t)
|
||||
LaneData(typename std::enable_if_t<sizeof(T) == ByteSz, const T&> t)
|
||||
: _val(t) {}
|
||||
|
||||
template <typename T>
|
||||
typename std::enable_if<sizeof(T) == ByteSz, MyClass&>::type
|
||||
typename std::enable_if_t<sizeof(T) == ByteSz, MyClass&>
|
||||
operator=(const T& that)
|
||||
{
|
||||
_val = that;
|
||||
return *this;
|
||||
}
|
||||
template<typename T,
|
||||
typename std::enable_if<sizeof(T) == ByteSz, int>::type I = 0>
|
||||
typename std::enable_if_t<sizeof(T) == ByteSz, int> I = 0>
|
||||
operator T() const {
|
||||
return *static_cast<const T*>(&_val);
|
||||
}
|
||||
@@ -552,7 +552,7 @@ class VecLaneT
|
||||
*/
|
||||
/** @{ */
|
||||
template <bool Assignable = !Const>
|
||||
typename std::enable_if<Assignable, MyClass&>::type
|
||||
typename std::enable_if_t<Assignable, MyClass&>
|
||||
operator=(const VecElem& that) {
|
||||
container = that;
|
||||
return *this;
|
||||
@@ -563,7 +563,7 @@ class VecLaneT
|
||||
* not allowed, pre-treatment of the rhs is required to conform.
|
||||
*/
|
||||
template <bool Assignable = !Const, typename T>
|
||||
typename std::enable_if<Assignable, MyClass&>::type
|
||||
typename std::enable_if_t<Assignable, MyClass&>
|
||||
operator=(const T& that) {
|
||||
static_assert(sizeof(T) >= sizeof(VecElem),
|
||||
"Attempt to perform widening bitwise copy.");
|
||||
@@ -577,8 +577,8 @@ class VecLaneT
|
||||
operator VecElem() const { return container; }
|
||||
|
||||
/** Constification. */
|
||||
template <bool Cond = !Const, typename std::enable_if<Cond, int>::type = 0>
|
||||
operator VecLaneT<typename std::enable_if<Cond, VecElem>::type, true>()
|
||||
template <bool Cond = !Const, typename std::enable_if_t<Cond, int> = 0>
|
||||
operator VecLaneT<typename std::enable_if_t<Cond, VecElem>, true>()
|
||||
{
|
||||
return VecLaneT<VecElem, true>(container);
|
||||
}
|
||||
|
||||
@@ -79,8 +79,8 @@ namespace GuestABI
|
||||
|
||||
template <typename ABI>
|
||||
struct Result<ABI, SyscallReturn,
|
||||
typename std::enable_if<std::is_base_of<
|
||||
SparcProcess::SyscallABI, ABI>::value>::type>
|
||||
typename std::enable_if_t<std::is_base_of<
|
||||
SparcProcess::SyscallABI, ABI>::value>>
|
||||
{
|
||||
static void
|
||||
store(ThreadContext *tc, const SyscallReturn &ret)
|
||||
@@ -160,8 +160,7 @@ namespace GuestABI
|
||||
|
||||
template <typename Arg>
|
||||
struct Argument<Sparc32Process::SyscallABI, Arg,
|
||||
typename std::enable_if<
|
||||
Sparc32Process::SyscallABI::IsWide<Arg>::value>::type>
|
||||
typename std::enable_if_t<Sparc32Process::SyscallABI::IsWide<Arg>::value>>
|
||||
{
|
||||
using ABI = Sparc32Process::SyscallABI;
|
||||
|
||||
|
||||
@@ -73,8 +73,8 @@ namespace GuestABI
|
||||
|
||||
template <typename ABI>
|
||||
struct Result<ABI, SyscallReturn,
|
||||
typename std::enable_if<std::is_base_of<
|
||||
X86Linux::SyscallABI, ABI>::value>::type>
|
||||
typename std::enable_if_t<std::is_base_of<
|
||||
X86Linux::SyscallABI, ABI>::value>>
|
||||
{
|
||||
static void
|
||||
store(ThreadContext *tc, const SyscallReturn &ret)
|
||||
|
||||
@@ -73,8 +73,8 @@ namespace GuestABI
|
||||
|
||||
template <typename Arg>
|
||||
struct Argument<X86ISA::EmuLinux::SyscallABI32, Arg,
|
||||
typename std::enable_if<
|
||||
X86ISA::EmuLinux::SyscallABI32::IsWide<Arg>::value>::type>
|
||||
typename std::enable_if_t<
|
||||
X86ISA::EmuLinux::SyscallABI32::IsWide<Arg>::value>>
|
||||
{
|
||||
using ABI = X86ISA::EmuLinux::SyscallABI32;
|
||||
|
||||
|
||||
@@ -469,7 +469,7 @@ class CircularQueue : private std::vector<T>
|
||||
* @ingroup api_base_utils
|
||||
*/
|
||||
template<typename Idx>
|
||||
typename std::enable_if<std::is_integral<Idx>::value,reference>::type
|
||||
typename std::enable_if_t<std::is_integral<Idx>::value, reference>
|
||||
operator[](const Idx& index) { return *(*this + index); }
|
||||
|
||||
/**
|
||||
|
||||
@@ -98,8 +98,8 @@ class Coroutine : public Fiber
|
||||
*/
|
||||
template <typename T = Ret>
|
||||
CallerType&
|
||||
operator()(typename std::enable_if<
|
||||
!std::is_same<T, void>::value, T>::type param)
|
||||
operator()(typename std::enable_if_t<
|
||||
!std::is_same<T, void>::value, T> param)
|
||||
{
|
||||
retChannel.push(param);
|
||||
callerFiber->run();
|
||||
@@ -115,8 +115,8 @@ class Coroutine : public Fiber
|
||||
* @ingroup api_coroutine
|
||||
*/
|
||||
template <typename T = Ret>
|
||||
typename std::enable_if<std::is_same<T, void>::value,
|
||||
CallerType>::type&
|
||||
typename std::enable_if_t<std::is_same<T, void>::value,
|
||||
CallerType> &
|
||||
operator()()
|
||||
{
|
||||
callerFiber->run();
|
||||
@@ -136,7 +136,7 @@ class Coroutine : public Fiber
|
||||
* @ingroup api_coroutine
|
||||
*/
|
||||
template <typename T = Arg>
|
||||
typename std::enable_if<!std::is_same<T, void>::value, T>::type
|
||||
typename std::enable_if_t<!std::is_same<T, void>::value, T>
|
||||
get()
|
||||
{
|
||||
auto& args_channel = coro.argsChannel;
|
||||
@@ -208,8 +208,8 @@ class Coroutine : public Fiber
|
||||
*/
|
||||
template <typename T = Arg>
|
||||
Coroutine&
|
||||
operator()(typename std::enable_if<
|
||||
!std::is_same<T, void>::value, T>::type param)
|
||||
operator()(typename std::enable_if_t<
|
||||
!std::is_same<T, void>::value, T> param)
|
||||
{
|
||||
argsChannel.push(param);
|
||||
this->call();
|
||||
@@ -225,7 +225,7 @@ class Coroutine : public Fiber
|
||||
* @ingroup api_coroutine
|
||||
*/
|
||||
template <typename T = Arg>
|
||||
typename std::enable_if<std::is_same<T, void>::value, Coroutine>::type&
|
||||
typename std::enable_if_t<std::is_same<T, void>::value, Coroutine> &
|
||||
operator()()
|
||||
{
|
||||
this->call();
|
||||
@@ -245,7 +245,7 @@ class Coroutine : public Fiber
|
||||
* @ingroup api_coroutine
|
||||
*/
|
||||
template <typename T = Ret>
|
||||
typename std::enable_if<!std::is_same<T, void>::value, T>::type
|
||||
typename std::enable_if_t<!std::is_same<T, void>::value, T>
|
||||
get()
|
||||
{
|
||||
auto& ret_channel = caller.retChannel;
|
||||
|
||||
@@ -59,7 +59,7 @@ power(uint32_t n, uint32_t e)
|
||||
* @ingroup api_base_utils
|
||||
*/
|
||||
template <class T>
|
||||
inline typename std::enable_if<std::is_integral<T>::value, int>::type
|
||||
inline typename std::enable_if_t<std::is_integral<T>::value, int>
|
||||
floorLog2(T x)
|
||||
{
|
||||
assert(x > 0);
|
||||
|
||||
@@ -82,7 +82,7 @@ class Random : public Serializable
|
||||
* @ingroup api_base_utils
|
||||
*/
|
||||
template <typename T>
|
||||
typename std::enable_if<std::is_integral<T>::value, T>::type
|
||||
typename std::enable_if_t<std::is_integral<T>::value, T>
|
||||
random()
|
||||
{
|
||||
// [0, max_value] for integer types
|
||||
@@ -94,7 +94,7 @@ class Random : public Serializable
|
||||
* @ingroup api_base_utils
|
||||
*/
|
||||
template <typename T>
|
||||
typename std::enable_if<std::is_floating_point<T>::value, T>::type
|
||||
typename std::enable_if_t<std::is_floating_point<T>::value, T>
|
||||
random()
|
||||
{
|
||||
// [0, 1) for real types
|
||||
@@ -105,7 +105,7 @@ class Random : public Serializable
|
||||
* @ingroup api_base_utils
|
||||
*/
|
||||
template <typename T>
|
||||
typename std::enable_if<std::is_integral<T>::value, T>::type
|
||||
typename std::enable_if_t<std::is_integral<T>::value, T>
|
||||
random(T min, T max)
|
||||
{
|
||||
std::uniform_int_distribution<T> dist(min, max);
|
||||
|
||||
@@ -219,7 +219,7 @@ class RefCountingPtr
|
||||
T *get() const { return data; }
|
||||
|
||||
template <bool B = TisConst>
|
||||
operator RefCountingPtr<typename std::enable_if<!B, ConstT>::type>()
|
||||
operator RefCountingPtr<typename std::enable_if_t<!B, ConstT>>()
|
||||
{
|
||||
return RefCountingPtr<const T>(*this);
|
||||
}
|
||||
|
||||
@@ -812,8 +812,8 @@ class FunctorProxy : public ProxyInfo
|
||||
*/
|
||||
template <class T>
|
||||
class FunctorProxy<T,
|
||||
typename std::enable_if<std::is_constructible<std::function<Result()>,
|
||||
const T &>::value>::type> : public ProxyInfo
|
||||
typename std::enable_if_t<std::is_constructible<std::function<Result()>,
|
||||
const T &>::value>> : public ProxyInfo
|
||||
{
|
||||
private:
|
||||
std::function<Result()> functor;
|
||||
|
||||
@@ -108,8 +108,8 @@ tokenize(std::vector<std::string> &vector, const std::string &s,
|
||||
* integeral type, as well as enums and floating-point types.
|
||||
*/
|
||||
template <class T>
|
||||
typename std::enable_if<std::is_integral<T>::value &&
|
||||
std::is_signed<T>::value, T>::type
|
||||
typename std::enable_if_t<std::is_integral<T>::value &&
|
||||
std::is_signed<T>::value, T>
|
||||
__to_number(const std::string &value)
|
||||
{
|
||||
// start big and narrow it down if needed, determine the base dynamically
|
||||
@@ -122,8 +122,8 @@ __to_number(const std::string &value)
|
||||
}
|
||||
|
||||
template <class T>
|
||||
typename std::enable_if<std::is_integral<T>::value &&
|
||||
!std::is_signed<T>::value, T>::type
|
||||
typename std::enable_if_t<std::is_integral<T>::value &&
|
||||
!std::is_signed<T>::value, T>
|
||||
__to_number(const std::string &value)
|
||||
{
|
||||
// start big and narrow it down if needed, determine the base dynamically
|
||||
@@ -134,7 +134,7 @@ __to_number(const std::string &value)
|
||||
}
|
||||
|
||||
template <class T>
|
||||
typename std::enable_if<std::is_enum<T>::value, T>::type
|
||||
typename std::enable_if_t<std::is_enum<T>::value, T>
|
||||
__to_number(const std::string &value)
|
||||
{
|
||||
auto r = __to_number<typename std::underlying_type<T>::type>(value);
|
||||
@@ -142,7 +142,7 @@ __to_number(const std::string &value)
|
||||
}
|
||||
|
||||
template <class T>
|
||||
typename std::enable_if<std::is_floating_point<T>::value, T>::type
|
||||
typename std::enable_if_t<std::is_floating_point<T>::value, T>
|
||||
__to_number(const std::string &value)
|
||||
{
|
||||
// start big and narrow it down if needed
|
||||
|
||||
@@ -106,7 +106,7 @@ struct Argument<TestABI_1D, int>
|
||||
|
||||
template <typename Arg>
|
||||
struct Argument<TestABI_1D, Arg,
|
||||
typename std::enable_if<std::is_floating_point<Arg>::value>::type>
|
||||
typename std::enable_if_t<std::is_floating_point<Arg>::value>>
|
||||
{
|
||||
static Arg
|
||||
get(ThreadContext *tc, TestABI_1D::State &state)
|
||||
@@ -127,7 +127,7 @@ struct Result<TestABI_1D, int>
|
||||
|
||||
template <typename Ret>
|
||||
struct Result<TestABI_1D, Ret,
|
||||
typename std::enable_if<std::is_floating_point<Ret>::value>::type>
|
||||
typename std::enable_if_t<std::is_floating_point<Ret>::value>>
|
||||
{
|
||||
static void
|
||||
store(ThreadContext *tc, const Ret &ret)
|
||||
@@ -181,7 +181,7 @@ struct Argument<TestABI_2D, int>
|
||||
|
||||
template <typename Arg>
|
||||
struct Argument<TestABI_2D, Arg,
|
||||
typename std::enable_if<std::is_floating_point<Arg>::value>::type>
|
||||
typename std::enable_if_t<std::is_floating_point<Arg>::value>>
|
||||
{
|
||||
static Arg
|
||||
get(ThreadContext *tc, TestABI_2D::State &state)
|
||||
@@ -202,7 +202,7 @@ struct Result<TestABI_2D, int>
|
||||
|
||||
template <typename Ret>
|
||||
struct Result<TestABI_2D, Ret,
|
||||
typename std::enable_if<std::is_floating_point<Ret>::value>::type>
|
||||
typename std::enable_if_t<std::is_floating_point<Ret>::value>>
|
||||
{
|
||||
static void
|
||||
store(ThreadContext *tc, const Ret &ret)
|
||||
|
||||
@@ -53,8 +53,7 @@ namespace GuestABI
|
||||
// With no arguments to gather, call the target function and store the
|
||||
// result.
|
||||
template <typename ABI, bool store_ret, typename Ret>
|
||||
static typename std::enable_if<!std::is_void<Ret>::value && store_ret,
|
||||
Ret>::type
|
||||
static typename std::enable_if_t<!std::is_void<Ret>::value && store_ret, Ret>
|
||||
callFrom(ThreadContext *tc, typename ABI::State &state,
|
||||
std::function<Ret(ThreadContext *)> target)
|
||||
{
|
||||
@@ -64,8 +63,7 @@ callFrom(ThreadContext *tc, typename ABI::State &state,
|
||||
}
|
||||
|
||||
template <typename ABI, bool store_ret, typename Ret>
|
||||
static typename std::enable_if<!std::is_void<Ret>::value && !store_ret,
|
||||
Ret>::type
|
||||
static typename std::enable_if_t<!std::is_void<Ret>::value && !store_ret, Ret>
|
||||
callFrom(ThreadContext *tc, typename ABI::State &state,
|
||||
std::function<Ret(ThreadContext *)> target)
|
||||
{
|
||||
@@ -85,7 +83,7 @@ callFrom(ThreadContext *tc, typename ABI::State &state,
|
||||
// case above.
|
||||
template <typename ABI, bool store_ret, typename Ret,
|
||||
typename NextArg, typename ...Args>
|
||||
static typename std::enable_if<!std::is_void<Ret>::value, Ret>::type
|
||||
static typename std::enable_if_t<!std::is_void<Ret>::value, Ret>
|
||||
callFrom(ThreadContext *tc, typename ABI::State &state,
|
||||
std::function<Ret(ThreadContext *, NextArg, Args...)> target)
|
||||
{
|
||||
|
||||
@@ -52,9 +52,8 @@ struct StateInitializer
|
||||
};
|
||||
|
||||
template <typename ABI>
|
||||
struct StateInitializer<ABI, typename std::enable_if<
|
||||
std::is_constructible<typename ABI::State, const ThreadContext *>::value
|
||||
>::type>
|
||||
struct StateInitializer<ABI, typename std::enable_if_t<
|
||||
std::is_constructible<typename ABI::State, const ThreadContext *>::value>>
|
||||
{
|
||||
static typename ABI::State
|
||||
init(const ThreadContext *tc)
|
||||
@@ -152,9 +151,9 @@ template <typename Ret>
|
||||
std::false_type foo(void (*)(ThreadContext *, const Ret &ret));
|
||||
|
||||
template <typename ABI, typename Ret>
|
||||
struct ResultStorer<ABI, Ret, typename std::enable_if<
|
||||
struct ResultStorer<ABI, Ret, typename std::enable_if_t<
|
||||
std::is_same<void (*)(ThreadContext *, const Ret &, typename ABI::State &),
|
||||
decltype(&Result<ABI, Ret>::store)>::value>::type>
|
||||
decltype(&Result<ABI, Ret>::store)>::value>>
|
||||
{
|
||||
static void
|
||||
store(ThreadContext *tc, const Ret &ret, typename ABI::State &state)
|
||||
|
||||
@@ -134,16 +134,16 @@ class ConstProxyPtr
|
||||
using Type = T;
|
||||
|
||||
template <typename ...Args,
|
||||
typename std::enable_if<std::is_constructible<
|
||||
Proxy, Args&&...>::value, int>::type = 0>
|
||||
typename std::enable_if_t<std::is_constructible<
|
||||
Proxy, Args&&...>::value, int> = 0>
|
||||
explicit ConstProxyPtr(Addr _ptr, Args&&... args) :
|
||||
proxy(std::make_shared<Proxy>(args...))
|
||||
{
|
||||
setAddr(_ptr);
|
||||
}
|
||||
template <typename ...Args,
|
||||
typename std::enable_if<std::is_constructible<
|
||||
Proxy, Args&&...>::value, int>::type = 0>
|
||||
typename std::enable_if_t<std::is_constructible<
|
||||
Proxy, Args&&...>::value, int> = 0>
|
||||
explicit ConstProxyPtr(Args&&... args) :
|
||||
proxy(std::make_shared<Proxy>(args...))
|
||||
{
|
||||
@@ -151,7 +151,7 @@ class ConstProxyPtr
|
||||
}
|
||||
|
||||
template <typename O, typename Enabled=
|
||||
typename std::enable_if<std::is_assignable<T *, O *>::value>::type>
|
||||
typename std::enable_if_t<std::is_assignable<T *, O *>::value>>
|
||||
ConstProxyPtr(const ConstProxyPtr<O, Proxy> &other) :
|
||||
proxy(other.proxy), buffer(other.buffer)
|
||||
{}
|
||||
@@ -171,14 +171,14 @@ class ConstProxyPtr
|
||||
operator bool() const { return (bool)buffer; }
|
||||
|
||||
template <typename A>
|
||||
typename std::enable_if<std::is_integral<A>::value, CPP>::type
|
||||
typename std::enable_if_t<std::is_integral<A>::value, CPP>
|
||||
operator + (A a) const
|
||||
{
|
||||
return CPP(addr() + a * sizeof(T), proxy);
|
||||
}
|
||||
|
||||
template <typename A>
|
||||
typename std::enable_if<std::is_integral<A>::value, CPP>::type
|
||||
typename std::enable_if_t<std::is_integral<A>::value, CPP>
|
||||
operator - (A a) const
|
||||
{
|
||||
return CPP(addr() - a * sizeof(T), proxy);
|
||||
@@ -225,8 +225,7 @@ class ConstProxyPtr
|
||||
};
|
||||
|
||||
template <typename T, typename Proxy, typename A>
|
||||
typename std::enable_if<std::is_integral<A>::value,
|
||||
ConstProxyPtr<T, Proxy>>::type
|
||||
typename std::enable_if_t<std::is_integral<A>::value, ConstProxyPtr<T, Proxy>>
|
||||
operator + (A a, const ConstProxyPtr<T, Proxy> &other)
|
||||
{
|
||||
return other + a;
|
||||
@@ -243,16 +242,16 @@ class ProxyPtr : public ConstProxyPtr<T, Proxy>
|
||||
|
||||
public:
|
||||
template <typename ...Args,
|
||||
typename std::enable_if<std::is_constructible<
|
||||
Proxy, Args&&...>::value, int>::type = 0>
|
||||
typename std::enable_if_t<std::is_constructible<
|
||||
Proxy, Args&&...>::value, int> = 0>
|
||||
explicit ProxyPtr(Addr _ptr, Args&&... args) : CPP(_ptr, args...) {}
|
||||
template <typename ...Args,
|
||||
typename std::enable_if<std::is_constructible<
|
||||
Proxy, Args&&...>::value, int>::type = 0>
|
||||
typename std::enable_if_t<std::is_constructible<
|
||||
Proxy, Args&&...>::value, int> = 0>
|
||||
explicit ProxyPtr(Args&&... args) : CPP(0, args...) {}
|
||||
|
||||
template <typename O, typename Enabled=
|
||||
typename std::enable_if<std::is_assignable<T *, O *>::value>::type>
|
||||
typename std::enable_if_t<std::is_assignable<T *, O *>::value>>
|
||||
ProxyPtr(const ProxyPtr<O, Proxy> &other) : CPP(other) {}
|
||||
|
||||
ProxyPtr(const PP &other) : CPP(other) {}
|
||||
@@ -266,14 +265,14 @@ class ProxyPtr : public ConstProxyPtr<T, Proxy>
|
||||
}
|
||||
|
||||
template <typename A>
|
||||
typename std::enable_if<std::is_integral<A>::value, PP>::type
|
||||
typename std::enable_if_t<std::is_integral<A>::value, PP>
|
||||
operator + (A a) const
|
||||
{
|
||||
return PP(this->addr() + a * sizeof(T), this->proxy);
|
||||
}
|
||||
|
||||
template <typename A>
|
||||
typename std::enable_if<std::is_integral<A>::value, PP>::type
|
||||
typename std::enable_if_t<std::is_integral<A>::value, PP>
|
||||
operator - (A a) const
|
||||
{
|
||||
return PP(this->addr() - a * sizeof(T), this->proxy);
|
||||
@@ -324,7 +323,7 @@ class ProxyPtr : public ConstProxyPtr<T, Proxy>
|
||||
};
|
||||
|
||||
template <typename T, typename Proxy, typename A>
|
||||
typename std::enable_if<std::is_integral<A>::value, ProxyPtr<T, Proxy>>::type
|
||||
typename std::enable_if_t<std::is_integral<A>::value, ProxyPtr<T, Proxy>>
|
||||
operator + (A a, const ProxyPtr<T, Proxy> &other)
|
||||
{
|
||||
return other + a;
|
||||
|
||||
@@ -62,19 +62,19 @@ struct GenericSyscallABI32 : public GenericSyscallABI
|
||||
struct IsWide;
|
||||
|
||||
template <typename T>
|
||||
struct IsWide<T, typename std::enable_if<
|
||||
struct IsWide<T, typename std::enable_if_t<
|
||||
std::is_integral<T>::value &&
|
||||
(sizeof(T) < sizeof(uint64_t) ||
|
||||
GuestABI::IsConforming<T>::value)>::type>
|
||||
GuestABI::IsConforming<T>::value)>>
|
||||
{
|
||||
static const bool value = false;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct IsWide<T, typename std::enable_if<
|
||||
struct IsWide<T, typename std::enable_if_t<
|
||||
std::is_integral<T>::value &&
|
||||
sizeof(T) == sizeof(uint64_t) &&
|
||||
!GuestABI::IsConforming<T>::value>::type>
|
||||
!GuestABI::IsConforming<T>::value>>
|
||||
{
|
||||
static const bool value = true;
|
||||
};
|
||||
@@ -95,9 +95,9 @@ namespace GuestABI
|
||||
// For 64 bit systems, return syscall args directly.
|
||||
template <typename ABI, typename Arg>
|
||||
struct Argument<ABI, Arg,
|
||||
typename std::enable_if<
|
||||
typename std::enable_if_t<
|
||||
std::is_base_of<GenericSyscallABI64, ABI>::value &&
|
||||
std::is_integral<Arg>::value>::type>
|
||||
std::is_integral<Arg>::value>>
|
||||
{
|
||||
static Arg
|
||||
get(ThreadContext *tc, typename ABI::State &state)
|
||||
@@ -112,7 +112,7 @@ struct Argument<ABI, Arg,
|
||||
// arguments aren't handled generically.
|
||||
template <typename ABI, typename Arg>
|
||||
struct Argument<ABI, Arg,
|
||||
typename std::enable_if<!ABI::template IsWide<Arg>::value>::type>
|
||||
typename std::enable_if_t<!ABI::template IsWide<Arg>::value>>
|
||||
{
|
||||
static Arg
|
||||
get(ThreadContext *tc, typename ABI::State &state)
|
||||
|
||||
Reference in New Issue
Block a user