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!
-
A Slice of Python in C++
This post describes a fun piece of hackery that went into my Range-v3 library recently: a Python-like range slicing facility with cute, short syntax. It’s nothing earth-shattering from a functionality point of view, but it’s a fun little case study in library design, and it…
-
Container Algorithms
The recent meeting of the C++ Standardization Committee in Urbana-Champaign was a watershed moment for my work on ranges. Ultimately, my presentation was well received (Herb Sutter used the phrase “palpable excitement” to describe the feeling in the room), but it wasn’t at all certain…
-
Tiny Metaprogramming Library
(Difficult-to-grok metaprogramming below. Not for the faint of heart.) At the recent Urbana-Champaign meeting of the C++ Standardization Committee, Bill Seymour presented his paper N4115: Searching for Types in Parameter Packs which, as its name suggests, describes a library facility for, uh, searching for a…
-
Ranges, Concepts, and the Future of the Standard Library
Frequent readers of this blog know that over the past year, I’ve been working on a modern range library suitable for standardization, integrating good ideas from hither and thither — particularly from Sean Parent and Andrew Sutton — resulting in a library that’s available immediately,…
-
Customization Point Design in C++11 and Beyond
(Disclaimer: here be esoteric language wonkery. Abandon all hope.) If you read or write Generic-code-with-a-capitol-‘G’, you may have written or seen code like this: using std::swap; swap( a, b ); The first line brings std::swap into consideration, and the second makes an unqualified call to…
-
N4128: Ranges for the Standard Library
Eleven months ago, I began work on an updated range library for modern C++. Yesterday, I submitted a proposal to the C++ standardization committee to add ranges to the Standard Library. The proposal presents a vision for a future Standard Library that is familiar and…
-
Ranges in C++: Counted Iterables and Efficiency
I’ve been hard at work fleshing out my range library and writing a proposal to get range support into the standard. That proposal describes a foundational range concept: Iterable. An Iterable is anything we can pass to std::begin() and std::end() to get an Iterator/Sentinel pair.…
-
Assert and Constexpr in C++11
Here’s a simple question: in C++11 what’s the best way to put debug checks in constexpr functions? Since assert is not constexpr, the obvious doesn’t work: constexpr bool in_range(int val, int min, int max) { assert(min <= max); // OOPS, not constexpr return min <=…
-
Cpp-Next.Com and the Expressive C++ Series
The C++ community is suffering from the loss of the cpp-next.com website and all the great content that was once hosted there. In the past 2 months, I’ve gotten many questions both about the site and about the fate of my “Expressive C++” article series.…
-
Range Comprehensions
I’ve been busy since I last wrote about ranges. I have a lot of news to share, but in this post, I’m going to narrowly focus on a recent development that has me very excited. It’s a new feature that I’m calling range comprehensions, and…