mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-05 16:21:15 -03:00
Use the STL's make_unique if available
Fixes a build error with g++ 6.1 Fixes #3759
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user