diff --git a/include/fmt/base.h b/include/fmt/base.h index 5868f332..d10242c5 100644 --- a/include/fmt/base.h +++ b/include/fmt/base.h @@ -1292,7 +1292,7 @@ class compile_parse_context : public parse_context { using base::check_arg_id; FMT_CONSTEXPR void check_dynamic_spec(int arg_id) { - detail::ignore_unused(arg_id); + ignore_unused(arg_id); if (arg_id < num_args_ && types_ && !is_integral_type(types_[arg_id])) report_error("width/precision is not integer"); } @@ -2022,7 +2022,7 @@ class container_buffer : public buffer { template class iterator_buffer< OutputIt, - enable_if_t::value && + enable_if_t::value && is_contiguous::value, typename OutputIt::container_type::value_type>> : public container_buffer { diff --git a/include/fmt/format.h b/include/fmt/format.h index b84004ef..60ec1f7d 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -709,7 +709,7 @@ FMT_CONSTEXPR inline auto compute_width(string_view s) -> size_t { struct count_code_points { size_t* count; FMT_CONSTEXPR auto operator()(uint32_t cp, string_view) const -> bool { - *count += detail::to_unsigned( + *count += to_unsigned( 1 + (cp >= 0x1100 && (cp <= 0x115f || // Hangul Jamo init. consonants @@ -4113,6 +4113,12 @@ struct formatter detail::type::float_type> {}; inline namespace literals { +#if FMT_USE_NONTYPE_TEMPLATE_ARGS +template constexpr auto operator""_a() { + using char_t = remove_cvref_t; + return detail::udl_arg(); +} +#else /** * User-defined literal equivalent of `fmt::arg`. * @@ -4121,16 +4127,10 @@ inline namespace literals { * using namespace fmt::literals; * fmt::print("The answer is {answer}.", "answer"_a=42); */ -#if FMT_USE_NONTYPE_TEMPLATE_ARGS -template constexpr auto operator""_a() { - using char_t = remove_cvref_t; - return detail::udl_arg(); -} -#else constexpr auto operator""_a(const char* s, size_t) -> detail::udl_arg { return {s}; } -#endif +#endif // FMT_USE_NONTYPE_TEMPLATE_ARGS } // namespace literals /// A fast integer formatter. @@ -4188,7 +4188,7 @@ class format_int { } /// Returns the content of the output buffer as an `std::string`. - auto str() const -> std::string { return std::string(str_, size()); } + auto str() const -> std::string { return {str_, size()}; } }; FMT_BEGIN_EXPORT