1 /** 2 * Copyright: © 2012-2014 Anton Gushcha 3 * License: Subject to the terms of the MIT license, as written in the included LICENSE file. 4 * Authors: NCrashed <ncrashed@gmail.com>, 5 * LeMarwin <lemarwin42@gmail.com>, 6 * Nazgull09 <nazgull90@gmail.com> 7 */ 8 module devol.singleton; 9 10 class Singleton(Class) 11 { 12 this() 13 { 14 msSingleton = cast(Class)(this); 15 } 16 17 static Class getSingleton() 18 { 19 return msSingleton; 20 } 21 22 private static Class msSingleton = null; 23 }