C++ History – Why Didn’t the Standard Adopt Expression Templates?

chistory

It's my understanding that expression templates as a technique were discovered significantly prior to the original C++ Standard in 1998. Why weren't they used to improve the performance of several standard classes like std::string and streams?

Best Answer

Expression templates were first published by Todd Veldhuizen in June 1995, in an article in the C++ Report magazine. By that time, the standard committee was already heavily involved with adding the STL to the C++ standard, a task which all by itself delayed the standard by one or two years. (The STL was presented to the committee in 1993, and officially proposed in 1994. It took another four years to finish the standard.)
Given that the C++ standardization committee is a bunch of volunteers, some of them not even backed by companies paying their expenses, I don't think anyone had any resources to use on adding yet another idea to the C++ standard.

Also, 1995 is just the year Veldhuizen's article was published. For the technique to become known and recognized, it would have taken another few years. (The idea of the STL dates back to the 70s, an Ada implementation was done in the late 80s, work at a C++ implementation must have started around 1990, and it took another three years for the idea to find its way to the C++ standardization committee.)
There were, however, just three years from Todd's article until the final vote on the standard. That was way too little time to incorporate an idea that was still brand-new and basically untested.

Add to that the fact that Expression Templates, being a kind of template meta-programming, stress compilers way more than the comparatively "simple" STL does. And from what I remember, even in 1998, when the standard was published, we didn't have a compiler that could even compile all of the STL.
Given that one of the standardization committee's main goals was to standardize established practice (not that they stuck to this rigorously), Expression Templates should never have been on the agenda back then.