当前位置: 首页 > 工具软件 > Norbert > 使用案例 >

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

杨骁
2023-12-01

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.

 类似资料:

相关阅读

相关文章

相关问答