STC
STC copied to clipboard
A modern, user friendly, generic, type-safe and fast C99 container library: String, Vector, Sorted and Unordered Map and Set, Deque, Forward List, Smart Pointers, Bitset and Random numbers.
This is an attempt at resolving #83 **Upside:** Allows ranges to be typed. **Downside:** Requires typing the range type name four times (in using_crange, to declare the range, to initialize...
06a0342bba5da29739505016604b3ec672a809c5 in the [v50dev](https://github.com/stclib/STC/tree/v50dev) branch makes it undefined behavior to drop or clone a null arc or box. By my understanding this means to write a struct that is zero-initializable...
#### Issue Description: I've encountered a compilation issue when using the STC library, particularly in contexts where compound literals are utilized. The library documentation suggests compatibility with C and C++...
## Feature I'd like for `crange` and `c_forrange` to take custom types like the STC containers. ## Rationale There are too many lost optimization opportunities by having everything be intptr_t...
Hi Thank you for building this, it is a lovely library. As I had just starting out to learning C (I know Rust, Go, Python and TypeScript), I am curious...
According to docs `stack_X_top` should return a mutable reference: https://github.com/stclib/STC/blob/b51f14989fccef6d15c45efa67d428c59652c882/docs/stack_api.md?plain=1#L45 but it actually returns a const reference: https://github.com/stclib/STC/blob/b51f14989fccef6d15c45efa67d428c59652c882/include/stc/stack.h#L120-L121 and there is no `_mut` variant for said function. Is `const` just...
Fixes #93 This pull request addresses an issue where `cbits_resize()` could overwrite the existing data stored in a buffer entry if the cbits object is resized down from a buffer...
I have noticed what appears to be undesired behavior in the `cbits_resize()` function. When resizing a cbits object from a size aligned with a buffer entry (such as 64) down...
I have noticed that the closing `#endif` for the include guard in `cbits.h` (`#ifndef STC_CBITS_H_INCLUDED`) terminates on line 128 instead of closer to the end of the file. There are...
in C++, the `std::string::npos` is -1, so someone may write: ```cpp string s = "test"; int i = s.find('e'); if (i >= 0) // same as `i != std::string::npos` cout