Dean
Dean
CC#
Created by Dean on 1/7/2023 in #help
❔ Is a generic with a where clause equivalent to passing the same type through as a parameter
is icomparable used often?
23 replies
CC#
Created by Dean on 1/7/2023 in #help
❔ Is a generic with a where clause equivalent to passing the same type through as a parameter
how do you remember this
23 replies
CC#
Created by Dean on 1/7/2023 in #help
❔ Is a generic with a where clause equivalent to passing the same type through as a parameter
ahh i see so specifying the type can avoid it
23 replies
CC#
Created by Dean on 1/7/2023 in #help
❔ Is a generic with a where clause equivalent to passing the same type through as a parameter
why use the generic version?
23 replies
CC#
Created by Dean on 1/7/2023 in #help
❔ Is a generic with a where clause equivalent to passing the same type through as a parameter
why would it be boxed?
23 replies
CC#
Created by Dean on 1/7/2023 in #help
❔ Is a generic with a where clause equivalent to passing the same type through as a parameter
you mean don't use the second method?
23 replies
CC#
Created by Dean on 1/7/2023 in #help
❔ Is a generic with a where clause equivalent to passing the same type through as a parameter
by contract (second example), if you used a specific type (such as IComparable) as a parameter, you would not be able to use the type parameter as a placeholder within the method implementation. Instead, you would need to use the specific type (such as IComparable) directly:
23 replies
CC#
Created by Dean on 1/7/2023 in #help
❔ Is a generic with a where clause equivalent to passing the same type through as a parameter
in the first example the DoSomething method can be called with any class that implements the IComparable interface. The method can then use the CompareTo method of the IComparable interface to compare the value to the number 10.
23 replies
CC#
Created by Dean on 1/7/2023 in #help
❔ Is a generic with a where clause equivalent to passing the same type through as a parameter
I asked an AI and it told me this, it doesn't seem true, is it?
23 replies
CC#
Created by Dean on 1/7/2023 in #help
❔ Is a generic with a where clause equivalent to passing the same type through as a parameter
do you mean the first one can't be a struct that inherits the interface, and that is due to the class keyword?
23 replies
CC#
Created by Dean on 12/18/2022 in #help
❔ Copying video on Delegates, why doesn't my version work?
$codegif
48 replies
CC#
Created by Dean on 12/18/2022 in #help
❔ Copying video on Delegates, why doesn't my version work?
i cant see it
48 replies
CC#
Created by Dean on 12/18/2022 in #help
❔ Copying video on Delegates, why doesn't my version work?
is there a page somewhere that shows you
48 replies
CC#
Created by Dean on 12/18/2022 in #help
❔ Copying video on Delegates, why doesn't my version work?
int Whaetver() => 1
48 replies
CC#
Created by Dean on 12/18/2022 in #help
❔ Copying video on Delegates, why doesn't my version work?
how are you getting the comments to format your code?
48 replies
CC#
Created by Dean on 12/18/2022 in #help
❔ Copying video on Delegates, why doesn't my version work?
right, it's everything chainged up in one statement ended by one ;
48 replies
CC#
Created by Dean on 12/18/2022 in #help
❔ Copying video on Delegates, why doesn't my version work?
gotta smash that into my brain
48 replies
CC#
Created by Dean on 12/18/2022 in #help
❔ Copying video on Delegates, why doesn't my version work?
alright cool
48 replies
CC#
Created by Dean on 12/18/2022 in #help
❔ Copying video on Delegates, why doesn't my version work?
but it only works if its 1 line?
48 replies
CC#
Created by Dean on 12/18/2022 in #help
❔ Copying video on Delegates, why doesn't my version work?
so its saying execute/return the following
48 replies