struct StorageTriviallyDestructible {
protected:
bool hasValue_;
- std::aligned_storage_t<sizeof(Value), alignof(Value)> value_[1];
+ typename std::aligned_storage<sizeof(Value), alignof(Value)>::type
+ value_[1];
public:
StorageTriviallyDestructible() : hasValue_{false} {}
struct StorageNonTriviallyDestructible {
protected:
bool hasValue_;
- std::aligned_storage_t<sizeof(Value), alignof(Value)> value_[1];
+ typename std::aligned_storage<sizeof(Value), alignof(Value)>::type
+ value_[1];
public:
StorageNonTriviallyDestructible() : hasValue_{false} {}
}
};
- struct Storage : std::conditional_t<
+ struct Storage : std::conditional<
std::is_trivially_destructible<Value>::value,
StorageTriviallyDestructible,
- StorageNonTriviallyDestructible> {
+ StorageNonTriviallyDestructible>::type {
bool hasValue() const {
return this->hasValue_;
}
}
}
-template <class T, class Opt = Optional<std::decay_t<T>>>
+template <class T, class Opt = Optional<typename std::decay<T>::type>>
Opt make_optional(T&& v) {
return Opt(std::forward<T>(v));
}
if (!obj.hasValue()) {
return 0;
}
- return hash<remove_const_t<T>>()(*obj);
+ return hash<typename remove_const<T>::type>()(*obj);
}
};
FOLLY_NAMESPACE_STD_END