Templetazied ForeachStatement

I am currently stuck at the semantic analysis.
because depending on the type of the expression that is itterated foreach does diffrent things
how I check If the itterated type has thoose methods ?
-  `popFront()`/`front()`
-  `opApply`

This might be totally offbase, but it seems like it might be worthwhile to make a ForeachVisitor (ala DefaultInitializerVisitor) due to it's complexity.   Then you can call visit() on it's the iterator type and avoid having a bit switch statement on the typeids.  Makes adding opApply and whatnot easier too.