Tango BitArray Initialization

Colin Huang colin.hwong at gmail.com
Sat Feb 10 06:10:07 PST 2007


When reading the Tango documentation, I came across this piece of code:

import tango.core.BitArray;

void main()
{
    BitArray bitbag1 = bits( 1,0,1,1,1,0 );
    // or
    BitArray bitbag2( 1,0,1,1,1,0 );
}

The documentation says that "bitbag2 is initialized such that it uses a special opCall overload for the BitArray".

Now the problem is that when I look at the source code, I don't see any overload of opCall for BitArray, or any definition for the bits function. Am I missing anything here?

BTW, is the last line legal D code at all? It doesn't look like it's gonna compile (to me, at least).


More information about the Digitalmars-d-learn mailing list