void myFunc(T: !=int)(T value)

tsalm tsalm at free.fr
Fri Aug 22 05:42:51 PDT 2008


Le Fri, 22 Aug 2008 14:33:23 +0200, Jarrett Billingsley  
<kb3ctd2 at yahoo.com> a écrit:

> -------------------------------------------
> "tsalm" <tsalm at free.fr> wrote in message
> news:op.ugacfwj7010shu at papillon.lan...
> Hello,
>
> I want to do something like this :
>
> class MyClass
> {
>    void myFunc(int intValue)
>    {
>      /* Do something with this int */
>    }
>
>    void myFunc(T: !=int)(T valueNotInt)
>    {
>      /* valueNotInt can not be an int */
>    }
> }
>
> Thanks in advance,
> TSalm
> -------------------------------------------
>
> void myFunc(T: int)(int intValue) {}
> void myFunc(T)(T notIntValue) {}
>
> :)
>

In fact, the exact operator is :
   int opCmp(MyStruct m)

It must be use, when this struct is in an array, to sort this array
And strangly, the method
    int opCmp(T:MyStruct)(MyStruct m)
is not take by ".sort"
:(


More information about the Digitalmars-d-learn mailing list