Tag Archives for " inserter "

Lower and Upper Bound Insert Iterators

Published December 27, 2019 - 0 Comments

This is a guest post by Anton Vodostoev. Anton is a C++ developer and follower of Fluent C++. I liked the idea of creating different types of smart iterators when reading the articles “About Smart Output Iterators” by Jonathan. One of them suggested me an idea I wanted to talk about. The problem Imagine we […]

A Minimal Interface: Both Expressive And Fast Code

Published December 5, 2017 - 0 Comments
Minimal interface

Have you ever used std::inserter to insert the outputs of an STL algorithm into a sorted container such as an std::set? And if you have, weren’t you annoyed by how its interface forces you to specify the position to insert the elements in the set? I find this very annoying, because most of the time we have […]

How to Use the STL With Legacy Output Collections

Published November 24, 2017 - 4 Comments
STL legacy code

When you start using the STL and its algorithms in your code, it’s a bit of a change of habits. And then after a while you get used to it. Then it becomes a second nature. And then even your dreams become organized into beautifully structured ranges that fly in and out of well-oiled algorithms. […]

How the STL inserter iterator really works

Published October 6, 2017 - 1 Comment

The inserter iterators such as std::back_inserter and std::inserter are important components in the STL that participate in letting us improve the expressiveness of our code. Here we delve into std::inserter. We’ll start with a basic question concerning how it can work, have a peek at the inside, and answer that question. This will make us better understand […]