Browse Source

allow non-const access to wrapped type. Can be dangerous! USE WITH CAUTION!

master
roker 4 years ago
parent
commit
d965b3115b
  1. 8
      src/wrapper.hh

8
src/wrapper.hh

@ -97,10 +97,16 @@ public:
} }
const T* operator->() const { return value; } const T* operator->() const { return value; }
const T* get() const { return value; } const T* get() const { return value; }
// dangerous!
T* operator->() { return value; }
T* get() { return value;}
T* move_out() { T* r = value; value=nullptr; return r;} T* move_out() { T* r = value; value=nullptr; return r;}
// only implemented for the datatypes where necessay.
// other implementations can follow if necessary.
T* copy_out(); T* copy_out();
protected: protected:

Loading…
Cancel
Save