From 6ff1cf35f78a24d52603d84eac9349b3d4670c6c Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 20 Feb 2024 09:37:50 +0200 Subject: Make json value type prepend non-overriding for consistency with map --- libbuild2/variable.hxx | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libbuild2/variable.hxx') diff --git a/libbuild2/variable.hxx b/libbuild2/variable.hxx index b157806..d754edf 100644 --- a/libbuild2/variable.hxx +++ b/libbuild2/variable.hxx @@ -1237,6 +1237,12 @@ namespace build2 // of what looks like harmless looseness in a few contexts (such as the // $json.member_*() functions). // + // Note that similar to map, JSON object append/+= is overriding while + // prepend/=+ is not. In a sense, whatever appears last (from left to right) + // is kept, which is consistent with what we expect to happen when + // specifying the same name repeatedly (provided it's not considered + // invalid) in a representation (e.g., {"a":1,"a":2}). + // template <> struct LIBBUILD2_SYMEXPORT value_traits { -- cgit v1.1