Am Wed, 08 Aug 2012 18:53:05 +0200
schrieb Timon Gehr <[email protected]>:

> Try this:
> 
> template digest(Hash) if(isDigest!Hash){
>       digestType!Hash digest(Range)(Range data)
> if(!is(Range:void[][]) && isInputRange!Range && 
> __traits(compiles,digest!Hash(ElementType!(Range).init))){
>               //implementation detail
>       }
>       digestType!Hash digest()(scope const(void[])[] data...){ //
> templated as a workaround
>               //implementation detail
>       }
>          // ... (maybe more overloads)
> }

Clever, but doesn't seem to work. I can't create an instance of it, even
when explicitly specifying the types.

BTW: This is a working version, but it does cause template bloat:
http://dpaste.dzfl.pl/d42a58aa

Reply via email to