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/tools/nfdc/format-helpers.cpp b/tools/nfdc/format-helpers.cpp
index a207bf8..63f2417 100644
--- a/tools/nfdc/format-helpers.cpp
+++ b/tools/nfdc/format-helpers.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, 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,
@@ -128,14 +128,13 @@
return os;
}
-Separator::Separator(const std::string& first, const std::string& subsequent)
+Separator::Separator(std::string_view first, std::string_view subsequent)
: m_first(first)
, m_subsequent(subsequent)
- , m_count(0)
{
}
-Separator::Separator(const std::string& subsequent)
+Separator::Separator(std::string_view subsequent)
: Separator("", subsequent)
{
}
@@ -152,7 +151,6 @@
ItemAttributes::ItemAttributes(bool wantMultiLine, int maxAttributeWidth)
: m_wantMultiLine(wantMultiLine)
, m_maxAttributeWidth(maxAttributeWidth)
- , m_count(0)
{
}