On Tue, 02 Nov 2010 21:56:44 -0400, gg <nore...@now.pl> wrote:

Why we cant deduce value parameter of templates:
void caracterize(uint m)(pp!(m)){
        
}
class pp(uint m){

}
void main(){
        caracterize(pp!5);
}
fails with

dmd chap.d
chap.d(8): Error: template chap.caracterize(uint m) does not match any function template declaration chap.d(8): Error: template chap.caracterize(uint m) cannot deduce template function from argument types !()(void)

Or at least of a way to extract template instantiation information would be useful. Or it is needed to do it the long way

I think there is a way to do this, but I think you have to include the pp!(m) parameter, something like:

caracterize(m, T : pp!m)(pp!(m) arg)

Look through phobos' source, you will probably find someone else has solved the problem.

-Steve

Reply via email to