From 8205a652a4616aea84f24ff31235ea9941f47db6 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 7 Mar 2017 10:24:02 +0200 Subject: Specify config.test.output variable --- build2/variable.ixx | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'build2/variable.ixx') diff --git a/build2/variable.ixx b/build2/variable.ixx index dfe5c84..8656a04 100644 --- a/build2/variable.ixx +++ b/build2/variable.ixx @@ -490,10 +490,26 @@ namespace build2 new (&v.data_) name (move (x)); } - inline int value_traits:: - compare (const name& l, const name& r) + // name_pair value + // + inline void value_traits:: + assign (value& v, name_pair&& x) { - return l.compare (r); + if (v) + v.as () = move (x); + else + new (&v.data_) name_pair (move (x)); + } + + inline int value_traits:: + compare (const name_pair& x, const name_pair& y) + { + int r (x.first.compare (y.first)); + + if (r == 0) + r = x.second.compare (y.second); + + return r; } // process_path value -- cgit v1.1