diff --git a/src/core-fmt/include/units/bits/fmt.h b/src/core-fmt/include/units/bits/fmt.h index ce29a2d5..457c87ff 100644 --- a/src/core-fmt/include/units/bits/fmt.h +++ b/src/core-fmt/include/units/bits/fmt.h @@ -174,7 +174,7 @@ template // Parses the range [begin, end) as an unsigned integer. This function assumes // that the range is non-empty and the first character is a digit. -template S> +template S> [[nodiscard]] constexpr It parse_nonnegative_int(It begin, S end, size_t& value) { gsl_Expects(begin != end && '0' <= *begin && *begin <= '9'); @@ -196,7 +196,7 @@ template S> return begin; } -template S> +template S> [[nodiscard]] constexpr It parse_nonnegative_int(It begin, S end, int& value) { size_t val_unsigned = 0; @@ -206,7 +206,7 @@ template S> return begin; } -template S, typename IDHandler> +template S, typename IDHandler> [[nodiscard]] constexpr It do_parse_arg_id(It begin, S end, IDHandler&& handler) { gsl_Expects(begin != end); @@ -226,7 +226,7 @@ template S, typename IDHandler> throw STD_FMT::format_error("invalid format string"); } -template S, typename IDHandler> +template S, typename IDHandler> [[nodiscard]] constexpr It parse_arg_id(It begin, S end, IDHandler&& handler) { auto c = *begin; @@ -235,7 +235,7 @@ template S, typename IDHandler> return begin; } -template S, typename Handler> +template S, typename Handler> [[nodiscard]] constexpr It parse_sign(It begin, S end, Handler&& handler) { gsl_Expects(begin != end); @@ -258,7 +258,7 @@ template S, typename Handler> return begin; } -template S, typename Handler> +template S, typename Handler> [[nodiscard]] constexpr It parse_width(It begin, S end, Handler&& handler) { struct width_adapter { @@ -284,7 +284,7 @@ template S, typename Handler> return begin; } -template S, typename Handler> +template S, typename Handler> [[nodiscard]] constexpr It parse_precision(It begin, S end, Handler&& handler) { struct precision_adapter { @@ -312,7 +312,7 @@ template S, typename Handler> return begin; } -template +template constexpr int code_point_length(It begin) { if constexpr (sizeof(std::iter_value_t) != 1) return 1; @@ -327,7 +327,7 @@ constexpr int code_point_length(It begin) } // Parses fill and alignment. -template S, typename Handler> +template S, typename Handler> [[nodiscard]] constexpr It parse_align(It begin, S end, Handler&& handler) { gsl_Expects(begin != end); @@ -368,7 +368,7 @@ template S, typename Handler> // Parses standard format specifiers and sends notifications about parsed // components to handler. -template S, typename SpecHandler> +template S, typename SpecHandler> [[nodiscard]] constexpr It parse_format_specs(It begin, S end, SpecHandler&& handler) { if (begin + 1 < end && begin[1] == '}' && is_ascii_letter(*begin) && *begin != 'L') { diff --git a/src/core-fmt/include/units/format.h b/src/core-fmt/include/units/format.h index d820f60f..b7dbdf97 100644 --- a/src/core-fmt/include/units/format.h +++ b/src/core-fmt/include/units/format.h @@ -108,7 +108,7 @@ struct quantity_format_specs { }; // Parse a `units-rep-modifier` -template S, typename Handler> +template S, typename Handler> constexpr const It parse_units_rep(It begin, S end, Handler&& handler, bool treat_as_floating_point) { // parse sign @@ -143,7 +143,7 @@ constexpr const It parse_units_rep(It begin, S end, Handler&& handler, bool trea } // parse units-specs -template S, typename Handler> +template S, typename Handler> constexpr It parse_units_format(It begin, S end, Handler&& handler) { auto ptr = begin; @@ -276,13 +276,13 @@ struct quantity_formatter { out(o), val(std::move(q).number()), specs(fspecs), loc(std::move(lc)) {} - template S> + template S> void on_text(It begin, S end) { std::copy(begin, end, out); } - template S> + template S> void on_quantity_value([[maybe_unused]] It, [[maybe_unused]] S) { out = format_units_quantity_value(out, val, specs.rep, loc);