aboutsummaryrefslogtreecommitdiff
path: root/build2/function
diff options
context:
space:
mode:
Diffstat (limited to 'build2/function')
-rw-r--r--build2/function12
1 files changed, 11 insertions, 1 deletions
diff --git a/build2/function b/build2/function
index 68edcde..192c4a3 100644
--- a/build2/function
+++ b/build2/function
@@ -37,7 +37,8 @@ namespace build2
// T - statically-typed (value_traits<T> must be defined)
// names - untyped
// value - any type
- // T* - NULL-able argument (here T can be names, value).
+ // T* - NULL-able argument (here T can be names)
+ // value* - NULL-able any type (never NULL itself, use value::null)
// optional<T> - optional argument (here T can be T*, names, value)
//
// Optional arguments must be last. In case of a failure the function is
@@ -281,6 +282,15 @@ namespace build2
}
};
+ template <>
+ struct function_arg<value*>: function_arg<value>
+ {
+ static const bool null = true;
+
+ static value*
+ cast (value* v) {return v;} // NULL indicator in value::null.
+ };
+
template <typename T>
struct function_arg<optional<T>>: function_arg<T>
{