aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bpkg/diagnostics25
1 files changed, 25 insertions, 0 deletions
diff --git a/bpkg/diagnostics b/bpkg/diagnostics
index d1183d2..85eef2b 100644
--- a/bpkg/diagnostics
+++ b/bpkg/diagnostics
@@ -263,6 +263,18 @@ namespace bpkg
return location_prologue (type_, name_, get_location (l, data_));
}
+ template <typename F, typename L, typename C>
+ location_prologue
+ operator() (F&& f, L&& l, C&& c) const
+ {
+ return location_prologue (
+ type_,
+ name_,
+ location (std::forward<F> (f),
+ std::forward<L> (l),
+ std::forward<C> (c)));
+ }
+
protected:
const char* type_;
const char* name_;
@@ -315,6 +327,19 @@ namespace bpkg
&epilogue, "error", nullptr, get_location (l, data_));
}
+ template <typename F, typename L, typename C>
+ location_prologue
+ operator() (F&& f, L&& l, C&& c) const
+ {
+ return location_prologue (
+ &epilogue,
+ "error",
+ nullptr,
+ location (std::forward<F> (f),
+ std::forward<L> (l),
+ std::forward<C> (c)));
+ }
+
static void
epilogue (const diag_record&) {throw E ();}