FTL: Add SmallMap mutators
Add try_emplace, try_replace, emplace_or_replace, and erase. Rename
getters so that `find` returns an iterator like standard containers.
Bug: 185536303
Test: ftl_test
Change-Id: I095bb800c6bd786b9fceaf632aa06b2d6cdadb71
diff --git a/include/ftl/small_vector.h b/include/ftl/small_vector.h
index cb0ae35..0341435 100644
--- a/include/ftl/small_vector.h
+++ b/include/ftl/small_vector.h
@@ -348,7 +348,7 @@
using Impl::pop_back;
void unstable_erase(iterator it) {
- if (it != last()) std::iter_swap(it, last());
+ if (it != last()) replace(it, std::move(back()));
pop_back();
}