static class vs. static struct

creiglee via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Jul 15 01:43:07 PDT 2015


In simple words, Singleton is a pattern and not a keyword. The 
Singleton pattern has several advantages over static classes. A 
singleton allows a class for which there is just one, persistent 
instance across the lifetime of an application. That means, it 
created a single instance and that instance (reference to that 
instance) can be passed as a parameter to other methods, and 
treated as a normal object. While a static class allows only 
static methods and and you cannot pass static class as parameter. 
More about.....

http://net-informations.com/faq/netfaq/singlestatic.htm

Lee




More information about the Digitalmars-d-learn mailing list