aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/function.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-03-17 07:33:41 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-03-17 07:47:17 +0200
commitbab021a6203127f38fb89c61cc41deb3e0abbe62 (patch)
tree868ddce415b985636baed5dd566ec4bd11f67c99 /libbuild2/function.hxx
parent962f83b1e551cc683f1052d32cb79b969e65af5f (diff)
Add $defined(<variable>) function
Diffstat (limited to 'libbuild2/function.hxx')
-rw-r--r--libbuild2/function.hxx11
1 files changed, 10 insertions, 1 deletions
diff --git a/libbuild2/function.hxx b/libbuild2/function.hxx
index ce47bd9..b745173 100644
--- a/libbuild2/function.hxx
+++ b/libbuild2/function.hxx
@@ -32,7 +32,7 @@ namespace build2
// as arguments. There is also higher-level, more convenient support for
// defining functions as pointers to functions (including capture-less
// lambdas), pointers to member functions (e.g., string::size()), or
- // pointers to data members (e.g., name::type). In this case the build2
+ // pointers to data members (e.g., name::type). In this case the buildfile
// function types are automatically matched to C++ function types according
// to these rules:
//
@@ -43,6 +43,15 @@ namespace build2
// value* - NULL-able any type (never NULL itself, use value::null)
// optional<T> - optional argument (here T can be T*, names, value)
//
+ // The overload resolution is pretty simple: we sort all the candidates into
+ // three ranks:
+ //
+ // 0 -- all the arguments match exactly (perfect match)
+ // 1 -- one or more arguments match via the derived-to-base conversion
+ // 2 -- one or more arguments match via the reversal to untyped
+ //
+ // More than one match of the same rank is ambiguous.
+ //
// Optional arguments must be last. In case of a failure the function is
// expected to issue diagnostics and throw failed. Note that the arguments
// are conceptually "moved" and can be reused by the implementation.