mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-07 19:34:56 +00:00
Add dynamic_pointer_cast method to Shared_pointer
This methods is currently only used for casting an Io_channel object to an Socket_io_channel object.
This commit is contained in:
parent
cba25cc1d6
commit
4ba1669b39
@ -145,6 +145,12 @@ namespace Noux {
|
||||
T const* operator -> () const { return _ptr; }
|
||||
|
||||
operator bool () const { return _ptr != 0; }
|
||||
|
||||
template<typename To>
|
||||
Shared_pointer<To> dynamic_pointer_cast()
|
||||
{
|
||||
return Shared_pointer<To>(dynamic_cast<To *>(_ptr), _alloc);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user