On 2/9/2012 6:24 AM, Sönke Ludwig wrote:
Artificial example (I have a different use case, but the pronciple is
similar):

interface ILinkedListItem {
   LinkedListItem next();
   void next(LinkedListItem v);
}

LinkedList objectStore;

class C : protected ILinkedListItem {
   this()
   {
     objectStore.add(this);
   }

   protected LinkedListItem next() {...}
   protected void next(LinkedListItem v) {...}
}

So the intent is that you don't have access to these methods from the
outside, but that C can still implement the interface to pass it only to
certain receivers (the objectStore list in this case).


Wouldn't making ILinkedListItem private do the same thing?
_______________________________________________
dmd-beta mailing list
[email protected]
http://lists.puremagic.com/mailman/listinfo/dmd-beta

Reply via email to