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