About 785,000 results
Open links in new tab
  1. How can I pass in a func with a generic type parameter?

    Mar 24, 2014 · You can certainly define generic delegates, after all, that's exactly what Func and Action are. They are treated as generic definitions, just like generic interfaces and classes are. …

  2. How do you provide a default type for generics? - Stack Overflow

    Jul 8, 2009 · The generic parameter type will be the same for all methods, so I would like it at the class level. I know I could make a generic version and then inherit from it for the int version, …

  3. c# - How to compare values of generic types? - Stack Overflow

    So, two questions: Why do we observe this weird behaviour? What keeps us from comparing the values of generic types which are known to be IComparable? Doesn't it somehow defeat the …

  4. java - How to Map to Generic Type? - Stack Overflow

    Aug 5, 2019 · Mapstruct is a code generator. So it needs to know which types to construct in order to generate a method implementation. Having said that, you could do this smarter by using a …

  5. Creating a generic method in C# - Stack Overflow

    Jan 27, 2010 · I am trying to combine a bunch of similar methods into a generic method. I have several methods that return the value of a querystring, or null if that querystring does not exist …

  6. C# Generics and Type Checking - Stack Overflow

    I have a method that uses an IList<T> as a parameter. I need to check what the type of that T object is and do something based on it. I was trying to use the T value, but the compiler does ...

  7. Syntax and Sample Usage of _Generic in C11 - Stack Overflow

    Mar 26, 2015 · This is a pretty good introduction. Here's the Overview: Generic selection is implemented with a new keyword: _Generic. The syntax is similar to a simple switch statement …

  8. exception - Generic catch for python - Stack Overflow

    Jan 14, 2009 · Generic catch for python Asked 16 years, 5 months ago Modified 5 years, 1 month ago Viewed 134k times

  9. .net - Initializing a Generic.List in C# - Stack Overflow

    Apr 15, 2009 · In C#, I can initialize a list using the following syntax. List<int> intList= new List<int>() { 1, 2, 3 }; I would like to know how that {} syntax works, and if it has a name. There …

  10. c# - What does an "in" generic parameter do? - Stack Overflow

    6 That signifies generic contravariance. The opposite is covariance (keyword out). What this means is that when an interface is contravariant (in), then the interface can be implicitly …

  11. Some results have been removed