nic_router: safe pointers that are valid and const

Add safe pointer constructor that takes a reference as argument to enable the
use of the safe pointer wrapper as const object.

Ref #2670
This commit is contained in:
Martin Stein 2018-03-07 14:57:13 +01:00 committed by Christian Helmuth
parent 2c2037952d
commit 8fff7df438

View File

@ -33,6 +33,8 @@ class Net::Pointer
Pointer() : _ptr(nullptr) { }
Pointer(T &ref) : _ptr(&ref) { }
T &deref() const
{
if (_ptr == nullptr) {