From 1ace53533a546ae8f1debed18d99d2575e6fc3b8 Mon Sep 17 00:00:00 2001 From: Martchus Date: Mon, 30 Jan 2017 00:39:17 +0100 Subject: [PATCH] string builder: Remove unused code --- application/argumentparser.cpp | 4 ++-- conversion/stringbuilder.h | 23 ++++++----------------- 2 files changed, 8 insertions(+), 19 deletions(-) diff --git a/application/argumentparser.cpp b/application/argumentparser.cpp index 1372b84..f2ba80d 100644 --- a/application/argumentparser.cpp +++ b/application/argumentparser.cpp @@ -1123,10 +1123,10 @@ void ArgumentParser::checkConstraints(const ArgumentVector &args) for(const Argument *arg : args) { const auto occurrences = arg->occurrences(); if(arg->isParentPresent() && occurrences > arg->maxOccurrences()) { - throw Failure("The argument \"" % string(arg->name()) % "\" mustn't be specified more than " % numberToString(arg->maxOccurrences()) + (arg->maxOccurrences() == 1 ? " time." : " times.")); + throw Failure("The argument \"" % string(arg->name()) % "\" mustn't be specified more than " % arg->maxOccurrences() + (arg->maxOccurrences() == 1 ? " time." : " times.")); } if(arg->isParentPresent() && occurrences < arg->minOccurrences()) { - throw Failure("The argument \"" % string(arg->name()) % "\" must be specified at least " % numberToString(arg->minOccurrences()) + (arg->minOccurrences() == 1 ? " time." : " times.")); + throw Failure("The argument \"" % string(arg->name()) % "\" must be specified at least " % arg->minOccurrences() + (arg->minOccurrences() == 1 ? " time." : " times.")); } Argument *conflictingArgument = nullptr; if(arg->isMainArgument()) { diff --git a/conversion/stringbuilder.h b/conversion/stringbuilder.h index c3c96bc..c620820 100644 --- a/conversion/stringbuilder.h +++ b/conversion/stringbuilder.h @@ -126,23 +126,6 @@ struct TupleToString { } }; -template -class StringTuple : public std::tuple -{ -public: - StringTuple(Elements&&... elements) : - std::tuple(elements...) - {} - - -}; - -template -constexpr auto makeStringTuple(Elements&&... elements) -> decltype(StringTuple(elements...)) -{ - return StringTuple(elements...); -} - } /// \endcond @@ -158,6 +141,12 @@ StringType tupleToString(const std::tuple &tuple) return res; } +template +constexpr StringType argsToString(Args&&... args) +{ + return tupleToString(std::make_tuple(args...)); +} + /*! * \brief Allows construction of string-tuples via %-operator, eg. string1 % "string2" % string3. */