get_or_throw and get_optional
authorBlake Matheny <bmatheny@fb.com>
Wed, 29 Apr 2015 15:35:30 +0000 (08:35 -0700)
committerAndrii Grynenko <andrii@fb.com>
Wed, 29 Apr 2015 22:57:36 +0000 (15:57 -0700)
commitf0901aec9160175eab49586f02539536a5d807fb
tree45f7ae40ded1e53203f4d174cffb845a30e969c3
parentf3e177a5fa754551b977bdceec70abc833ff8e9c
get_or_throw and get_optional

Summary:
Adds get_or_throw map helper (get a value, or throw with the specified
exception type) and get_optional (get an Optional<Value>). This is a folly
backport of some util helpers in experimental.

Test Plan: Unit tests

Reviewed By: wez@fb.com

Subscribers: folly-diffs@, yfeldblum, chalfant

FB internal diff: D2029802

Tasks: 4332480

Signature: t1:2029802:1430280249:3efbb2fb9394e31b3fbe6d5bd209d12ebb7ed587
folly/MapUtil.h
folly/test/MapUtilTest.cpp