Fix compile error with gcc-6 which enables C++14 by default
This commit is contained in:
parent
703c77ec89
commit
4e44fccdcf
|
@ -38,6 +38,9 @@
|
|||
|
||||
namespace nghttp2 {
|
||||
|
||||
#if __cplusplus > 201103L
|
||||
using std::make_unique;
|
||||
#else // __cplusplus <= 201103L
|
||||
template <typename T, typename... U>
|
||||
typename std::enable_if<!std::is_array<T>::value, std::unique_ptr<T>>::type
|
||||
make_unique(U &&... u) {
|
||||
|
@ -49,6 +52,7 @@ typename std::enable_if<std::is_array<T>::value, std::unique_ptr<T>>::type
|
|||
make_unique(size_t size) {
|
||||
return std::unique_ptr<T>(new typename std::remove_extent<T>::type[size]());
|
||||
}
|
||||
#endif // __cplusplus <= 201103L
|
||||
|
||||
// std::forward is constexpr since C++14
|
||||
template <typename... T>
|
||||
|
|
Loading…
Reference in New Issue