Remus
Jacob Carlborg
doob at me.com
Tue Oct 30 01:18:03 PDT 2012
On 2012-10-29 23:24, Rob T wrote:
> Namespaces can be useful for organizational reasons. For example they
> can be used for grouping a collection of items under one roof. However
> you can already accomplish this and more using struct along with static
> members.
>
> struct io
> {
> static
> {
> void print() { writeln("foo"); }
> }
> }
>
> io.print();
>
> Plus struct's come with additional abilities that can turn a simple
> namespace into a much more capable one, for example by adding in ctors
> and dtors.
Or using a template.
--
/Jacob Carlborg
More information about the Digitalmars-d-announce
mailing list