Scoped Operator Overloading

Carl carl at email.com
Sat Jun 1 22:27:06 PDT 2013


I am writing a class to act like a database or cache. I want to 
enable looping with foreach, but I need two separate opApply 
methods. One for the internal looping through raw data and a 
second for looping through the cached data (strings for example).

Is there a way to scope the first opApply (looping through raw 
data) to only be accessible inside the class? This would be 
beneficial to prevent someone from accidentally looping through 
raw data instead of their cached objects.


More information about the Digitalmars-d-learn mailing list