aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/utility.txx
diff options
context:
space:
mode:
Diffstat (limited to 'libbuild2/utility.txx')
-rw-r--r--libbuild2/utility.txx21
1 files changed, 17 insertions, 4 deletions
diff --git a/libbuild2/utility.txx b/libbuild2/utility.txx
index d2fc29c..cdf510f 100644
--- a/libbuild2/utility.txx
+++ b/libbuild2/utility.txx
@@ -5,16 +5,16 @@ namespace build2
{
template <typename I, typename F>
void
- append_option_values (cstrings& args, const char* o, I b, I e, F&& get)
+ append_option_values (cstrings& ss, const char* o, I b, I e, F&& get)
{
if (b != e)
{
- args.reserve (args.size () + (e - b));
+ ss.reserve (ss.size () + (e - b));
for (; b != e; ++b)
{
- args.push_back (o);
- args.push_back (get (*b));
+ ss.push_back (o);
+ ss.push_back (get (*b));
}
}
}
@@ -30,6 +30,19 @@ namespace build2
}
}
+ template <typename I, typename F>
+ void
+ append_combined_option_values (strings& ss, const char* o, I b, I e, F&& get)
+ {
+ if (b != e)
+ {
+ ss.reserve (ss.size () + (e - b));
+
+ for (; b != e; ++b)
+ ss.push_back (string (o) += get (*b));
+ }
+ }
+
template <typename K>
basic_path<char, K>
relative (const basic_path<char, K>& p)