Working with lists #107
KenBarclay
started this conversation in
General
Replies: 2 comments
-
My fault! I had misinterpreted _get as a list indexing operator. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi, thanks for valuable reporting. I can see that _get() can be mistaken as an index operator [it does almost the same thing as _find() (linear search)]. I consider to deprecate it in vectors, deques and lists in V5.0 (but leave it in maps and sets). V5 is a huge upgrade and will be released as soon as I finish the documentation, some time in December. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Its really great to see a modern container library for C.
Thank you for your contribution.
I am new to STC (but not C). I have no experience of the STL,
so to find my way around STC I am running tests on the operations
supported by the containers that are of use to me.
The following test (from a suite of tests):
#include <stdio.h>
#include "ctest.h"
#define i_TYPE Ints, int // Container type (name, element type)
#define i_eq(a, b) (*a == *b)
#include "stc/list.h" // "instantiate" the desired container type
CTEST(vectest, insertAtOperation) {
Ints nums10 = c_init(Ints, {0, 1, 2, 3, 4, 5, 6, 7, 8, 9});
} // isEmptyOperation
produces the error:
TEST 5/6 vectest:insertAtOperation nums10: 0 1 2 99 3 4 5 6 7 8 9[FAIL]
ERR: listtests.c:81 assertion failed, 3 == 99
on the third (and fourth) ASSERT_EQ.
Can you explain what I have misunderstood?
Thanks, Ken
Beta Was this translation helpful? Give feedback.
All reactions