We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 75c9911 commit e2f31dfCopy full SHA for e2f31df
include/jinja2cpp/reflected_value.h
@@ -8,6 +8,7 @@
8
#include <string>
9
#include <type_traits>
10
#include <memory>
11
+#include <boost/optional.hpp>
12
13
namespace jinja2
14
{
@@ -91,11 +92,11 @@ class ReflectedMapImpl : public ReflectedMapImplBase<ReflectedMapImpl<T>>
91
92
template<typename Fn>
93
Value GetField(Fn&& accessor) const
94
- return accessor(m_valuePtr ? *m_valuePtr : m_value);
95
+ return accessor(m_valuePtr ? *m_valuePtr : m_value.get());
96
}
97
98
private:
- T m_value;
99
+ boost::optional<T> m_value;
100
const T* m_valuePtr = nullptr;
101
};
102
0 commit comments