mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 04:43:10 +00:00
Use the STL's make_unique if available
Fixes a build error with g++ 6.1 Fixes #3759
This commit is contained in:
parent
2e47817adf
commit
009a677e0d
1 changed files with 4 additions and 0 deletions
|
@ -644,11 +644,15 @@ wcstring vformat_string(const wchar_t *format, va_list va_orig);
|
|||
void append_format(wcstring &str, const wchar_t *format, ...);
|
||||
void append_formatv(wcstring &str, const wchar_t *format, va_list ap);
|
||||
|
||||
#ifdef __cpp_lib_make_unique
|
||||
using std::make_unique;
|
||||
#else
|
||||
/// make_unique implementation
|
||||
template<typename T, typename... Args>
|
||||
std::unique_ptr<T> make_unique(Args&&... args) {
|
||||
return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
|
||||
}
|
||||
#endif
|
||||
|
||||
/// This functions returns the end of the quoted substring beginning at \c in. The type of quoting
|
||||
/// character is detemrined by examining \c in. Returns 0 on error.
|
||||
|
|
Loading…
Reference in a new issue