diff --git a/include/fmt/base.h b/include/fmt/base.h index 35a483dd..7b678d7d 100644 --- a/include/fmt/base.h +++ b/include/fmt/base.h @@ -853,7 +853,7 @@ template class parse_context { using char_type = Char; using iterator = const Char*; - explicit constexpr parse_context(basic_string_view fmt, + constexpr explicit parse_context(basic_string_view fmt, int next_arg_id = 0) : fmt_(fmt), next_arg_id_(next_arg_id) {} @@ -1191,7 +1191,7 @@ class compile_parse_context : public parse_context { using base = parse_context; public: - explicit FMT_CONSTEXPR compile_parse_context(basic_string_view fmt, + FMT_CONSTEXPR explicit compile_parse_context(basic_string_view fmt, int num_args, const type* types, int next_arg_id = 0) : base(fmt, next_arg_id), num_args_(num_args), types_(types) {} @@ -1647,7 +1647,7 @@ class format_string_checker { public: template - explicit FMT_CONSTEXPR format_string_checker(basic_string_view fmt, + FMT_CONSTEXPR explicit format_string_checker(basic_string_view fmt, arg_pack) : types_{mapped_type_constant::value...}, named_args_{}, diff --git a/include/fmt/compile.h b/include/fmt/compile.h index b4a1c14b..68b451c7 100644 --- a/include/fmt/compile.h +++ b/include/fmt/compile.h @@ -45,7 +45,7 @@ struct is_compiled_string : std::is_base_of {}; template Str> struct udl_compiled_string : compiled_string { using char_type = Char; - explicit constexpr operator basic_string_view() const { + constexpr explicit operator basic_string_view() const { return {Str.data, N - 1}; } }; diff --git a/include/fmt/format.h b/include/fmt/format.h index 52d1be8e..9917f3d5 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -4039,16 +4039,16 @@ class format_int { } public: - explicit FMT_CONSTEXPR20 format_int(int value) : str_(format_signed(value)) {} - explicit FMT_CONSTEXPR20 format_int(long value) + FMT_CONSTEXPR20 explicit format_int(int value) : str_(format_signed(value)) {} + FMT_CONSTEXPR20 explicit format_int(long value) : str_(format_signed(value)) {} - explicit FMT_CONSTEXPR20 format_int(long long value) + FMT_CONSTEXPR20 explicit format_int(long long value) : str_(format_signed(value)) {} - explicit FMT_CONSTEXPR20 format_int(unsigned value) + FMT_CONSTEXPR20 explicit format_int(unsigned value) : str_(format_unsigned(value)) {} - explicit FMT_CONSTEXPR20 format_int(unsigned long value) + FMT_CONSTEXPR20 explicit format_int(unsigned long value) : str_(format_unsigned(value)) {} - explicit FMT_CONSTEXPR20 format_int(unsigned long long value) + FMT_CONSTEXPR20 explicit format_int(unsigned long long value) : str_(format_unsigned(value)) {} /// Returns the number of characters written to the output buffer. diff --git a/test/format-impl-test.cc b/test/format-impl-test.cc index 9645f832..1f2ef703 100644 --- a/test/format-impl-test.cc +++ b/test/format-impl-test.cc @@ -283,7 +283,7 @@ struct double_double { double a; double b; - explicit constexpr double_double(double a_val = 0, double b_val = 0) + constexpr explicit double_double(double a_val = 0, double b_val = 0) : a(a_val), b(b_val) {} operator double() const { return a + b; } @@ -299,7 +299,7 @@ bool operator>=(const double_double& lhs, const double_double& rhs) { struct slow_float { float value; - explicit constexpr slow_float(float val = 0) : value(val) {} + constexpr explicit slow_float(float val = 0) : value(val) {} operator float() const { return value; } auto operator-() const -> slow_float { return slow_float(-value); } }; diff --git a/test/scan.h b/test/scan.h index f6aaf4e3..8a58ea7b 100644 --- a/test/scan.h +++ b/test/scan.h @@ -211,7 +211,7 @@ class scan_parse_context { public: using iterator = string_view::iterator; - explicit FMT_CONSTEXPR scan_parse_context(string_view format) + FMT_CONSTEXPR explicit scan_parse_context(string_view format) : format_(format) {} FMT_CONSTEXPR auto begin() const -> iterator { return format_.begin(); } @@ -347,7 +347,7 @@ class scan_context { using iterator = detail::scan_iterator; using sentinel = detail::scan_sentinel; - explicit FMT_CONSTEXPR scan_context(detail::scan_buffer& buf, scan_args args) + FMT_CONSTEXPR explicit scan_context(detail::scan_buffer& buf, scan_args args) : buf_(buf), args_(args) {} FMT_CONSTEXPR auto arg(int id) const -> scan_arg {