Commit 5d3f05bd authored by Andrew Gallagher's avatar Andrew Gallagher Committed by Tudor Bosman

folly::dynamic: comment about std::vector const-iter erase issue

Test Plan: none

Reviewed By: delong.j@fb.com

FB internal diff: D543196
parent e6ceb4cd
......@@ -587,6 +587,9 @@ inline std::size_t dynamic::erase(dynamic const& key) {
inline dynamic::const_iterator dynamic::erase(const_iterator it) {
auto& arr = get<Array>();
// std::vector doesn't have an erase method that works on const iterators,
// even though the standard says it should, so this hack converts to a
// non-const iterator before calling erase.
return get<Array>().erase(arr.begin() + (it - arr.begin()));
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment