Am Wed, 08 Aug 2012 21:55:21 +0200
schrieb Timon Gehr timon.g...@gmx.ch:
Well, I have done similar things in the past. The general concept
should work.
BTW: This is a working version, but it does cause template bloat:
http://dpaste.dzfl.pl/d42a58aa
Maybe this helps:
I wanted to add a new overload to digest for the std.hash module (see
review in main newsgroup). This is the code written as two functions
which should be combined in one overloaded function
digestType!Hash digest(Hash)(scope const(void[])[] data...)
if(isDigest!Hash)
{
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
Am Wed, 08 Aug 2012 18:53:05 +0200
schrieb Timon Gehr timon.g...@gmx.ch:
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))){
On 08/08/2012 09:11 PM, Johannes Pfau wrote:
Am Wed, 08 Aug 2012 18:53:05 +0200
schrieb Timon Gehrtimon.g...@gmx.ch:
Try this:
template digest(Hash) if(isDigest!Hash){
digestType!Hash digest(Range)(Range data)
if(!is(Range:void[][]) isInputRange!Range