};
template <typename T>
-struct FoldingSetTrait<T, std::enable_if_t<std::is_enum<T>::value>> {
+struct FoldingSetTrait<T, typename std::enable_if_t<std::is_enum<T>::value>> {
static void Profile(const T &X, FoldingSetNodeID &ID) {
- ID.AddInteger(static_cast<std::underlying_type_t<T>>(X));
+ ID.AddInteger(static_cast<typename std::underlying_type_t<T>>(X));
}
};
/// always be a reference, to avoid returning a reference to a temporary.
template <typename EltTy, typename FirstTy> class first_or_second_type {
public:
- using type = std::conditional_t<std::is_reference<EltTy>::value, FirstTy,
+ using type =
+ typename std::conditional_t<std::is_reference<EltTy>::value, FirstTy,
std::remove_reference_t<FirstTy>>;
};
} // end namespace detail
// - its internal representation overflows.
struct CheckedInt {
// Integral constructor, asserts if Value cannot be represented as intmax_t.
- template <typename Integral,
- std::enable_if_t<std::is_integral<Integral>::value, bool> = 0>
+ template <typename Integral, typename std::enable_if_t<
+ std::is_integral<Integral>::value, bool> = 0>
static CheckedInt from(Integral FromValue) {
if (!canTypeFitValue<intmax_t>(FromValue))
assertOutOfBounds();
// Enum constructor, asserts if Value cannot be represented as intmax_t.
template <typename Enum,
- std::enable_if_t<std::is_enum<Enum>::value, bool> = 0>
+ typename std::enable_if_t<std::is_enum<Enum>::value, bool> = 0>
static CheckedInt from(Enum FromValue) {
using type = std::underlying_type_t<Enum>;
return from<type>(static_cast<type>(FromValue));
}
// Convert to integral, asserts if Value cannot be represented as Integral.
- template <typename Integral,
- std::enable_if_t<std::is_integral<Integral>::value, bool> = 0>
+ template <typename Integral, typename std::enable_if_t<
+ std::is_integral<Integral>::value, bool> = 0>
Integral to() const {
if (!canTypeFitValue<Integral>(Value))
assertOutOfBounds();
// Convert to enum, asserts if Value cannot be represented as Enum's
// underlying type.
template <typename Enum,
- std::enable_if_t<std::is_enum<Enum>::value, bool> = 0>
+ typename std::enable_if_t<std::is_enum<Enum>::value, bool> = 0>
Enum to() const {
using type = std::underlying_type_t<Enum>;
return Enum(to<type>());
template <typename CastT, typename ValueT>
static auto castValue(
ValueT value,
- std::enable_if_t<is_detected<has_dyn_cast_t, ValueT, CastT>::value> * =
- nullptr) {
+ typename std::enable_if_t<
+ is_detected<has_dyn_cast_t, ValueT, CastT>::value> * = nullptr) {
return value.template dyn_cast<CastT>();
}
template <typename CastT, typename ValueT>
static auto castValue(
ValueT value,
- std::enable_if_t<!is_detected<has_dyn_cast_t, ValueT, CastT>::value> * =
- nullptr) {
+ typename std::enable_if_t<
+ !is_detected<has_dyn_cast_t, ValueT, CastT>::value> * = nullptr) {
return dyn_cast<CastT>(value);
}