Ray's playground

 

Item 17: Consider using lazy evaluation.(More Effective C++)

There's nothing about lazy evaluation that's specific to C++. The technique can be applied in any programming language, and several languages — notably APL, some dialects of Lisp, and virtually all dataflow languages — embrace the idea as a fundamental part of the language. Mainstream programming languages employ eager evaluation, however, and C++ is mainstream. Yet C++ is particularly suitable as a vehicle for user-implemented lazy evaluation, because its support for encapsulation makes it possible to add lazy evaluation to a class without clients of that class knowing it's been done. 

posted on 2012-03-06 17:10  Ray Z  阅读(263)  评论(0)    收藏  举报

导航