Import concerns revisited

Pavel Vozenilek pavel_vozenilek at yahoo.co.uk
Wed Jul 12 08:59:27 PDT 2006


"Don Clugston" wrote:

[ default public ]

> An interesting example is that many small classes in C++ STL programs use 
> 'struct' instead of 'class' because it defaults to public.
> You can find 'struct' all over the Boost libraries! Default public must be 
> worth something.
>

This is mainly because a specialised keyword is missing.

These structs are neither used as "real classes"
(to be inherited or having virtual functions)
not as "value classes" but mostly for metaprogramming.


In some cases it is because of lazyness to write one more line.

/Pavel






More information about the Digitalmars-d mailing list