From 74370db603dd3b95ba53c4e0ca9136abfd3ec402 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Thu, 15 Jan 2015 16:37:58 -0500 Subject: [PATCH] no message --- toolbox/mm.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/toolbox/mm.cpp b/toolbox/mm.cpp index ad94556..2d47716 100644 --- a/toolbox/mm.cpp +++ b/toolbox/mm.cpp @@ -100,6 +100,14 @@ namespace return true; } + + template + int16_t with_handle(uint32_t handle, Fx fx) + { + auto iter = HandleMap.find(handle); + if (iter == HandleMap.end()) return MacOS::memWZErr; + return fx(iter->second); + } } namespace MM