File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,9 @@ class MutableValuePtr {
49
49
50
50
template <class T >
51
51
class ImmutableValuePtr {
52
+ public:
53
+ using const_T = typename std::add_const<T>::type;
54
+
52
55
private:
53
56
std::shared_ptr<T> internal_ptr;
54
57
@@ -77,11 +80,11 @@ class ImmutableValuePtr {
77
80
return *this ;
78
81
}
79
82
80
- T * get () const { return internal_ptr.get (); }
83
+ const_T * get () const { return internal_ptr.get (); }
81
84
82
85
explicit operator bool () const { return get () == nullptr ; }
83
- T & operator *() const { return *get (); }
84
- T * operator ->() const { return get (); }
86
+ const_T & operator *() const { return *get (); }
87
+ const_T * operator ->() const { return get (); }
85
88
86
89
MutableValuePtr<T> get_mutable_copy () const {
87
90
return MutableValuePtr<T>(new T (*internal_ptr));
You can’t perform that action at this time.
0 commit comments