23#include <fruit/fruit.h>
32 static void PrintAll(
const std::vector<DiagnosticInformation*>&);
35template <
auto Fn,
typename R,
typename...
Args>
39 :
args_(std::forward_as_tuple(args...)) {}
41 std::vector<std::string>
Diagnostics()
const override {
42 if constexpr (std::is_same_v<R, std::vector<std::string>>) {
43 return std::apply(Fn,
args_);
44 }
else if constexpr (std::is_same_v<R, std::string>) {
45 return {std::apply(Fn,
args_)};
47 static_assert(
false,
"Unexpected AutoDiagnostic return type");
55template <auto Fn1,
typename Fn2>
58template <
auto Fn,
typename R,
typename...
Args>
62 static fruit::Component<
63 fruit::Required<typename std::remove_reference_t<Args>...>,
Type>
65 return fruit::createComponent()
66 .template addMultibinding<DiagnosticInformation, Type>();
Definition: alloc_utils.cpp:23
std::vector< std::string_view > Args
Definition: incremental.h:28