D2 questions

ponce spam at spam.com
Thu Nov 4 21:00:53 PDT 2010


In D2:

1. Is A!T implicitely convertible to A!(const(T)) ?

2. Is A!(immutable(T)) implicitely convertible to A!(const(T)) ?

3. Is A!(immutable(T)) implicitely convertible to A!(const(T)) ?

4. 

inout(T) myFunction(inout(T) x)
{
    inout(T) a;
}

Can we declare a inout(T) variable in an inout(T) function ?

5. 

T func(T x)
{
    // blah
}

const(T) func(const(T) x) 
{ 
    // blah
}

immutable(T) func(immutable(T) x) 
{ 
    // blah
}

inout(T) func(inout(T) x)
{
    // blah
}

How is the overloading resolved when calling func(x) where x is of type T/const(T)/immutable(T)/inout(T) ?


Thanks :)


More information about the Digitalmars-d-learn mailing list