Adjust code for some older GCC versions
Implicit conversion from raw-pointer to std::unique_ptr<T> was failing, use a stub replacement for std::make_unqiue to wrap this up cleanly.
This commit is contained in:
parent
7738f33306
commit
4ed410dc09
1 changed files with 12 additions and 3 deletions
|
@ -21,6 +21,15 @@
|
|||
#include "dbusconnection.h"
|
||||
#include <algorithm>
|
||||
|
||||
namespace { // anonymosu namespace
|
||||
|
||||
template <typename T, typename... Args>
|
||||
std::unique_ptr<T> our_make_unique(Args&&... args) {
|
||||
return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
|
||||
}
|
||||
|
||||
} // end of anonymous namespace
|
||||
|
||||
namespace FGSwiftBus
|
||||
{
|
||||
|
||||
|
@ -198,7 +207,7 @@ namespace FGSwiftBus
|
|||
if (dbus_watch_get_enabled(watch) == FALSE) { return true; }
|
||||
|
||||
int fd = dbus_watch_get_unix_fd(watch);
|
||||
m_watchers.emplace(fd, new WatchHandler(m_eventBase.get(), watch));
|
||||
m_watchers.emplace(fd, our_make_unique<WatchHandler>(m_eventBase.get(), watch));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue