string builder: Remove unused code

This commit is contained in:
Martchus 2017-01-30 00:39:17 +01:00
parent 17fe42e0ad
commit 1ace53533a
2 changed files with 8 additions and 19 deletions

View File

@ -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()) {

View File

@ -126,23 +126,6 @@ struct TupleToString<StringType, Tuple, 1> {
}
};
template<class... Elements>
class StringTuple : public std::tuple<Elements...>
{
public:
StringTuple(Elements&&... elements) :
std::tuple<Elements...>(elements...)
{}
};
template<class... Elements>
constexpr auto makeStringTuple(Elements&&... elements) -> decltype(StringTuple<Elements...>(elements...))
{
return StringTuple<Elements...>(elements...);
}
}
/// \endcond
@ -158,6 +141,12 @@ StringType tupleToString(const std::tuple<Args...> &tuple)
return res;
}
template<class StringType = std::string, class... Args>
constexpr StringType argsToString(Args&&... args)
{
return tupleToString(std::make_tuple(args...));
}
/*!
* \brief Allows construction of string-tuples via %-operator, eg. string1 % "string2" % string3.
*/