From 23a040f2e5f8f55745984e0c8a099e889b3899cd Mon Sep 17 00:00:00 2001 From: Takatoshi Kondo Date: Tue, 18 Aug 2015 18:15:10 +0900 Subject: [PATCH] Fixed std::map::erase is ambiguous problem in osx, clang, libc++ combination. --- example/boost/msgpack_variant_mapbased.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/example/boost/msgpack_variant_mapbased.cpp b/example/boost/msgpack_variant_mapbased.cpp index 9c4150b0..da1f28a8 100644 --- a/example/boost/msgpack_variant_mapbased.cpp +++ b/example/boost/msgpack_variant_mapbased.cpp @@ -51,11 +51,16 @@ struct proc:boost::static_visitor { } else if (key == "age") { // You can remove key-value pair from msgpack::type::variant_ref + #if defined(MSGPACK_USE_CPP03) v.erase(it++); -#else +#else // defined(MSGPACK_USE_CPP03) +# if MSGPACK_LIB_STD_CXX + it = v.erase(std::multimap::const_iterator(it)); +# else // MSGPACK_LIB_STD_CXX it = v.erase(it); -#endif +# endif // MSGPACK_LIB_STD_CXX +#endif // defined(MSGPACK_USE_CPP03) } else if (key == "address") { // When you want to append string