std.digest: can we get rid of start() functions?

Piotr Szturmaj bncrbme at jadamspam.pl
Wed Oct 10 07:01:23 PDT 2012


Marco Leise wrote:
> Unlike classes, structs don't mandate a ctor call, so in
> general you need to disguise the constructor as 'start()'
> 'Create()' or similar, where T.init is not sufficient.

I know, but in case of digests their init data is always known at 
compile time, hence no special "constructor" is needed.

> I think the constraints are:
> * no start() method ever takes arguments
> * no digest needs to allocate to start
> * no digest depends on global/static variables

Yes, these constraints do not prevent digest structs to be correctly 
initialized after declaration.


More information about the Digitalmars-d mailing list