From d90ac405ae50f84a3cf4ba0b806cca1c89f81cff Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 26 Jul 2018 14:12:56 +0300 Subject: Make project variable to be of project_name type --- build2/variable.hxx | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'build2/variable.hxx') diff --git a/build2/variable.hxx b/build2/variable.hxx index f9b8b3c..401cc77 100644 --- a/build2/variable.hxx +++ b/build2/variable.hxx @@ -820,7 +820,6 @@ namespace build2 static const build2::value_type value_type; }; - // target_triplet // template <> @@ -841,6 +840,27 @@ namespace build2 static const build2::value_type value_type; }; + // project_name + // + template <> + struct value_traits + { + static_assert (sizeof (project_name) <= value::size_, + "insufficient space"); + + static project_name convert (name&&, name*); + static void assign (value&, project_name&&); + static name reverse (const project_name& x) {return name (x.string ());} + static int compare (const project_name& x, const project_name& y) { + return x.compare (y);} + static bool empty (const project_name& x) {return x.empty ();} + + static const bool empty_value = true; + static const project_name& empty_instance; + static const char* const type_name; + static const build2::value_type value_type; + }; + // vector // template -- cgit v1.1