mirror of
https://github.com/jarro2783/cxxopts.git
synced 2026-01-18 01:11:24 +01:00
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:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user