aboutsummaryrefslogtreecommitdiff
path: root/build2/variable.hxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2018-07-26 14:12:56 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2018-07-30 13:04:37 +0300
commitd90ac405ae50f84a3cf4ba0b806cca1c89f81cff (patch)
tree3f66be39a80a0a32cbba332e34b418fa1fc9ad02 /build2/variable.hxx
parente92a1aab0e1c7c9ba8e6ab9a7049207468ca53fc (diff)
Make project variable to be of project_name type
Diffstat (limited to 'build2/variable.hxx')
-rw-r--r--build2/variable.hxx22
1 files changed, 21 insertions, 1 deletions
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<project_name>
+ {
+ 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<T>
//
template <typename T>