libflow
range-v3
libflow | range-v3 | |
---|---|---|
5 | 19 | |
63 | 4,015 | |
- | - | |
4.1 | 4.0 | |
over 2 years ago | 10 days ago | |
C++ | C++ | |
Boost Software License 1.0 | GNU General Public License v3.0 or later |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
libflow
-
CXXIter: A chainable c++20 LINQ-like iterator library
Have you seen libflow? It's also built on the same model (Rust-style iterators), curious how they compare.
-
Modern C++ in Advent of Code
Just to get on the bandwagon: here are my C++20 Advent of Code solutions, mostly using my work-in-progress Flow library
-
T* makes for a poor optional<T&>
Perhaps relevant since Barry mentioned my Flow library as an example: the following (written a couple of years ago for another Reddit thread) is what would appear in Flow's documentation as a justification for using optional references -- if Flow actually had any documentation, that is...
-
Is it well defined if you pipe a stateful transform into views::drop?
If you want to use the Rust iterator model in C++, then you can do so.
-
What are coroutines even for?
I have a work-in-progress-for-a-long-time-now functional-style programming library called libflow, which uses Swift/Rust style iterators. It has optional support for coroutines ("flowroutines", heh) which can make writing "one-shot" iterators very simple indeed.
range-v3
-
Why are strings and IO so complicated?
std::ranges is in c++20, but you can pull in the library it was based on if you use 17 (https://github.com/ericniebler/range-v3)
-
Java Streams in c++
What you are describing seems to be std::ranges. If you’re interested in understanding how to implement it, I recommend checking out the original reference implementation, rangev3. Trying to implement your own ranges framework is really good practice for learning how to do efficient, advanced generic programming in C++. I highly recommend it as a hobby learning project. But it’s also really, really hard to do correctly, so please just use the stdlib and/or rangev3 in any real project.
-
What are some of the ways to make a super nasty nested loop become clean?
In C++23, there will be std::views::cartesian_product. It is already available in the range-v3 library, the one that the standard is based on.
- 295 pages on Initialization in Modern C++ :)
-
Function composition in modern C++
/** * @brief Forwards value equivalent to the std::forward. * * Using cast instead of std::forward to avoid template instantiation. Used by * Eric Niebler in range library. * * @see https://github.com/ericniebler/range-v3 */
- PocketPy: A Lightweight(~5000 LOC) Python Implementation in C++17
-
Is there an <algorithm> way to filter + transform multiple containers at once
It uses a custom zip_iterator (which isn't very good, and you should really use the one from boost or from range-v3).
-
what annoys you most while using c++?
It contains very little functionality compared to the Eric Niebler’s reference implementation for my liking. Especially views. This will undoubtedly change in the future. But the point is moot, because they are not really supported the is no other option for now other than https://github.com/ericniebler/range-v3.
-
C++20 Ranges Algorithms – 7 Non-Modifying Operations
range-v3 is a great library allowing you to bridge the gap: https://github.com/ericniebler/range-v3
-
CXXIter: A chainable c++20 LINQ-like iterator library
[range-v3](https://github.com/ericniebler/range-v3) which std::ranges was based on has the `to>()` which as far as I know is expected to get into c++23 :)
What are some alternatives?
zab - C++20 liburing backed coroutine executor and event loop framework.
Boost.Asio - Asio C++ Library
scnlib - scanf for modern C++
cppitertools - Implementation of python itertools and builtin iteration functions for C++17
AdventOfCode2021 - Solutions to all 25 AoC 2021 problems in Rust :crab: Less than 100 lines per day and under 1 second total execution time! :christmas_tree:
CppCoreGuidelines - The C++ Core Guidelines are a set of tried-and-true guidelines, rules, and best practices about coding in C++
CPython - The Python programming language
HCSR04 - Arduino library for HC-SR04, HC-SRF05, DYP-ME007, BLJ-ME007Y, JSN-SR04T ultrasonic ranging sensor
advent-of-code-2021 - 🦀 Rust solutions to AoC 2021
RE2 - RE2 is a fast, safe, thread-friendly alternative to backtracking regular expression engines like those used in PCRE, Perl, and Python. It is a C++ library.
cpplinq - LINQ for C++ (cpplinq) is an extensible C++11 library of higher-order functions for range manipulation. cpplinq draws inspiration from LINQ for C#.
strong_type - An additive strong typedef library for C++14/17/20