diff options
| author | Tylo <[email protected]> | 2020-06-22 16:10:08 +0200 |
|---|---|---|
| committer | Tylo <[email protected]> | 2020-06-22 16:10:08 +0200 |
| commit | a1cb09cf8a04e98aaf0cd073083e868227f10005 (patch) | |
| tree | 64c45abcd382b6abae617837a35fc5fed8490076 | |
| parent | 77fc633479859d149d957d59d21e4ae69426fe5b (diff) | |
| download | STC-modified-a1cb09cf8a04e98aaf0cd073083e868227f10005.tar.gz STC-modified-a1cb09cf8a04e98aaf0cd073083e868227f10005.zip | |
Removed some unneeded example code in header.
| -rw-r--r-- | stc/clist.h | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/stc/clist.h b/stc/clist.h index cd00479b..9b1c37f1 100644 --- a/stc/clist.h +++ b/stc/clist.h @@ -29,17 +29,13 @@ This implements a std::forward_list-like class in C, but because it is circular, it also support push* and splice* at both ends of the list. This makes it ideal - for being used as a queue, unlike std::forward_list's push_front/pop_front only. - Basic usage is similar to CVector: + for being used as a queue, unlike std::forward_list. Basic usage is similar to CVector: #include "stc/clist.h" - #omclude "stc/cstring.h" declare_CList(i, int64_t); - declare_CList_string(s); int main() { CList_i list = clist_init; - CList_s slist = clist_init; int n; for (int i=0; i<1000000; ++i) // one million clist_i_pushBack(&list, rand() * rand()); @@ -52,24 +48,8 @@ c_foreach (i, clist_i, list) if (++n % 10000 == 0) printf("%d: %zd\n", n, i.item->value); clist_i_destroy(&list); - - // Test CList with CStrings - clist_s_pushBack(&slist, cstring_make("Item 1")); - clist_s_pushBack(&slist, cstring_make("Item 2")); - clist_s_pushBack(&slist, cstring_make("Item X")); - clist_s_pushBack(&slist, cstring_make("Item 3")); - puts(""); - c_foreach (i, clist_s, slist) - printf("%s\n", i.item->value.str); - // Modify - clist_s_pushFront(&slist, cstring_make("Item 0")); - clist_s_remove(&slist, "Item X"); - puts(""); - c_foreach (i, clist_s, slist) - printf("%s\n", i.item->value.str); - clist_s_destroy(&slist); } - */ +*/ #define declare_CList(...) c_MACRO_OVERLOAD(declare_CList, __VA_ARGS__) |
