Mayfly

Mayfly A Pattern for Lightweight Generic Interfaces. The Mayfly pattern describes an implementation approach to constructing interfaces for efficient data structures. In Nature, the mayfly is a creature well known for its short life span. Similarly, for our purposes, a Mayfly is a temporary object that resides on the stack or only in registers (never in the heap). All of its member functions are typically inlined and it is always passed by value. These characteristics make Mayfly objects ideal for providing lightweight interfaces to efficient array-based data structures such as compressed matrices, graphs, heaps, and trees. The Mayfly pattern cuts across several other patterns. For instance, many of the iterators in the Standard Template Library (STL [1, 19]) are Mayflies ...