diff options
| author | Tyge Løvset <[email protected]> | 2021-03-24 20:10:44 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2021-03-24 20:10:44 +0100 |
| commit | 99bb129812e6fb830a05dd7f789987ba11f69b96 (patch) | |
| tree | cf847b83b1fd09ae012ceb1f6e8348b0db737e6b /docs/cpque_api.md | |
| parent | dba28f4d568439545785932ec273a1bc19abee24 (diff) | |
| download | STC-modified-99bb129812e6fb830a05dd7f789987ba11f69b96.tar.gz STC-modified-99bb129812e6fb830a05dd7f789987ba11f69b96.zip | |
Added valueCompare parameter to cpque.
Diffstat (limited to 'docs/cpque_api.md')
| -rw-r--r-- | docs/cpque_api.md | 12 |
1 files changed, 7 insertions, 5 deletions
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 <stc/cpque.h> -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 |
