add folly::as_const, like C++17's std::as_const
authorEric Niebler <eniebler@fb.com>
Sun, 8 Jan 2017 05:44:02 +0000 (21:44 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Sun, 8 Jan 2017 05:47:54 +0000 (21:47 -0800)
commit3cec19d4760d9b4057c7e4a6464be86aad216a73
treeabb48cdbb58de41f7cb325c5ee2a01a4f35bf7fd
parent3cdd3857fbfacd9312a23214f54a47f156726927
add folly::as_const, like C++17's std::as_const

Summary: A one-liner from C++17, but a useful one. Const-qualifies an lvalue reference, avoiding the need for an awkward const_cast in some cases.

Reviewed By: yfeldblum

Differential Revision: D4389929

fbshipit-source-id: 1650c4901489eb0dd62fd9fa633b4a0da9f01954
folly/Utility.h
folly/test/UtilityTest.cpp