diff options
Diffstat (limited to 'src/libutil/ref.hh')
-rw-r--r-- | src/libutil/ref.hh | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libutil/ref.hh b/src/libutil/ref.hh index 349f24f7c488..9f5da09152c9 100644 --- a/src/libutil/ref.hh +++ b/src/libutil/ref.hh @@ -44,6 +44,12 @@ public: } template<typename T2> + ref<T2> cast() + { + return ref<T2>(std::dynamic_pointer_cast<T2>(p)); + } + + template<typename T2> operator ref<T2> () { return ref<T2>((std::shared_ptr<T2>) p); |