60 Commits
Author SHA1 Message Date
Patrick Pelissier 8f67ca339b Rename internal macros. 2018-09-13 22:59:38 +02:00
Patrick Pelissier 1679b7b5cf Mark ALGO_INIT_VA & ALGO_LET_INIT_VA as obsolete:
the M_LET macro supports their feature in a more generic way.
2018-09-10 22:57:52 +02:00
Patrick Pelissier 757049543d Port to M_CALL infrastructure the M-ALGO 2018-09-10 22:50:26 +02:00
Patrick Pelissier c506443ed0 Add comment about ALGO_EXTRACT 2018-08-08 22:54:56 +02:00
Patrick Pelissier 5f42f26587 Fix warning about shadowed variables 2018-08-08 22:49:49 +02:00
Patrick Pelissier ede57a20be Add ALGO ALGO_INSERT that allows inserting a container into another one. 2018-08-08 22:44:17 +02:00
Patrick Pelissier 92d7009804 Fis issue if given type is a T * = TYPE:
token pasting created const T *, which is not the same as
const TYPE = T * const
2018-08-03 20:35:37 +02:00
Patrick Pelissier 79158dabbc Rename _map into _for_each. 2018-07-22 21:32:46 +02:00
Patrick Pelissier 4aca0664ef Add methods _find_again, _find_again_if, _mismatch_again and _mismatch_again_if 2018-07-15 23:06:22 +02:00
Patrick Pelissier 6721a86768 Add method _mismatch and _mismatch_if 2018-07-15 22:34:29 +02:00
Patrick Pelissier fcdfd836ec Add method _count_if 2018-07-15 11:05:58 +02:00
Patrick Pelissier b2f005239b API breakage:
rename _constains into _contain_p
to be more uniform with other predicate functions,
and to use infinitive form for the method.
2018-07-15 10:54:38 +02:00
Patrick Pelissier bc3fa890bd Add method _find_if. 2018-07-15 10:48:22 +02:00
Patrick Pelissier 22f2ae7341 Add methods _all_of_p, _any_of_p and _none_of_p. 2018-07-14 18:21:46 +02:00
Patrick Pelissier 96202aa78f Do not use reserved identifiers of the C standard (See 7.1.3 Reserved identifiers) 2018-07-14 14:35:14 +02:00
Patrick Pelissier e696192ef7 Update comments.
Cosmetic change.
2018-05-31 23:09:11 +02:00
Patrick Pelissier 38cd8847a2 Adding a generic merge sort if container has both _splice_back & _splice_at
methods
2018-05-28 23:51:41 +02:00
Patrick Pelissier 64d0202f95 ALGO macros accept now a type instead of an oplist
if a global oplist has been registered for the type.

Add macro ALGO_LET_INIT_VA which declares, initializes, sets and clears
a container.
2018-05-22 20:39:51 +02:00
Patrick Pelissier 45263a6261 Fix parenthesis 2018-05-20 18:07:58 +02:00
Patrick Pelissier 482e1631fa Remove warning in case of some kind of type
(Famous problem of C not allowing to cast
a T (*)[N] into a const T (*)[N].
2018-05-19 12:51:31 +02:00
Patrick Pelissier 717268add9 Simplify the macro usage. 2018-05-19 11:09:20 +02:00
Patrick Pelissier fc4dba4569 Add DSC versions of the _sort function to reverve the sort (DSC=descending). 2018-05-14 23:08:46 +02:00
Patrick Pelissier 1d8df98339 Rename undocumented methods _union & _intersect to _sort_union & _sort_intersect
as they depend on the sort order.
2018-05-14 22:58:52 +02:00
Patrick Pelissier 745aabcfd5 Factorisation of all calls to GET_CMP within the sort functions
to a single function.
2018-05-14 22:55:17 +02:00
Patrick Pelissier be100790f1 Uniformize the comparaisons to always be in the same order. 2018-05-14 22:51:07 +02:00
Patrick Pelissier afc5e82906 Externalize _sort generation from the main macro. 2018-05-14 22:49:11 +02:00
Patrick Pelissier 6f12ac1d19 Update comments & add new assertions 2018-02-27 22:32:03 +01:00
Patrick Pelissier 210e05f7fc Update copyright to 2018 2018-01-29 20:28:30 +01:00
Patrick Pelissier 2e564088b0 Simplify the inclusion of headers. 2017-09-16 10:14:45 +02:00
Patrick Pelissier 52f4f35e64 Simplification 2017-09-11 23:24:19 +02:00
Patrick Pelissier ccaf183940 Fix prototypes of new functions. 2017-08-16 23:44:38 +02:00
Patrick Pelissier 099cbab9cf Add new algo _intersect. 2017-08-14 20:34:58 +02:00
Patrick Pelissier 9ff0831430 WIP for union 2017-08-14 20:22:50 +02:00
Patrick Pelissier dfa328a597 Update prototype of reduce callbacks. 2017-07-15 20:45:24 +02:00
Patrick Pelissier dfc05266c4 Update comment. 2017-07-15 19:41:46 +02:00
Patrick Pelissier 99df2a9a67 Reformat & add const to functions as iterator now accept const container. 2017-07-15 19:36:15 +02:00
Patrick Pelissier 9b13a0e925 Remove TODO 2017-07-11 22:30:28 +02:00
Patrick Pelissier 4f7755bc95 Add method _uniq for algo 2017-05-22 19:26:06 +02:00
Patrick Pelissier f14e5222ad Add _sort_p algorithm 2017-05-22 18:22:11 +02:00
Patrick Pelissier 856fd4fd78 Add specialisation of _find_last if the container has the IT_PREVIOUS & IT_LAST operators. 2017-05-11 00:18:26 +02:00
Patrick Pelissier 1925c90812 Optimize _map_reduce. 2017-05-03 00:57:05 +02:00
Patrick Pelissier 5304958860 Add TODO / improve comments. 2017-05-03 00:51:59 +02:00
Patrick Pelissier 75db40a4ff Fix prototype of _reduce : dest may not be an array. It is therefore
needed to pass a pointer.

Add _map_reduce method.
2017-04-26 23:46:49 +02:00
Patrick Pelissier d092416729 Add reference 2017-04-03 21:18:03 +02:00
Patrick Pelissier 8acf76c692 Update comments 2017-03-27 14:27:01 +02:00
Patrick Pelissier 00b9ee045c Add it_set, it_from & it_to_p operators. 2017-03-21 23:16:51 +01:00
Patrick Pelissier 866e76d316 Add some comments. 2017-03-19 23:31:43 +01:00
Patrick Pelissier 3bd0744333 Add ALGO_INIT_VA macro. 2017-03-19 19:46:09 +01:00
Patrick Pelissier 34a1b4533b Write find_last algo. 2017-03-13 10:33:39 +01:00
Patrick Pelissier 03eaceaf35 Add generic add, mul, sub & div over containers. 2017-03-04 23:51:00 +01:00