Index: mojo/public/cpp/bindings/lib/map_serialization.h |
diff --git a/mojo/public/cpp/bindings/lib/map_serialization.h b/mojo/public/cpp/bindings/lib/map_serialization.h |
index c28b835da6f7cf72e3b57e8dfc8925597e392ab1..88276e1b3c4b1e5da1749f2e26b46537cf7f253c 100644 |
--- a/mojo/public/cpp/bindings/lib/map_serialization.h |
+++ b/mojo/public/cpp/bindings/lib/map_serialization.h |
@@ -46,12 +46,15 @@ class MapKeyReader : public MapReaderBase<MaybeConstUserType> { |
public: |
using Base = MapReaderBase<MaybeConstUserType>; |
using Traits = typename Base::Traits; |
+ using MaybeConstIterator = typename Base::MaybeConstIterator; |
explicit MapKeyReader(MaybeConstUserType& input) : Base(input) {} |
~MapKeyReader() {} |
- const typename Traits::Key& GetNext() { |
- const typename Traits::Key& key = Traits::GetKey(this->iter_); |
+ using GetNextResult = |
+ decltype(Traits::GetKey(std::declval<MaybeConstIterator&>())); |
+ GetNextResult GetNext() { |
+ GetNextResult key = Traits::GetKey(this->iter_); |
Traits::AdvanceIterator(this->iter_); |
return key; |
} |