aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/tests/libsample/mapuser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sources/shiboken6/tests/libsample/mapuser.cpp')
-rw-r--r--sources/shiboken6/tests/libsample/mapuser.cpp28
1 files changed, 11 insertions, 17 deletions
diff --git a/sources/shiboken6/tests/libsample/mapuser.cpp b/sources/shiboken6/tests/libsample/mapuser.cpp
index 56b5f6652..c793235df 100644
--- a/sources/shiboken6/tests/libsample/mapuser.cpp
+++ b/sources/shiboken6/tests/libsample/mapuser.cpp
@@ -1,38 +1,32 @@
// 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 <iostream>
#include "mapuser.h"
-std::map<std::string, std::pair<Complex, int> >
-MapUser::callCreateMap()
+#include <iostream>
+
+std::map<std::string, std::pair<Complex, int> > MapUser::callCreateMap()
{
return createMap();
}
-
-std::map<std::string, std::pair<Complex, int> >
-MapUser::createMap()
+std::map<std::string, std::pair<Complex, int> > MapUser::createMap()
{
std::map<std::string, std::pair<Complex, int> > retval;
- std::pair<std::string, std::pair<Complex, int> >
- item0("zero", std::pair<Complex, int>(Complex(1.2, 3.4), 2));
- retval.insert(item0);
+ std::pair<Complex, int> value{Complex(1.2, 3.4), 2};
+ retval.insert({"zero", value});
- std::pair<std::string, std::pair<Complex, int> >
- item1("one", std::pair<Complex, int>(Complex(5.6, 7.8), 3));
- retval.insert(item1);
+ value = {Complex(5.6, 7.8), 3};
+ retval.insert({"one", value});
- std::pair<std::string, std::pair<Complex, int> >
- item2("two", std::pair<Complex, int>(Complex(9.1, 2.3), 5));
- retval.insert(item2);
+ value = {Complex(9.1, 2.3), 5};
+ retval.insert({"two", value});
return retval;
}
-void
-MapUser::showMap(std::map<std::string, int> mapping)
+void MapUser::showMap(std::map<std::string, int> mapping)
{
std::cout << __FUNCTION__ << std::endl;
for (auto it = mapping.begin(), end = mapping.end(); it != end; ++it)