Commit 34aea735 authored by Jacob Potter's avatar Jacob Potter

Fix for C++11 build

Fixes #144
parent 366198c2
...@@ -37,7 +37,9 @@ ...@@ -37,7 +37,9 @@
namespace djinni { namespace djinni {
// See comment on `get_unowning()` in proxy_cache_interface.hpp. // See comment on `get_unowning()` in proxy_cache_interface.hpp.
template <typename T> static inline auto upgrade_weak(const T & ptr) { return ptr.lock(); } template <typename T> static inline auto upgrade_weak(const T & ptr) -> decltype(ptr.lock()) {
return ptr.lock();
}
template <typename T> static inline T * upgrade_weak(T* ptr) { return ptr; } template <typename T> static inline T * upgrade_weak(T* ptr) { return ptr; }
template <typename T> static inline bool is_expired(const T & ptr) { return ptr.expired(); } template <typename T> static inline bool is_expired(const T & ptr) { return ptr.expired(); }
template <typename T> static inline bool is_expired(T* ptr) { return !ptr; } template <typename T> static inline bool is_expired(T* ptr) { return !ptr; }
......
...@@ -31,7 +31,9 @@ namespace djinni { ...@@ -31,7 +31,9 @@ namespace djinni {
* *
* (The helper for .lock() is only used by proxy_cache_impl.hpp, so it's defined there.) * (The helper for .lock() is only used by proxy_cache_impl.hpp, so it's defined there.)
*/ */
template <typename T> static inline auto get_unowning(const T & ptr) { return ptr.get(); } template <typename T> static inline auto get_unowning(const T & ptr) -> decltype(ptr.get()) {
return ptr.get();
}
template <typename T> static inline T * get_unowning(T * ptr) { return ptr; } template <typename T> static inline T * get_unowning(T * ptr) { return ptr; }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment