foreach/opApply is the visitor pattern

BCS ao at pathlink.com
Fri Jan 30 14:35:08 PST 2009


Correct me if I'm wrong but I thing that D's opApply is a form of the Visitor 
pattern where the calling function's stack frame is the visitor object.

This just occurred to me. Maybe I've been missing something re the visitor 
pattern but I think this make for a nice, cool and easy way to describe it. 
(Also I don't remember it being described that way)




More information about the Digitalmars-d-learn mailing list