Omgili - forum search, search forums  
  

Discussions about generic

Displaying 1 - 10 out of 157,482 discussions.  
RSS Feed Options
Time Frame: (Any time)   Minimum number of replies: (2)   Minimum number of discussing users: (0)
  |  

Page: 1   2   3   4   5   6   7   8   9   10  
Keep this page open to be updated with the newest discussions automatically.
I have a generic class that has one type parameter (T). I needed to store a collection of these generic objects that are of different types, so I created an interface that the generic class implements as suggested here . There is a property in the generic...
Started by on , 5 posts by 5 people.  
Use a different generic type as needed class XmlUser : ISomeClassUser<string> { public.
I have a legacy class that the class itself is not a generic but one of its methods return type uses generics: public class Thing { public Collection<String> getStuff() { ... } } getStuff() uses generics to return a collection of strings. Therefore...
Started by on , 3 posts by 3 people.  
Instead of Thing<?> ( parameterized type ) the Java compiler strips out all generic arguments, even thogh (as in your case) the generic type of the method has nothing to do with the generic type.
I'm trying to add another restriction on a method within a generic class. Is this possible? Pseudocode: public class MyBaseClass<T> where T: class { public IQueryable<T> ShowThisMethod where T: class, IMyInterface { // stuff. } } ShowThisMethod...
Started by on , 6 posts by 6 people.  
You could define another class that inherits.
So the constraints can the caller to have to specify the generic Type twice.
Is not generic , the class is (it's a non-generic method of a generic class).
Ask your Facebook Friends
Currently, generics in C# do not allow any sane way to perform arithmetic. There are awkward workarounds available, but none of them are very neat and all of them reduce performance. According to this interview , an interface with arithmetic types is ...
Started by on , 5 posts by 5 people.  
Generics extend.
The compiler will only allow operations on generic type parameters allow a Generic to be restricted to a list of types? Because then it's not generic .
Generics are not C++ templates.
Sorry if the title seems confusing, but some examples are in order. Let's say I have some Java class with a generic type parameter: public class GenericClass<T> { } I can create a variable typed to store an object, with the generic parameter set...
Started by on , 3 posts by 3 people.  
List<GenericClass<?>> generic GenericClass<?>> generic =....
List<GenericClass<String>> stringy = ...
GenericClass<?>> generic = stringy which should work as expected (though is pretty ugly .
Namespace GenericsTest { public class AGenericClass<T> { public class NestedNonGenericClass { } } } In the example above, should NestedNonGenericClass be considered a generic class? The reflection API says it's a generic class, and even hands me...
Started by on , 5 posts by 5 people.  
Yes, your nested class absolutely is generic, because T is bound to a type....
Then it would not be Generic....
A generic class declaration or a generic struct declaration (ยง25.2) is itself a generic class it private..
At the risk of becoming the village idiot, can someone explain to me why generics are called generics? I understand their usage and benefits, but if the definition of generic is "general" and generic collections are type safe, then why isn't this a misnomer...
Started by on , 10 posts by 10 people.  
If you ask it for something you with a tautology; a generic method is called generic because, as you said, its can be used the the general sense, it doesnt have a specific....
It ONLY works with types of object.
ArrayList isn't "generic".
I have a base class which is non-generic with a derived generic class. The AbstractRepository and ILoggingManager are provided by the IoC framework. Base Class public abstract class EventHandlerBase : AbstractDataProvider , IEventHandler { public EventHandlerBase...
Started by on , 3 posts by 3 people.  
Should it not be more like: public abstract(data, loggingManager) { // Initialize... .
For a generic method like ConvertAll .
For example, List<T> more of them, e.g.
A constructor in a generic type, you don't specify the type parameters.
Class test <T> where T : class { public void Write<T>() { Console.Write(typeof(T).FullName); } } In the above class, it is possible to pass in a string for the class ( test<string> Test = new test<string> ) and then int for the...
Started by on , 3 posts by 3 people.  
It is possible to define a different one for all generic parameters currently in scope..
In the class, you must have multiple generic parameters.
Let me give example: I have some generic class/interface definition: interface IGenericCar< T > {...} I have another class/interface that I want to relate with class above, for example: interface IGarrage< TCar > : where TCar: IGenericCar&...
Started by on , 4 posts by 4 people.  
Idea was to avoid back-reference in generic constraint (because they don't work), so adding extra non-generic interface could be way around....
} interface.
Is not generic and constrain against that interface interface IGenericCar { ...
Page: 1   2   3   4   5   6   7   8   9   10  
Related Searches
generic 10 het    ide_generic    Generic_c TSW    generic viagra    generic rndis    generic_c vcz    Generic atr    generic gAZCO    generic propecia    Generics   
More Information


Forum Search About Omgili Help Plugins Forum/Board Owners Privacy

i
In Title
In Topic
In Reply
Exclude
Boost