LNK2019 error from using a function pointer to core.bitop functions?

Roland Hadinger via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Jul 17 08:49:44 PDT 2015


On Friday, 17 July 2015 at 15:47:39 UTC, Roland Hadinger wrote:
> Otherwise, I'd use templates and an alias. Maybe this will 
> result in faster code:
>
>     bool opIndexAssign(bool value, size_t[2] inds)
>     {
>         void impl(bool b)(size_t[2] inds)
>         {
>             static if(b)
>                 alias btx = bts;
>             else
>                 alias btx = btr;
>
>             // code from opIndexAssign goes here...
>             // for (size_t i = startBitInd; ...
>         }
>
>         if( value )
>             impl!true(inds);
>         else
>             impl!false(inds);

           return value; // oops
>     }



More information about the Digitalmars-d-learn mailing list