Metaprogramming in C++ and in D

后端 未结 10 1938
生来不讨喜
生来不讨喜 2021-01-30 04:46

The template mechanism in C++ only accidentally became useful for template metaprogramming. On the other hand, D\'s was designed specifically to facilitate this. And apparently

10条回答
  •  春和景丽
    2021-01-30 05:42

    Just to counter the D ray tracing post, here is a C++ compile time ray tracer (metatrace):

    enter image description here

    (by the way, it uses mostly C++2003 metaprogramming; it would be more readable with the new constexprs)

提交回复
热议问题