diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-11-07 22:26:00 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-11-07 22:26:00 -0800 |
commit | 562ceed016e00411407356cf6d7ec960b86811e1 (patch) | |
tree | f62835df442d47f1265e8173459997a93e4b7fae /001help.cc | |
parent | 6fa778b3e71f625fad5e98d540b2a613328f8571 (diff) | |
download | mu-562ceed016e00411407356cf6d7ec960b86811e1.tar.gz |
2391
No, my idea was abortive. My new plan was to run no transforms for generic recipes, and instead only run them on concrete specializations as they're created. The trouble with this approach is that new contains a type specification in its ingredient which apparently needed to be transformed into an allocate before specialization. But no, how was that working? How was new computing size based on type ingredients? It might have been wrong all along.
Diffstat (limited to '001help.cc')
-rw-r--r-- | 001help.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/001help.cc b/001help.cc index e42dc6a7..c193cf7d 100644 --- a/001help.cc +++ b/001help.cc @@ -96,6 +96,11 @@ template<typename T> typename T::mapped_type& get(T& map, typename T::key_type c assert(iter != map.end()); return iter->second; } +template<typename T> typename T::mapped_type const& get(const T& map, typename T::key_type const& key) { + typename T::const_iterator iter(map.find(key)); + assert(iter != map.end()); + return iter->second; +} template<typename T> typename T::mapped_type const& put(T& map, typename T::key_type const& key, typename T::mapped_type const& value) { map[key] = value; return map[key]; |