File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -112,15 +112,15 @@ namespace kit
112
112
m_Value = value;
113
113
}
114
114
115
- void pend () {
115
+ void pend () const {
116
116
m_Value = boost::optional<T>();
117
117
}
118
118
119
- void recache () {
119
+ void recache () const {
120
120
m_Value = m_Getter ();
121
121
}
122
122
123
- void ensure () {
123
+ void ensure () const {
124
124
if (!m_Value)
125
125
m_Value = m_Getter ();
126
126
}
@@ -129,10 +129,10 @@ namespace kit
129
129
return bool (m_Value);
130
130
}
131
131
132
- boost::optional<T> try_get () {
132
+ boost::optional<T> try_get () const {
133
133
return m_Value;
134
134
}
135
- T& get () {
135
+ T& get () const {
136
136
ensure ();
137
137
return *m_Value;
138
138
}
@@ -146,12 +146,12 @@ namespace kit
146
146
m_Getter = func;
147
147
}
148
148
149
- T& operator ()() {
149
+ T& operator ()() const {
150
150
return get ();
151
151
}
152
152
153
153
private:
154
- boost::optional<T> m_Value;
154
+ mutable boost::optional<T> m_Value;
155
155
std::function<T()> m_Getter;
156
156
};
157
157
You can’t perform that action at this time.
0 commit comments