Is there a keyword to access the base class

Jacob Carlborg doob at me.com
Wed Jun 19 02:10:42 PDT 2013


On 2013-06-19 00:15, Ali Çehreli wrote:

> val() must appear on Bar. I made it an interface:
>
> interface Bar{
> int val();
> }
>
> class Foo : Bar{
> int val_ = 10;
>
> int val() {
> return val_;
> }
> }
> class Foos : Bar{
> int val_ = 20;
> string str = "some more memory";
>
> int val() {
> return val_;
> }
> }

Why not just move "val" to the base class.

-- 
/Jacob Carlborg


More information about the Digitalmars-d-learn mailing list