From 2f8850ea8605354ec7d8fcc133ed54da36d5adf6 Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Mon, 8 Jun 2020 23:05:26 +0300 Subject: [PATCH] utils/sexp: add a bit more convenience --- lib/utils/mu-sexp.hh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/utils/mu-sexp.hh b/lib/utils/mu-sexp.hh index b2aad10f..cf73b322 100644 --- a/lib/utils/mu-sexp.hh +++ b/lib/utils/mu-sexp.hh @@ -90,12 +90,15 @@ struct Node { if (name.empty() || name[0] != ':') throw Error{Error::Code::InvalidArgument, - "property names must start with ':'"}; + "property names must start with ':' ('%s')", + name.c_str()}; add(make_symbol(std::move(name))); add(std::move(val)); } - + void add_prop(std::string&& name, const std::string& val) { + add_prop(std::move(name), std::string(val)); + } // deliberately limited stl-like