www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17203] New: singleton as mixin

https://issues.dlang.org/show_bug.cgi?id=17203

          Issue ID: 17203
           Summary: singleton as mixin
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: greeenify gmail.com

http://www.digitalmars.com/d/archives/digitalmars/D/The_singleton_design_pattern_in_D_C_and_Java_113474.html

would be nice to have this as a template mixin for simple reuse, e.g.

class Foo {
  mixin Singleton;
}

--
Feb 19 2017