Diego Canuhe <> changed:

           What    |Removed                     |Added
                 CC|                            |

--- Comment #2 from Diego Canuhe <> 2011-06-22 11:52:38 PDT 
(In reply to comment #1)
> Patch for D2

I disagree.
Even while you can easily access protected methods of a class, they are
intended for internal use, otherwise they'd be public.


class A
    abstract protected SomeType[] getData();

    public void processData()
        //do something that breaks the invariants
        foreach (SomeType element; getData())
            //do something...
        //do something that restores the invariants

    invariant() {...}

a class B derived from A implementing getData() shouldn't have to respect the
invariants while entering/leaving getData(). Anything regarding getData()'s
side-effects should be put in an out clause.

BTW, abstract functions shouldn't require a body clause accompanying in and out

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to