“The Lambda Trick”

I just got back from C++Now, an excellent conference where C++ template metaprogramming experts abound. A phrase I overheard often was “the lambda trick”. It’s a trick for speeding up compiles when templates get deep. Every C++ programmer knows that deep templates can slow down compilation. Most assume that this is because of excessive code… Continue reading “The Lambda Trick”

“In-place” might be less in-place than you think

The intuitive view of algorithms that work in-place is that (it sounds obvious) they don’t use any extra space. Canonically in C/C++ we think of something like reversing an array, or that interview staple, removing spaces from an ASCII string, which we might write as: int remove_spaces(char *s) { char *readptr = s; char *writeptr… Continue reading “In-place” might be less in-place than you think