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
*/
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)
};
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)
};
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)
};
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)
};
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)
*/
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)
};
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)
*/
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,
};
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
*/
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>
{};
*/
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)
};
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)
*/
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>
{};
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
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)
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
{};
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) &&
!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
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
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.
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
{};
*/
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
};
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)
// 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)
};
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)
};
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)
};
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)
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)
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)
*/
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)
};
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)
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)
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)
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)
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)
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)
};
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)
* 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);
* 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);
* 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));
* 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());
}
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));
/// 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;
}
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))];
/// 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)),
/** 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;
/** 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];
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);
}
*/
/** @{ */
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;
* 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.");
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);
}
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)
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;
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)
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;
* @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); }
/**
*/
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();
* @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();
* @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;
*/
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();
* @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();
* @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;
* @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);
* @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
* @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
* @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);
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);
}
*/
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;
* 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
}
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
}
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);
}
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
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)
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)
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)
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)
// 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)
{
}
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)
{
// 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)
{
};
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)
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)
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...))
{
}
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)
{}
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);
};
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;
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) {}
}
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);
};
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;
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;
};
// 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)
// 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)