// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 #include "mapuser.h" #include std::map > MapUser::callCreateMap() { return createMap(); } std::map > MapUser::createMap() { std::map > retval; std::pair value{Complex(1.2, 3.4), 2}; retval.insert({"zero", value}); value = {Complex(5.6, 7.8), 3}; retval.insert({"one", value}); value = {Complex(9.1, 2.3), 5}; retval.insert({"two", value}); return retval; } void MapUser::showMap(std::map mapping) { std::cout << __FUNCTION__ << std::endl; for (const auto &p : mapping) std::cout << p.first << " => " << p.second << std::endl; } void MapUser::pointerToMap(std::map *) { } void MapUser::referenceToMap(std::map &) { } std::map > > MapUser::foo() const { std::map > > result; return result; }