mirror of
https://github.com/KingDuckZ/kamokan.git
synced 2024-12-27 21:35:41 +00:00
Make SafeStackObject implicitly up-castable.
This commit is contained in:
parent
cd1be59cfa
commit
f5f19350ea
1 changed files with 8 additions and 0 deletions
|
@ -38,6 +38,8 @@ namespace curry {
|
|||
SafeStackObject& operator= (const SafeStackObject& parOther) = delete;
|
||||
|
||||
operator Kakoune::SafePtr<T>&();
|
||||
template <typename U>
|
||||
operator Kakoune::SafePtr<U>();
|
||||
T& operator*();
|
||||
safe_ptr& operator->();
|
||||
|
||||
|
@ -84,6 +86,12 @@ namespace curry {
|
|||
return m_obj_ptr;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
template <typename U>
|
||||
SafeStackObject<T>::operator Kakoune::SafePtr<U>() {
|
||||
return Kakoune::SafePtr<U>(&m_obj);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T& SafeStackObject<T>::operator*() {
|
||||
return *m_obj_ptr;
|
||||
|
|
Loading…
Reference in a new issue