"Ali Çehreli" <[email protected]> wrote in message news:[email protected]... > Justin Johansson wrote: >> Which language out of C++, D and Java does this classical >> "GoF" (gang-of-four***) design pattern best? > > Are we still talking singleton? I thought that it is considered an > anti-pattern already. :) > > As a teaser: What problem does it solve that can't be solved by creating > just one object of a type? >
In languages that don't allow functions outside a class, they're useful as a make-shift substitute for a module with free-floating functions. Or at least if you count static classes as a form of singleton, anyway.
