A updated version.

Jarrett Billingsley jarrett.billingsley at gmail.com
Tue Nov 11 09:03:56 PST 2008


On Tue, Nov 11, 2008 at 10:56 AM, Yonggang Luo <yonggangluo at hotmail.com> wrote:
> And the other file that named
> subClass.d
> The content is
> module subClass;
> private import baseClass; /*!!!!!!!! Please notice, this is private import*/

"private import" only means that if another module, say "main,"
imports subClass, it won't see baseClass unless it does "import
baseClass;".  It does not change what you can access out of baseClass.

> class Sub:Base /*Is this legal?*/
> {
> };

Once again, yes.

> void DoSomeThins()
> {
>        Function(); /*Is this legal?*/
> }

Yes, again.

> private void DoPrivateFunctions(Base x) /*Is this legal?*/
> {
> }

Of course.

> public void DoPublicFunctions(Base x) /*Is this legal?*/
> {
> }

Yes.

> private alias Base BaseAlternative; /*Is this legal?*/

Yes!

> public alias Base PublicBase; /*Is this legal?*/

Yes!

As ore-sama said, please try compiling these things before asking.

Also, please put learning questions on digitalmars.D.learn, not on
digitalmars.D.



More information about the Digitalmars-d mailing list