From a039c8ad36779903571419cb06cd052f8fc41512 Mon Sep 17 00:00:00 2001 From: HampusM Date: Tue, 29 Mar 2022 17:40:04 +0200 Subject: refactor: use trailing return types --- src/argument_parser.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/argument_parser.cpp') diff --git a/src/argument_parser.cpp b/src/argument_parser.cpp index 94c6a4a..fd18bc7 100644 --- a/src/argument_parser.cpp +++ b/src/argument_parser.cpp @@ -19,9 +19,9 @@ void optarg_error(char arg, const std::string_view &error) noexcept /** * Returns the current optarg as a string view. */ -std::string_view get_str_optarg() noexcept +auto get_str_optarg() noexcept -> std::string_view { - return std::string_view(optarg); + return {optarg}; } /** @@ -30,7 +30,7 @@ std::string_view get_str_optarg() noexcept * @param arg The current command-line argument character * @param check_zero Whether or not to make sure that the result is not zero */ -uint32_t get_uint_optarg(char arg, bool check_zero = false) noexcept +auto get_uint_optarg(char arg, bool check_zero = false) noexcept -> uint32_t { auto conversion_result = str_to_uint(get_str_optarg()); @@ -49,10 +49,10 @@ ArgumentParser::ArgumentParser( { } -ParsedArguments ArgumentParser::parse( +auto ArgumentParser::parse( const std::vector