Re: using generics to serialize primitives.

Tech-Archive recommends: Fix windows errors by optimizing your registry



If it comes to that I will overload the primitives like
they do with the system.convert() routines etc...

If overloading is an option, then just use BitConverter directly. I
only used generics here because it was in the original subject; this
has the dubious advantage that you can use it deep within generic
code, when you don't know the type of T, so overloads (such as
BitConverter) can't be used directly.

Re the performance, the whole setup is cached; all you have is a pre-
checked delegate invoke, so it shouldn't be too bad - not /quite/ as
quick as direct calls to an overload, but not far behind.
.



Relevant Pages

  • Re: overloading with generic arguments
    ... Hash: SHA1 ... I have a complicated question about overloading with generic arguments. ... Since the compiler knows about generics, ...
    (comp.lang.java.programmer)
  • Re: Overloading in Lisp
    ... > Say I'm looking to overload + or * to sum or multiple fixnums and ... > floats, or vectors of fixnums and floats. ... Generics work for you here, ... I use the term overloading for something that is ...
    (comp.lang.lisp)
  • Re: Wishlist for Delphi 10 / 2006
    ... no experience with Generics. ... what benifit do you get through the use of operator ... overloading that you couldn't achieve through methods? ... Heck I'd even go as far as promoting the record method because I could ...
    (borland.public.delphi.non-technical)
  • Re: PL/I, COBOL, Advantages, Equivalence, et al
    ... Overloading, not templates. ... In Ada, generics can be overloaded. ... It is true that with Ada's strict typing, generics are necessary for sanity. ...
    (comp.lang.pl1)
  • Re: PL/I, COBOL, Advantages, Equivalence, et al
    ... I seem to recall you indicating that the current PL/I does ... have generics. ... No. PL/I uses the word "GENERIC" to describe what modern languages call "overloading" -- but PL/I requires that each overloading procedure be given a name, and then the "generic" group be declared as a separate entity containing them. ... The only way in which PL/I has generics in the Ada sense (what C++ calls "templates") is that certain built-in functions are silently generic. ...
    (comp.lang.pl1)