aboutsummaryrefslogtreecommitdiff
path: root/bpkg/database.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'bpkg/database.hxx')
-rw-r--r--bpkg/database.hxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/bpkg/database.hxx b/bpkg/database.hxx
index 7ef2d40..684dc9d 100644
--- a/bpkg/database.hxx
+++ b/bpkg/database.hxx
@@ -754,6 +754,17 @@ namespace bpkg
return make_pair (base_type::emplace (end (), db, move (v)), true);
}
+
+ V&
+ operator[] (database& db)
+ {
+ iterator i (find (db));
+
+ if (i == end ())
+ i = base_type::emplace (end (), db, V ());
+
+ return i->second;
+ }
};
}