diff options
author | Hidehiko Abe <hidehiko@google.com> | 2017-12-13 19:00:02 +0900 |
---|---|---|
committer | Hidehiko Abe <hidehiko@google.com> | 2017-12-13 23:42:13 +0900 |
commit | 0411add1e14cc2dc041f5f1776f05a8c4b787d73 (patch) | |
tree | 19a081baf4afcba8d442b5e839cb1ff247f31b7f /mojo/public/cpp/bindings/map_traits_standard.h | |
parent | c96e5aa6f5f1f6df03ef539b4b85c78bf7c292e5 (diff) | |
download | libmojo-0411add1e14cc2dc041f5f1776f05a8c4b787d73.tar.gz |
Revert "Revert "libmojo: Uprev the library to r456626 from Chromium""
This reverts commit 21a249e4d9cb0b2ec6f0ff84ed5f7939ea67ac52.
Test: Build.
Change-Id: Id31199817067e933eb08889b21b83c787b0d4c0d
Merged-In: I2f77e0bb4541d6520dac974cd499b30561c6658f
Diffstat (limited to 'mojo/public/cpp/bindings/map_traits_standard.h')
-rw-r--r-- | mojo/public/cpp/bindings/map_traits_standard.h | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/mojo/public/cpp/bindings/map_traits_standard.h b/mojo/public/cpp/bindings/map_traits_standard.h deleted file mode 100644 index 0c76890..0000000 --- a/mojo/public/cpp/bindings/map_traits_standard.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef MOJO_PUBLIC_CPP_BINDINGS_MAP_TRAITS_STANDARD_H_ -#define MOJO_PUBLIC_CPP_BINDINGS_MAP_TRAITS_STANDARD_H_ - -#include "mojo/public/cpp/bindings/map.h" -#include "mojo/public/cpp/bindings/map_traits.h" - -namespace mojo { - -template <typename K, typename V> -struct MapTraits<Map<K, V>> { - using Key = K; - using Value = V; - using Iterator = typename Map<K, V>::Iterator; - using ConstIterator = typename Map<K, V>::ConstIterator; - - static bool IsNull(const Map<K, V>& input) { return input.is_null(); } - static void SetToNull(Map<K, V>* output) { *output = nullptr; } - - static size_t GetSize(const Map<K, V>& input) { return input.size(); } - - static ConstIterator GetBegin(const Map<K, V>& input) { - return input.begin(); - } - static Iterator GetBegin(Map<K, V>& input) { return input.begin(); } - - static void AdvanceIterator(ConstIterator& iterator) { iterator++; } - static void AdvanceIterator(Iterator& iterator) { iterator++; } - - static const K& GetKey(Iterator& iterator) { return iterator->first; } - static const K& GetKey(ConstIterator& iterator) { return iterator->first; } - - static V& GetValue(Iterator& iterator) { return iterator->second; } - static const V& GetValue(ConstIterator& iterator) { return iterator->second; } - - static bool Insert(Map<K, V>& input, const K& key, V&& value) { - input.insert(key, std::forward<V>(value)); - return true; - } - static bool Insert(Map<K, V>& input, const K& key, const V& value) { - input.insert(key, value); - return true; - } - - static void SetToEmpty(Map<K, V>* output) { output->SetToEmpty(); } -}; - -} // namespace mojo - -#endif // MOJO_PUBLIC_CPP_BINDINGS_MAP_TRAITS_STANDARD_H_ |