Fix some warnings (#452)

* Move `result` up and return it

This allows `gcc` to elide the copy in the return and keeps it from
warning with `-Wnvro` enabled.

* Remove harmful dtor definition

The definition of the dtor is not necessary and actually harmful since
the definition of a class's implicit copy constructor is deprecated if
that class has a user-declared constructor as of C++11.  Compilers can
warn about this with `-Wdeprecated`.

---------

Co-authored-by: Christoph Weiss <weiss@wsoptics.de>
This commit is contained in:
fiesh
2025-08-06 23:59:52 +02:00
committed by GitHub
parent 781d8ee87c
commit 80cb4520f7

View File

@@ -1299,8 +1299,6 @@ template <>
class standard_value<bool> : public abstract_value<bool>
{
public:
~standard_value() override = default;
standard_value()
{
set_default_and_implicit();
@@ -2773,18 +2771,18 @@ Options::help_one_group(const std::string& g) const
{
using OptionHelp = std::vector<std::pair<String, String>>;
String result;
auto group = m_help.find(g);
if (group == m_help.end())
{
return "";
return result;
}
OptionHelp format;
std::size_t longest = 0;
String result;
if (!g.empty())
{
result += toLocalString(" " + g + " options:\n");