mirror of
https://github.com/schrodinger/pymol-open-source.git
synced 2026-06-04 20:04:21 +08:00
fix compiling on Linux with -std=c++17
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user