On Sat, 17 Dec 2011 23:12:16 +0200, Jakob Ovrum <jakobov...@gmail.com> wrote:

I suspect that the reason a static member function is prevalent is because it's easy to just make the constructor private (and not have to mess with things like C++'s `friend`). In D, there's no real difference because you can still use private members as long as you're in the same module.

Exactly. there is no difference between "static A.make" and "makeA" in D.

The only difference between them I can see is that the module-level function doesn't expose the class name directly when using the function, which is but a minor improvement.

You have to expose either way no? "A.make" instead of "makeA"

Reply via email to