From c0743592bfae808b61a8146fd97af94b50156f0e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 12 Nov 2019 12:20:34 +0200 Subject: Add support for vector> variable values --- libbuild2/variable.hxx | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'libbuild2/variable.hxx') diff --git a/libbuild2/variable.hxx b/libbuild2/variable.hxx index 6a2c681..3389a8e 100644 --- a/libbuild2/variable.hxx +++ b/libbuild2/variable.hxx @@ -954,6 +954,33 @@ namespace build2 static const value_type_ex value_type; }; + // vector> + // + template + struct value_traits>> + { + static_assert (sizeof (vector>) <= value::size_, + "insufficient space"); + + static void assign (value&, vector>&&); + static void append (value&, vector>&&); + static void prepend (value& v, vector>&& x) { + return append (v, move (x));} + static bool empty (const vector>& x) {return x.empty ();} + + static const vector> empty_instance; + + // Make sure these are static-initialized together. Failed that VC will + // make sure it's done in the wrong order. + // + struct value_type_ex: build2::value_type + { + string type_name; + value_type_ex (value_type&&); + }; + static const value_type_ex value_type; + }; + // map // template @@ -995,6 +1022,9 @@ namespace build2 extern template struct LIBBUILD2_DECEXPORT value_traits; extern template struct LIBBUILD2_DECEXPORT + value_traits>>; + + extern template struct LIBBUILD2_DECEXPORT value_traits>; extern template struct LIBBUILD2_DECEXPORT -- cgit v1.1