Lazy Data Types in C++ Template Metaprograms by Adam Sipos, Norbert Pataki, and Zoltan Porkolab

C++ supports among others the generative paradigm by enabling the creation of programs executed in compile-time.This is called template metaprogramming(TMP), and is based on the language's flexible generic constructl, the

template.

One of the main reasons for our research is the introduction of compile-time lazy data types. Note that the aforementioned typelist and Boost::MPL containers are ¯nite structures, holding a limited number of types at the same
time. Contrarily, lazy data types are ¯nite structures representing an infnitenumber of elements, e.g. all natural numbers. A common example for the usage of lazy lists is the implementation of the Eratosthenes sieve algorithm producing arbitrarily many primes.

Our implementation relies on pattern matching using template partial spe-
cializations.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章