aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-05-12 16:04:58 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-05-12 16:04:58 +0200
commit041b2137f7351abc8d648ed6a0399feaf331af08 (patch)
treebacb0dc720cab02e35cf67e9293a10a90a4bb07a
parent657a7161bd0fe58ee88e68bcb6b1c68d4f97f30a (diff)
Minor diagnostics change
-rw-r--r--libbutl/diagnostics.hxx19
1 files changed, 9 insertions, 10 deletions
diff --git a/libbutl/diagnostics.hxx b/libbutl/diagnostics.hxx
index cc83aef..b5ff1e6 100644
--- a/libbutl/diagnostics.hxx
+++ b/libbutl/diagnostics.hxx
@@ -141,27 +141,30 @@ namespace butl
template <typename B>
struct diag_prologue: B
{
+ const char* indent;
+ diag_epilogue* epilogue;
+
diag_prologue (const char* i = "\n ", diag_epilogue* e = nullptr)
- : B (), indent_ (i), epilogue_ (e) {}
+ : B (), indent (i), epilogue (e) {}
template <typename... A>
diag_prologue (A&&... a)
- : B (std::forward<A> (a)...), indent_ ("\n "), epilogue_ (nullptr) {}
+ : B (std::forward<A> (a)...), indent ("\n "), epilogue (nullptr) {}
template <typename... A>
diag_prologue (diag_epilogue* e, A&&... a)
- : B (std::forward<A> (a)...), indent_ ("\n "), epilogue_ (e) {}
+ : B (std::forward<A> (a)...), indent ("\n "), epilogue (e) {}
template <typename... A>
diag_prologue (const char* i, diag_epilogue* e, A&&... a)
- : B (std::forward<A> (a)...), indent_ (i), epilogue_ (e) {}
+ : B (std::forward<A> (a)...), indent (i), epilogue (e) {}
template <typename T>
diag_record
operator<< (const T& x) const
{
diag_record r;
- r.append (indent_, epilogue_);
+ r.append (indent, epilogue);
B::operator() (r);
r << x;
return r;
@@ -170,14 +173,10 @@ namespace butl
friend const diag_record&
operator<< (const diag_record& r, const diag_prologue& p)
{
- r.append (p.indent_, p.epilogue_);
+ r.append (p.indent, p.epilogue);
p (r);
return r;
}
-
- private:
- const char* indent_;
- diag_epilogue* epilogue_;
};
template <typename B>