Hi, I’m Eric. I’ve been writing C++ professionally since before there was a C++ standard. I write about C++, library design, and functional programming. Welcome!
-
Range Concepts, Part 4 of 4: To Infinity And Beyond
Last time, I introduced a new concept, Iterable, and showed how it solved many of the problems with pair-of-iterator-style ranges. This time around, I’m going to extend Iterable in small ways to make programming with infinite ranges safer and more efficient. Disclaimer: The ideas in…
-
Range Concepts, Part 3 of 4: Introducing Iterables
In the last two blog posts, I describes the challenges I’ve encountered while building a next-generation range library. In this post, I’ll sketch for you my proposed solution: refinements of the range concepts that allow delimited, infinite, and pair-o’-iterator-style ranges to fit comfortably within the…
-
Range Concepts, Part 2 of 4: Infinite Ranges
In the last post, I tried to make delimited ranges fit into the STL and found the result unsatisfying. This time around I’ll be trying the same thing with infinite ranges and will sadly be reaching the same conclusion. But the exercise will point the…
-
Range Concepts, Part 1 of 4: Delimited Ranges
I’ve been digging into ranges recently, and I’m finding them to be more than just a pair of iterators. In a series of posts, I’ll be expanding the notion of what a range is to cover some kinds of ranges not easily or efficiently expressible…
-
Concept Checking in C++11
This post describes some utilities I’ve recently developed for doing concept checking in C++11. These utilities are part of an ongoing project to reimplement ranges, also for C++11, but I think the concept checking utilities are useful and interesting in their own right. Concepts, the…
-
Input Iterators vs Input Ranges
This post was inspired by some shortcomings of the std::getline solution I described in my previous post, which just goes to show that there is no interface so simple that it can’t be done wrong. Or at least sub-optimally. Input Iterators and Lazy Ranges In…
-
Out Parameters, Move Semantics, and Stateful Algorithms
At GoingNative back in September, Andrei Alexandrescu posed an interesting question about API design and C++11 that has had me scratching my head for a month. It was about the design of std::getline: // Read a line from sin and fill in buf. Return sin.…
-
Universal References and the Copy Constructor
At the most recent NWCPP meeting in Redmond, WA, the always-entertaining Scott Meyers shared his latest insights about so-called “universal references” and their pitfalls. In particular, he was warning about the hazards of overloading on universal references. His advice was good, I thought, but missed…
-
F-Algebras and C++
“I think F-algebras would be useful in Proto.” That’s how Bartosz Milewski planted the seed in my head that has now matured into this blog post. Bartosz had been writing a blog post about F-algebras, and in a bid to get me to review it,…
-
Best Professional Advice I Ever Got
This is the story of the best piece of professional advice I ever got, and how it affected my career. I think it’s good advice, and I’ve never stopped thinking about it, so I thought it was time to share. The Advice It was 1996…