From 88640e677fa0695783eac68014d7d8d5bc42d117 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 19 Feb 2024 12:23:10 +0200 Subject: Add string_set buildfile value type This exposes the std::set type to buildfiles. New functions: $size() Subscript returns true if the value is present and false otherwise (so it is mapped to std::set::contains()). For example: set = [string_set] a b c if ($set[b]) ... Note that append (+=) and prepend (=+) have the same semantics (std::set::insert()). For example: set = [string_set] a b set += c b # a b c set =+ d b # a b c d Example of iteration: set = [string_set] a b c for k: $set ... --- libbuild2/variable.cxx | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libbuild2/variable.cxx') diff --git a/libbuild2/variable.cxx b/libbuild2/variable.cxx index 40eeccd..6f9f0fb 100644 --- a/libbuild2/variable.cxx +++ b/libbuild2/variable.cxx @@ -3292,6 +3292,8 @@ namespace build2 template struct LIBBUILD2_DEFEXPORT value_traits>>>; + template struct LIBBUILD2_DEFEXPORT value_traits>; + template struct LIBBUILD2_DEFEXPORT value_traits>; -- cgit v1.1