@@ -458,29 +458,34 @@ int main(void) {
458458<!-- {%endraw%}-->
459459</details >
460460<details >
461- <summary ><b >c_find, c_append, c_erase</b > - Container operations with custom predicate </summary >
461+ <summary ><b >c_find, c_reverse, c_append, c_erase</b > - Container/array operations</summary >
462462
463463### c_find_if, c_find_reverse_if
464464Find linearily in containers using a predicate. ` value ` is a pointer to each element in predicate.
465465*** outiter_ptr*** must be defined prior to call.
466- - ` c_find_if(CntType, cnt, outiter_ptr, pred) ` .
467- - ` c_find_if(CntType, startiter, enditer, outiter_ptr, pred) `
468- - ` c_find_reverse_if(CntType, cnt, outiter_ptr, pred) `
469- - ` c_find_reverse_if(CntType, startiter, enditer, outiter_ptr, pred) `
466+ - void ` c_find_if ` (** CntType** , cnt, outiter_ptr, pred).
467+ - void ` c_find_if ` (** CntType** , startiter, enditer, outiter_ptr, pred)
468+ - void ` c_find_reverse_if ` (** CntType** , cnt, outiter_ptr, pred)
469+ - void ` c_find_reverse_if ` (** CntType** , startiter, enditer, outiter_ptr, pred)
470+
471+ ### c_reverse, c_reverse_array
472+
473+ - void ` c_reverse ` (** CntType** , cnt); // reverse a cspan, vec, stack, queue or deque type.
474+ - void ` c_reverse_array ` (array, len); // reverse an array of elements.
470475
471476### c_append, c_append_if
472477Clones any container onto an arbitrary container type, optionally using a predicate to filter out elements.
473478Requires only that the element types are equal for the two containers.
474479` value ` is the pointer to each element in predicate. See example below for usage.
475- - ` c_append( CntType, outcnt_ptr, cnt) `
476- - ` c_append( OutCnt, outcnt_ptr, CntType, cnt) `
477- - ` c_append_if( CntType, outcnt_ptr, cnt, pred) `
478- - ` c_append_if( OutCnt, outcnt_ptr, CntType, cnt, pred) `
480+ - void ` c_append ` ( ** CntType** , outcnt_ptr, cnt)
481+ - void ` c_append ` ( ** OutCnt** , outcnt_ptr, ** CntType** , cnt)
482+ - void ` c_append_if ` ( ** CntType** , outcnt_ptr, cnt, pred)
483+ - void ` c_append_if ` ( ** OutCnt** , outcnt_ptr, ** CntType** , cnt, pred)
479484
480485### c_erase_if, c_eraseremove_if
481486Erase linearily in containers using a predicate. ` value ` is a pointer to each element in predicate.
482- - ` c_erase_if( CntType, cnt_ptr, pred) ` . Use with ** list** , ** hmap** , ** hset** , ** smap** , and ** sset** .
483- - ` c_eraseremove_if( CntType, cnt_ptr, pred) ` . Use with ** stack** , ** vec** , ** deque** , and ** queue** only.
487+ - void ` c_erase_if ` ( ** CntType** , cnt_ptr, pred)`. Use with *** list** , *** hmap*** , *** hset*** , *** smap*** , and *** sset* ** .
488+ - void ` c_eraseremove_if ` ( ** CntType** , cnt_ptr, pred)`. Use with *** stack*** , *** vec*** , *** deque*** , and *** queue* ** only.
484489
485490[ [ Run this code] ( https://godbolt.org/z/n7c641WhE ) ]
486491<!-- {%raw%}-->
@@ -552,9 +557,9 @@ int main(void)
552557
553558### c_all_of, c_any_of, c_none_of
554559Test a container/range using a predicate. ***result*** is output and must be declared prior to call.
555- - ` void c_all_of( CntType, cnt, bool* result, pred)`
556- - ` void c_any_of( CntType, cnt, bool* result, pred)`
557- - ` void c_none_of( CntType, cnt, bool* result, pred)`
560+ - void ` c_all_of`(** CntType** , cnt, bool* result, pred)
561+ - void ` c_any_of`(** CntType** , cnt, bool* result, pred)
562+ - void ` c_none_of`(** CntType** , cnt, bool* result, pred)
558563```c++
559564#define DivisibleBy(n) (*value % (n) == 0) // `value` refers to the current element
560565
@@ -636,10 +641,10 @@ int main(void) {
636641
637642### c_new, c_delete
638643
639- - `c_new( Type, value)` - Allocate *and initialize* a new object on the heap with *value*.
640- - `c_new_n( Type, n)` - Allocate an array of ***n*** new objects on the heap, initialized to zero.
641- - `c_delete( Type, ptr)` - *Type_drop(ptr)* and *c_free(ptr, ..)* allocated on the heap. NULL is OK.
642- - `c_delete_n( Type, arr, n)` - *Type_drop(&arr[i])* and *c_free(arr, ..)* of ***n*** objects allocated on the heap. (NULL, 0) is OK.
644+ - Type\* `c_new`(** Type** , value) - Allocate *and initialize* a new object on the heap with *value*.
645+ - Type\* `c_new_n`(** Type** , n) - Allocate an array of ***n*** new objects on the heap, initialized to zero.
646+ - void `c_delete`(** Type** , ptr) - *Type_drop(ptr)* and *c_free(ptr, ..)* allocated on the heap. NULL is OK.
647+ - void `c_delete_n`(** Type** , arr, n) - *Type_drop(&arr[i])* and *c_free(arr, ..)* of ***n*** objects allocated on the heap. (NULL, 0) is OK.
643648```c++
644649#include "stc/cstr.h"
645650
@@ -653,10 +658,10 @@ Memory allocator wrappers which uses signed sizes. Note that the signatures for
653658* c_realloc()* and * c_free()* have an extra size parameter. These will be used as
654659default in containers unless ` i_malloc ` , ` i_calloc ` , ` i_realloc ` , and ` i_free ` are user defined. See
655660[ Per container-instance customization] ( ../README.md#per-container-instance-customization )
656- - ` void* c_malloc(isize sz) `
657- - ` void* c_calloc(isize n, isize sz) `
658- - ` void* c_realloc(void* old_p, isize old_sz, isize new_sz) `
659- - ` void c_free(void* p, isize sz) `
661+ - void* ` c_malloc ` (isize sz)
662+ - void* ` c_calloc ` (isize n, isize sz)
663+ - void* ` c_realloc ` (void* old_p, isize old_sz, isize new_sz)
664+ - void ` c_free ` (void* p, isize sz)
660665
661666</details >
662667<details >
0 commit comments