mirror of
https://github.com/fmtlib/fmt.git
synced 2024-11-08 12:20:06 +00:00
Make constexpr precede explicit consistently
This commit is contained in:
parent
e3d3b24fc1
commit
8523dba2dc
@ -853,7 +853,7 @@ template <typename Char = char> class parse_context {
|
||||
using char_type = Char;
|
||||
using iterator = const Char*;
|
||||
|
||||
explicit constexpr parse_context(basic_string_view<Char> fmt,
|
||||
constexpr explicit parse_context(basic_string_view<Char> 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<Char> {
|
||||
using base = parse_context<Char>;
|
||||
|
||||
public:
|
||||
explicit FMT_CONSTEXPR compile_parse_context(basic_string_view<Char> fmt,
|
||||
FMT_CONSTEXPR explicit compile_parse_context(basic_string_view<Char> 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 <typename... T>
|
||||
explicit FMT_CONSTEXPR format_string_checker(basic_string_view<Char> fmt,
|
||||
FMT_CONSTEXPR explicit format_string_checker(basic_string_view<Char> fmt,
|
||||
arg_pack<T...>)
|
||||
: types_{mapped_type_constant<T, Char>::value...},
|
||||
named_args_{},
|
||||
|
@ -45,7 +45,7 @@ struct is_compiled_string : std::is_base_of<compiled_string, S> {};
|
||||
template <typename Char, size_t N, fmt::detail::fixed_string<Char, N> Str>
|
||||
struct udl_compiled_string : compiled_string {
|
||||
using char_type = Char;
|
||||
explicit constexpr operator basic_string_view<char_type>() const {
|
||||
constexpr explicit operator basic_string_view<char_type>() const {
|
||||
return {Str.data, N - 1};
|
||||
}
|
||||
};
|
||||
|
@ -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.
|
||||
|
@ -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); }
|
||||
};
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user