Use more C++17 features
Mainly structured bindings, inline variables, and class template
argument deduction, plus many more smaller things.
Change-Id: I810d17e0adb470426e4e30c898e03b3140ad052f
diff --git a/tests/daemon/table/strategy-info-host.t.cpp b/tests/daemon/table/strategy-info-host.t.cpp
index 2a3a33e..e4323e4 100644
--- a/tests/daemon/table/strategy-info-host.t.cpp
+++ b/tests/daemon/table/strategy-info-host.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -50,8 +50,7 @@
++g_DummyStrategyInfo_count;
}
- virtual
- ~DummyStrategyInfo()
+ ~DummyStrategyInfo() override
{
--g_DummyStrategyInfo_count;
}
@@ -85,19 +84,16 @@
{
StrategyInfoHost host;
g_DummyStrategyInfo_count = 0;
- bool isNew = false;
- DummyStrategyInfo* info = nullptr;
- std::tie(info, isNew) = host.insertStrategyInfo<DummyStrategyInfo>(3503);
+ auto [info, isNew] = host.insertStrategyInfo<DummyStrategyInfo>(3503);
BOOST_CHECK_EQUAL(isNew, true);
BOOST_CHECK_EQUAL(g_DummyStrategyInfo_count, 1);
BOOST_REQUIRE(info != nullptr);
BOOST_CHECK_EQUAL(info->m_id, 3503);
BOOST_CHECK_EQUAL(host.getStrategyInfo<DummyStrategyInfo>(), info);
- DummyStrategyInfo* info2 = nullptr;
- std::tie(info2, isNew) = host.insertStrategyInfo<DummyStrategyInfo>(1032);
- BOOST_CHECK_EQUAL(isNew, false);
+ auto [info2, isNew2] = host.insertStrategyInfo<DummyStrategyInfo>(1032);
+ BOOST_CHECK_EQUAL(isNew2, false);
BOOST_CHECK_EQUAL(g_DummyStrategyInfo_count, 1);
BOOST_CHECK_EQUAL(info2, info);
BOOST_CHECK_EQUAL(info->m_id, 3503);