/** Default handler that triggers a compiler error */
template <typename T>
- T handleOption(const std::string& option,
- const std::string& flag,
- const std::string& optionarg)
+ T handleOption(const std::string& flag, const std::string& optionarg)
{
T::unsupported_handleOption_specialization;
return *static_cast<T*>(nullptr);
/** Handle a string option by returning it as is. */
template <>
- std::string handleOption<std::string>(const std::string& option,
- const std::string& flag,
+ std::string handleOption<std::string>(const std::string& flag,
const std::string& optionarg)
{
return optionarg;
}
/** Handle a bool option, recognizing "true" or "false". */
template <>
- bool handleOption<bool>(const std::string& option,
- const std::string& flag,
- const std::string& optionarg)
+ bool handleOption<bool>(const std::string& flag, const std::string& optionarg)
{
if (optionarg == "true")
{
/** Handle a double option, using `parseNumber` with `std::stod`. */
template <>
- double handleOption<double>(const std::string& option,
- const std::string& flag,
+ double handleOption<double>(const std::string& flag,
const std::string& optionarg)
{
return parseNumber<double>(
/** Handle a int64_t option, using `parseNumber` with `std::stoll`. */
template <>
- int64_t handleOption<int64_t>(const std::string& option,
- const std::string& flag,
+ int64_t handleOption<int64_t>(const std::string& flag,
const std::string& optionarg)
{
return parseNumber<int64_t>(
/** Handle a uint64_t option, using `parseNumber` with `std::stoull`. */
template <>
- uint64_t handleOption<uint64_t>(const std::string& option,
- const std::string& flag,
+ uint64_t handleOption<uint64_t>(const std::string& flag,
const std::string& optionarg)
{
return parseNumber<uint64_t>(
/** Handle a ManagedIn option. */
template <>
- ManagedIn handleOption<ManagedIn>(const std::string& option,
- const std::string& flag,
+ ManagedIn handleOption<ManagedIn>(const std::string& flag,
const std::string& optionarg)
{
ManagedIn res;
/** Handle a ManagedErr option. */
template <>
- ManagedErr handleOption<ManagedErr>(const std::string& option,
- const std::string& flag,
+ ManagedErr handleOption<ManagedErr>(const std::string& flag,
const std::string& optionarg)
{
ManagedErr res;
/** Handle a ManagedOut option. */
template <>
- ManagedOut handleOption<ManagedOut>(const std::string& option,
- const std::string& flag,
+ ManagedOut handleOption<ManagedOut>(const std::string& flag,
const std::string& optionarg)
{
ManagedOut res;