C++17Generic ProgrammingLearn C++

Helpers for Generic C++ Code Accessing Container Properties

In addition to Helpers for Generic C++ Code Iterating Over Sequences the C++17 Standard Library provides the following helpers for writing generic code: #include <iterator> // new helpers of C++17 are defined here template<class Container> void foo(Container& c) { // Generic way to obtain: auto data = std::data(c); // - data; auto empty = std::empty(c); // - flag of…
Read more
C++C++11C++14C++17Iterators

Insert Iterators Adapters in C++

Let’s slightly modify the example from The Move Iterator Adapter in C++ post: #include <algorithm> #include <list> #include <string> #include <vector> /// @warning BUG! PLEASE, DON'T USE! auto deep_copy_to_list(const std::vector<std::string>& src) { std::list<std::string> dst; // constructs the empty list copy(cbegin(src), cend(src)…
Read more
C++C++11C++14C++17IteratorsLearn C++

Categories of Iterators in C++

Conceptually, iterators are consists of five categories: input iterator is intended to traverse sequences in the forward direction and provides the read access to the pointed sequence element;output iterator is intended to traverse sequences in the forward direction and provides the write access to the pointed sequence element;forward iterator is intended to traverse sequences in the forward…
Read more
C++C++11C++17Learn C++

Top C++ Compilers for Windows in 2020

If you are on the hunt for the best C/C++ compilers available today, this article lists the top C/C++ compilers for Windows with their features. It’s very hard, in fact, to identify which C++ compiler is the best for you, as this is mostly about what you want to achieve with your code. If you want to implement small projects for analysis and calculations without GUIs and many other features…
Read more