June 01, 2012 Re: problem with template arguments deduction | ||||
---|---|---|---|---|
| ||||
Posted in reply to Zhenya | On 01.06.2012 16:53, Zhenya wrote: > >> ну как же map, filter и тд работают ) >> ну передавай свой delegate как параметр времени компиляции через !(...) >> все будет ок ... > нууу так не прикольно. beats me. > А это часом не бага у DMD? Ну их много, заполни репорт в http://d.puremagic.com/issues/ через пару дней Кенжи Хара пофиксит если это баг ) -- Dmitry Olshansky |
June 01, 2012 Re: problem with template arguments deduction | ||||
---|---|---|---|---|
| ||||
Posted in reply to Zhenya | On Friday, 1 June 2012 at 12:53:16 UTC, Zhenya wrote: > >> ну как же map, filter и тд работают ) >> ну передавай свой delegate как параметр времени компиляции через !(...) >> все будет ок ... > нууу так не прикольно. > А это часом не бага у DMD? кстати если я заменяю template bind(alias indeces) { static if(is(typeof(indeces) : int[])) { auto bind(D,V...)(D dg,V values) { static if(is(D d : R delegate(U), R, U...) && is(V == Combination!(indeces,ParameterTypeTuple!D))) { static if(indeces.length > 1) return bind!(update!(indeces,indeces[0])[1..$]).bind(Curry!(indeces[0])(dg,values[0]),values[1..$]); else static if(indeces.length == 1) return Curry!(indeces[0])(dg,values[0]); } } } } на class Bind(alias indeces) { static auto opCall(D,V...)(D dg,V values) { static if(is(D d : R delegate(U), R, U...) && is(V == Combination!(indeces,ParameterTypeTuple!D))) { static if(indeces.length > 1) return Bind!(update!(indeces,indeces[0])[1..$])(Curry!(indeces[0])(dg,values[0]),values[1..$]); else return Curry!(indeces[0])(dg,values[0]); } } } то вот так Bind!([1,0,3])(&checker!(int,int,int,int),2,1,4)(3); вполне спокойно работает в чем же разница? |
June 02, 2012 Re: problem with template arguments deduction | ||||
---|---|---|---|---|
| ||||
Posted in reply to Zhenya | Дмитрий,не подскажите как я бы мог проверить не баг ли это? |
June 02, 2012 Re: problem with template arguments deduction | ||||
---|---|---|---|---|
| ||||
Posted in reply to Zhenya | On 02.06.2012 11:23, Zhenya wrote: > Дмитрий,не подскажите как я бы мог проверить не баг ли это? Как я и говорил отписать что это баг. Дальше это дело экспертов по компилятору ) Вот например последние что ты отипсывал, вполне катит для bug-репорта: (только сократи лишний "внешний" код) this doesn't work: template bind(alias indeces) { static if(is(typeof(indeces) : int[])) { auto bind(D,V...)(D dg,V values) { static if(is(D d : R delegate(U), R, U...) && is(V == Combination!(indeces,ParameterTypeTuple!D))) { static if(indeces.length > 1) return bind!(update!(indeces,indeces[0])[1..$]).bind(Curry!(indeces[0])(dg,values[0]),values[1..$]); else static if(indeces.length == 1) return Curry!(indeces[0])(dg,values[0]); } } } } while this works : class Bind(alias indeces) { static auto opCall(D,V...)(D dg,V values) { static if(is(D d : R delegate(U), R, U...) && is(V == Combination!(indeces,ParameterTypeTuple!D))) { static if(indeces.length > 1) return Bind!(update!(indeces,indeces[0])[1..$])(Curry!(indeces[0])(dg,values[0]),values[1..$]); else return Curry!(indeces[0])(dg,values[0]); } } } -- Dmitry Olshansky |
June 02, 2012 Re: problem with template arguments deduction | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dmitry Olshansky | Куда отписать-то?) |
June 02, 2012 Re: problem with template arguments deduction | ||||
---|---|---|---|---|
| ||||
Posted in reply to Zhenya | On 02.06.2012 11:30, Zhenya wrote: > Куда отписать-то?) > http://d.puremagic.com/issues/ -- Dmitry Olshansky |
Copyright © 1999-2021 by the D Language Foundation