From 10e634e64b5fffaf19778d8fd3aa854118aa0d53 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 3 Nov 2021 13:08:48 +0200 Subject: Add $size() function to get size of sequence (names, strings, etc) --- libbuild2/functions-string.cxx | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libbuild2/functions-string.cxx') diff --git a/libbuild2/functions-string.cxx b/libbuild2/functions-string.cxx index 6e39c44..18a4ed6 100644 --- a/libbuild2/functions-string.cxx +++ b/libbuild2/functions-string.cxx @@ -77,6 +77,12 @@ namespace build2 return names {name (ucase (convert (move (s))))}; }; + // $size() + // + // Return the number of elements in the sequence. + // + f["size"] += [] (strings v) {return v.size ();}; + // $sort( [, ]) // // Sort strings in ascending order. -- cgit v1.1