This is because the varying base class constructors do not provide a uniform interface on which the constructors of the derived classes could rely. This paper discusses several partial solutions to this problem that were proposed to date and presents a new, complete solution. The new solution uses generative programming techniques to automatically generate the appropriate constructors, and this way it avoids the overhead and clumsiness of instantiating composed mixin classes in the client code using the partial solutions. In fact, the new solution allows users to instantiate automatically composed mixin classes with the simplicity of instantiating concrete classes from traditional class hierarchies. Finally, the new solution does not suffer from the scalability problems of the partial solutions.
Grids are fundamental data structures for representing geometric structures or their subdivisions.
Functionality of grid data structures is captured by a small set of primitives, divided into combinatorial and geometric ones. Experiments indicate that the overhead of the generic formulation is low and can be completely eliminated in some cases. Type computations are embedded in the intermediate language of the compiler, and partial evaluation is used to drive type analysis and template instantiation. By making simple changes to the behavior of the partial evaluator, a wide range of compilation models is achieved, each with a distinct tradeoff of compile time, code size, and code speed. We present class templates that implement these custom iterators in a generic manner.