From 99bb129812e6fb830a05dd7f789987ba11f69b96 Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Wed, 24 Mar 2021 20:10:44 +0100 Subject: Added valueCompare parameter to cpque. --- docs/cpque_api.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'docs') diff --git a/docs/cpque_api.md b/docs/cpque_api.md index e2439c56..313a0e92 100644 --- a/docs/cpque_api.md +++ b/docs/cpque_api.md @@ -10,15 +10,17 @@ See the c++ class [std::priority_queue](https://en.cppreference.com/w/cpp/contai ```c #include -using_cpque(X, ctype, direction) +using_cpque(X, ctype); // default dir = `<` : max-heap +using_cpque(X, ctype, dir); // uses valueCompare from ctype +using_cpque(X, ctype, dir, valueCompare); ``` The macro `using_cpque()` must be instantiated in the global scope. **cpque** uses normally **cvec_X** -or **cdeq_X** as underlying implementation, specified as `ctype`. The *direction* must be given as +or **cdeq_X** as underlying implementation, specified as `ctype`. The *dir* must be given as `<` or `>`, specifying *max-heap* or *min-heap* for the priority queue. -Note that the function *`ctype`_value_compare(x, y)* defined by the underlying vector type is used to -compare values (priorities). `X` is a type tag name and will affect the names of all cpque types and methods. -Declaring `using_cpque(i, cvec_i, >)`, `X` should be replaced by `i` in the following documentation. +By default, the function *`ctype`_value_compare(x, y)* from the underlying vector type is used for +comparing values (priorities). `X` is a type tag name and will affect the names of all cpque types and methods. +When declaring `using_cpque(i, cvec_i)`, `X` should be replaced by `i` in the following documentation. ## Methods -- cgit v1.2.3