Writing your own C++ standard library, part 2
a year ago
- #Programming
- #C++
- #Standard Library
- The blog post discusses a self-written C++ standard library, clarifying it's not an ISO standard implementation but a collection of low-level functions.
- Debates arose over calling the C++ standard library 'STL', with some arguing it's incorrect while others, including implementers, use the term.
- The author simplifies container implementations by requiring types to be noexcept-movable, eliminating complexity for 'bad' types.
- For handling non-well-behaved types, suggestions include using unique_ptr or writing custom container code.
- The post explores different approaches to string splitting in C++, favoring a callback function for generality.
- A Python-like iteration protocol is implemented in C++ using optional<T>, though integration with native loops is challenging.
- The library includes basic functionality for strings, regexes, and containers, with fast compilation times.
- CTRE is used for regexes and is precompiled, marking the only 'cheat' in the project.