// Copyright 2014 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_H_ #define MOJO_PUBLIC_CPP_BINDINGS_MAP_H_ #include #include #include namespace mojo { // TODO(yzshen): These conversion functions should be removed and callsites // should be revisited and changed to use the same map type. template std::unordered_map MapToUnorderedMap( const std::map& input) { return std::unordered_map(input.begin(), input.end()); } template std::unordered_map MapToUnorderedMap(std::map&& input) { return std::unordered_map(std::make_move_iterator(input.begin()), std::make_move_iterator(input.end())); } template std::map UnorderedMapToMap( const std::unordered_map& input) { return std::map(input.begin(), input.end()); } template std::map UnorderedMapToMap(std::unordered_map&& input) { return std::map(std::make_move_iterator(input.begin()), std::make_move_iterator(input.end())); } } // namespace mojo #endif // MOJO_PUBLIC_CPP_BINDINGS_MAP_H_