A Type for Almost Functors

Sometimes you have a type you want to be a functor but, for whatever reason, it can’t be. As a concrete example, consider a type representing some future value yet to be computed. I first encountered this when playing with a material system for a ray tracer. In this system there were a small number of material “types” which could be evaluated using some “light parameters” to produce a color output....

June 10, 2021 · Tom Savage

Observing Object Lifecycles

Being lazy As a relatively lazy programmer, if the compiler can do something for me I’ll go out of my way to make sure it does. To that end, I prefer to let the compiler take care of implementing constructors, assignment operators, and destructors whenever I can. I just can’t be bothered with all that. To wit: C++ has some fairly complex rules which control when certain constructors or assignment operators are implicitly declared by the compiler....

January 19, 2020 · Tom Savage