From ed437dbd3483baa3d15d1d86d8f057d9112653b1 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 14 Aug 2019 14:36:44 +0300 Subject: Add support for default options files --- bpkg/types-parsers.txx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'bpkg/types-parsers.txx') diff --git a/bpkg/types-parsers.txx b/bpkg/types-parsers.txx index df6796f..f187fc7 100644 --- a/bpkg/types-parsers.txx +++ b/bpkg/types-parsers.txx @@ -65,5 +65,20 @@ namespace bpkg } } } + + template + void parser>:: + merge (qualified_option& b, const qualified_option& a) + { + for (const auto& o: a) + { + auto i (b.find (o.first)); + + if (i != b.end ()) + i->second = o.second; + else + b.emplace (o.first, o.second); + } + } } } -- cgit v1.1