"Sputnik" help  
Sputnik Help
Language Reference - Classes - Class Cast Overrides - ToUIntPtr

Class Cast Overrides - ToUIntPtr

This allows a class to override the cast to a Unsigned Pointer.

class Test
{
    my $i;
    my $j;
    Function __Construct($i, $j)
    {
        @this->$i = $i;
        @this->$j = $j;
    }
    Function __ToUIntPtr()
    {
        say "__ToUIntPtr has been run";
        return $i + $j;
    }
}

my $a = new Test(64, 10);
say (UIntPtr)$a;

// PRINTS
// __ToUIntPtr has been run
// 74

A full list of all possible cast overrides can be found here.


Contact
Cheryl (uberfox@hotmail.com)
Homepage
http://ubersoft.org