fix compiling on Linux with -std=c++17

This commit is contained in:
Thomas Holder
2019-10-17 04:10:08 +02:00
parent 0ff885b24f
commit bd59460f39

View File

@@ -7,6 +7,9 @@
namespace pymol
{
#if __cplusplus >= 201402L
using std::make_unique;
#else
/**
* @brief C++14's std::make_unique<T>
* @param args arguments for constructor of Type T
@@ -22,7 +25,12 @@ template <typename T, typename = pymol::enable_if_t<std::is_array<T>::value>>
std::unique_ptr<T> make_unique(std::size_t size){
return std::unique_ptr<T>(new pymol::remove_extent_t<T>[size]());
}
#endif
#if __cplusplus >= 201703L
using std::destroy_at;
using std::destroy;
#else
/*
* @brief C++17's std::destroy_at
*/
@@ -38,5 +46,6 @@ template <typename T> void destroy(T* iter, T* end)
destroy_at(std::addressof(*iter));
}
}
#endif
} // namespace pymol