Adaptable generic programming with required type specifications and package templates

  • Authors:
  • Eyvind W. Axelsen;Stein Krogdahl

  • Affiliations:
  • University of Oslo, Oslo, Norway;University of Oslo, Oslo, Norway

  • Venue:
  • Proceedings of the 11th annual international conference on Aspect-oriented Software Development
  • Year:
  • 2012

Quantified Score

Hi-index 0.00

Visualization

Abstract

The aim of this work is to provide better support for adaption and refinement of generic code. This type of flexibility is desirable in order to fully reap the potential of generic programming. Our proposal for an improved mechanism is an extension to the previously published Package Templates (PT) mechanism, which is designed for development of reusable modules that can be adapted to their specific purpose when used in a program. The PT mechanism relies on compile-time specialization, and supports separate type checking and type-safe composition of modules. The extension to PT presented here is called required types, and can be seen as an enhanced form of type parameters, allowing them the same flexibility as other elements of the PT mechanism. We implement a subset of the Boost Graph Library in order to exemplify, validate, and compare our approach to other options.