About 785,000 results
Open links in new tab
  1. What's the difference between "general" and "generic"?

    Apr 30, 2014 · Generic is the opposite of specific. Generic and specific refer to the identification of a fact. Specific means a fact that has been specified. If you ask for (specify) a pain reliever, …

  2. What is the syntax for Typescript arrow functions with generics?

    Aug 31, 2015 · Generic functions. Something like the following works fine: function foo<T>(x: T): T { return x; } However using an arrow generic function will not: const foo = <T>(x: T) => x; // …

  3. Using List<T> in C# (Generics) - Stack Overflow

    Oct 2, 2013 · C# will infer the type based on arguments, so explicitly specifying <MyClass1> isn't needed in this case - obviously if there are no parameters on the method, you will need to …

  4. How do I make the return type of a method generic?

    This may not be a best practice but it worked for me. This method takes in an array of generic type and a value to add to the end of the array. The array is then copied with the first value …

  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# - How to compare values of generic types? - Stack Overflow

    @gstercken: One problem with IComparable overloading the comparison operators is that there are situations where X.Equals(Y) should return false, but X.CompareTo(Y) should return zero …

  7. Manually raising (throwing) an exception in Python

    Jun 13, 2022 · Don't raise generic exceptions. Avoid raising a generic Exception. To catch it, you'll have to catch all other more specific exceptions that subclass it. Problem 1: Hiding bugs raise …

  8. Generics in C#, using type of a variable as parameter

    Feb 11, 2015 · The point about generic types, is that although you may not know them at "coding time", the compiler needs to be able to resolve them at compile time. Why? Because under the …

  9. Nullable type as a generic parameter possible? - Stack Overflow

    Oct 16, 2008 · Multiple generic constraints can't be combined in an OR fashion (less restrictive), only in an AND fashion (more restrictive). Meaning that one method can't handle both …

  10. .net - C# Create New T() - Stack Overflow

    Take a look at new Constraint. public class MyClass<T> where T : new() { protected T GetObject() { return new T(); } }

Refresh