The paper examines metaprogramming as a form of declarative programming with roots in Alonzo Church's lambda calculus. A comparison is drawn between metaprogramming in LISP and imperative programming in C++. The C++ template language is considered as an example of metaprogramming. Methods of C++ metaprogramming are examined: SFINAE, template specialisation, and others. A program solving the Abstract Factory design pattern problem formulated by A. Alexandrescu is demonstrated.
Trokhymchuk et al. (Wed,) studied this question.