Expression Template---表达式模板
- What is expression template?
Expression templates is a C++ template metaprogramming technique in which templates are used to represent part of an expression. Typically, the template itself represents a particular type of operation, while the parameters represent the operands to which the operation applies. The expression template can then be evaluated at a later time, or passed to a function. [1]
- How can it help you?
1. To create a domain-specific embedded language (DSEL) in C++
2. To support lazy evaluation of C++ expressions (e.g., mathematical expressions), which can be executed much later in the program from the point of their definition.
3. To pass an expression -- not the result of the expression -- as a parameter to a f