BitArray/BitFields - Reworking with templates

Era Scarecrow rtcvb32 at yahoo.com
Mon Jul 30 16:02:11 PDT 2012


On Monday, 30 July 2012 at 22:44:21 UTC, Dmitry Olshansky wrote:
> Fixed :
>
>>    void func(bool smth)(X!(smth).XT x){
>
> By default XT is deduced as X!(current value of smth).XT

Doesn't really fix it...

     a.func(b); //65 - doesn't match declaration.
     a.func(ba); //66
     //other template tests not worth putting, 67-70
     a.func!true(b); //71 - explicitly stated
     a.func!false(ba); //72
     a.func!false(b); //73 - Backwards on purpose for test
     a.func!true(ba); //74

(65): Error: template test.X!(true).XT.func does not match any 
function template declaration
(11): Error: template test.X!(true).XT.func(bool smth) cannot 
deduce template function from argument types !()(XT)

(66): Error: template test.X!(true).XT.func does not match any 
function template declaration
(11): Error: template test.X!(true).XT.func(bool smth) cannot 
deduce template function from argument types !()(XT)

(73): Error: function test.X!(true).XT.func!(false).func (XT x) 
is not callable using argument types (XT)
(73): Error: cannot implicitly convert expression (b) of type XT 
to XT
(74): Error: function test.X!(true).XT.func!(true).func (XT x) is 
not callable using argument types (XT)
(74): Error: cannot implicitly convert expression (ba) of type XT 
to XT


More information about the Digitalmars-d-learn mailing list