X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fmaputils.h;h=66b4e3baf82c50d815f5bcf4ce0615729ebbf0fb;hb=242a4a9abe1e1113b5eb39aa751aa054f696d7be;hp=2495a1e29b41854e62850324d80fa358ffe2e152;hpb=bcca7a40a6c59ee1effbaa1027a5364213434448;p=libs%2Fcore.git diff --git a/source/core/maputils.h b/source/core/maputils.h index 2495a1e..66b4e3b 100644 --- a/source/core/maputils.h +++ b/source/core/maputils.h @@ -74,6 +74,12 @@ const typename T::mapped_type &get_item(const T &map, const typename T::key_type return i->second; } +template +D *get_item(const T &map, const typename T::key_type &key) +{ + return dynamic_cast(get_item(map, key)); +} + template typename T::iterator insert_unique(T &map, const typename T::key_type &key, const typename T::mapped_type &item) {