Fix compile error with gcc-6 which enables C++14 by default

This commit is contained in:
Tatsuhiro Tsujikawa 2016-01-30 18:41:27 +09:00
parent 703c77ec89
commit 4e44fccdcf
1 changed files with 4 additions and 0 deletions

View File

@ -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>