[Issue 4675] Eponymous Template should hide internal names

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Aug 27 16:27:08 PDT 2010


http://d.puremagic.com/issues/show_bug.cgi?id=4675


bearophile_hugs at eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bearophile_hugs at eml.cc


--- Comment #4 from bearophile_hugs at eml.cc 2010-08-27 16:26:55 PDT ---
Time ago some people have proposed to allow "private" for that purpose:

template isNumeric(T) {
    private enum bool test1 = is(T : long);
    private enum bool test2 = is(T : real);
    enum bool isNumeric = test1 || test2;
}


This is good because the person that reads the code doesn't need to remember
the rule that test1 and test2 become invisible if isNumeric is defined inside
isNumeric(). So I think this is a more tidy solution to the problem.

On the other hand you want all names to be private but the one that is
eponymous, so the solution in TDPL is shorter (and probably acceptable still).

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list