Improved Iterators with Ranges
There are more reasons to prefer ranges library above the classical Standard Template Library. The ranges iterators support unified lookup rules and provide additional safety guarantees.
This author has not written his bio yet.
But we are proud to say that Rainer Grimm contributed 689 entries already.
There are more reasons to prefer ranges library above the classical Standard Template Library. The ranges iterators support unified lookup rules and provide additional safety guarantees.
I will start my next mentoring program in 2023, right after the ending of the current mentoring program, “Fundamentals for C++ Professionals“. Now, you have to decide which mentoring program I should implement next.
The ranges library in C++20 supports sentinels. Sentinels stand for the end of a range and can be regarded as generalized end iterators.
The algorithms of the ranges library are lazy, can work directly on the container, and can easily be composed. But they have more to offer: projections. A projection is a mapping of a set into a subset. Let me show you in this post what that means:
Working with the Standard Template Library (STL) is much more comfortable and powerful thanks to the ranges library. The algorithms of the ranges library are lazy, can work directly on the container, and can quickly be composed. But there is more to it:
Concepts are a powerful and elegant tool to check at compile time if a type fulfills. Thanks to static_assert, you can use concepts as a standalone feature: static_assert(Concept<T>).
static_assert allows you to check at compile time if a type T fulfills the Concept: static_assert(Concept<T>).
In my last post “Defining Concepts with Requires Expressions“, I exemplified how you can use requires expressions to define concepts. Requires expressions can also be used as a standalone feature when a compile-time predicate is required.
In my last post, “Define Concepts“, I defined the concepts Integral, SignedIntegral, and UnsigendIntegral using logical combinations of existing concepts and compile-time predicates. Today, I use Requires Expressions to define concepts.
Why do the biggest and most profitable trading firms use C++? In this webinar we will address this question and present one of the most anticipated features of C++20 standard: Ranges.