[Issue 3666] New: Enhancement Request: Mixin Templates

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Jan 2 13:35:31 PST 2010


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

           Summary: Enhancement Request: Mixin Templates
           Product: D
           Version: future
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: simen.kjaras at gmail.com


--- Comment #0 from Simen Kjaeraas <simen.kjaras at gmail.com> 2010-01-02 13:35:29 PST ---
Currently, whenever you write a template to be mixed into another type, you
specify at the other type how to use the template. Most templates that are made
to be mixed in, will not be used in any other way. Hence, I propose that
templates may marked 'mixin' at declaration point, and 'mixin' be deemed
unnecessary at their point of use. 'mixin' should still be usable for unadorned
templates, and should be a no-op for mixin templates.

Proposed syntax:

mixin template foo( T ) {
  T x;
}

struct bar {
  foo!( int );
}

-- 
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