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 language | English |
---|---|
Publication status | Published - 4 Nov 2018 |
Event | ACM SIGPLAN Conference on Systems, Programming, Languages and Applications: Software for Humanity - Boston Park Plaza Hotel, Boston, United States Duration: 4 Nov 2018 → 9 Nov 2018 https://2018.splashcon.org/ |
Conference
Conference | ACM SIGPLAN Conference on Systems, Programming, Languages and Applications |
---|---|
Abbreviated title | SPLASH 2018 |
Country/Territory | United States |
City | Boston |
Period | 4/11/18 → 9/11/18 |
Internet address |
Keywords
- Metaprogramming
- C++
- Functional Programming