这是indexloc提供的服务,不要输入任何密码
Skip to content

non-type template argument is not a constant expression #2472

@YourFantasy

Description

@YourFantasy

/opt/homebrew/include/fmt/base.h:1209:15: note: candidate template ignored: requirement 'is_named_arg<folly::Range<const char *>>::value' was not satisfied [with T = folly::Range<const char *>]
1209 | static auto map(const T& named_arg) -> decltype(map(named_arg.value));
| ^
/opt/homebrew/include/fmt/base.h:2815:30: error: non-type template argument is not a constant expression
2815 | detail::make_descriptor<context, T...>()>;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/homebrew/include/fmt/format.h:4200:27: note: in instantiation of template type alias 'vargs' requested here
4200 | return vformat(fmt.str, vargs<T...>{{args...}});
| ^
/Users/chen/Desktop/c++/day02/build/_deps/folly-src/folly/IPAddress.cpp:123:43: note: in instantiation of function template specialization 'fmt::format<const folly::Range<const char *>, unsigned long>' requested here
123 | throw IPAddressFormatException(fmt::format(

template <typename... T>
using vargs =
detail::format_arg_store<context, sizeof...(T),
detail::count_named_args<T...>(),
detail::make_descriptor<context, T...>()>;

template <typename... T>
FMT_NODISCARD FMT_INLINE auto format(format_string<T...> fmt, T&&... args)
-> std::string {
return vformat(fmt.str, vargs<T...>{{args...}});
}

throw IPAddressFormatException(fmt::format(
"CIDR value '{}' is > network bit count '{}'",
vec.size() == 2 ? vec.at(1) : to(cidr),
subnet.bitCount()));

non-type template argument is not a constant expression

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions