Multiple dispatch using compile-time metaprogramming

Seyed Hossein Haeri, Paul Keir

Research output: Contribution to conferencePresentation

Abstract

We solve the multiple dispatch problem for a components-for-cases encoding of algebraic datatypes in C++. For the multi-method, the programmer is required to specify the decentralised match statements using overloads of template functions. Then, they employ a one-liner preprocessor macro, which expands to the real dispatcher. The expanded one-liner performs iterative pointer introspection to accomplish late-binding using overload resolution. Even though we present our solution for ADTs, one can use the same technology for other types too.
Original languageEnglish
Publication statusPublished - 4 Nov 2018
EventACM SIGPLAN Conference on Systems, Programming, Languages and Applications: Software for Humanity - Boston Park Plaza Hotel, Boston, United States
Duration: 4 Nov 20189 Nov 2018
https://2018.splashcon.org/

Conference

ConferenceACM SIGPLAN Conference on Systems, Programming, Languages and Applications
Abbreviated titleSPLASH 2018
Country/TerritoryUnited States
CityBoston
Period4/11/189/11/18
Internet address

Keywords

  • Metaprogramming
  • C++
  • Functional Programming

Fingerprint

Dive into the research topics of 'Multiple dispatch using compile-time metaprogramming'. Together they form a unique fingerprint.

Cite this