diff options
Diffstat (limited to 'cutl/compiler/context.txx')
-rw-r--r-- | cutl/compiler/context.txx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/cutl/compiler/context.txx b/cutl/compiler/context.txx index 6c69d0a..2518019 100644 --- a/cutl/compiler/context.txx +++ b/cutl/compiler/context.txx @@ -65,7 +65,7 @@ namespace cutl } template <typename X> - void context:: + X& context:: set (std::string const& key, X const& value) { try @@ -73,8 +73,12 @@ namespace cutl std::pair<map::iterator, bool> r ( map_.insert (map::value_type (key, value))); + X& x (r.first->second. template value<X> ()); + if (!r.second) - r.first->second. template value<X> () = value; + x = value; + + return x; } catch (container::any::typing const&) { |