Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. CODo you find this feature less difficult to implement for C++ templates? Because it exists there and it is tremendously useful and exceptionally powerful. I can give one example when I would find this feature really useful, because that is related to my work at the moment. If you want to dynamically generate a type with Reflection.Emit, which base type is only known at run-time, then it would be hugely useful to have a statically compiled generic deriving from its type parameter, from which the dynamically emitted type could derive.
      singulars
    2. COIt is far less difficult to implement for C++ templates because C++ templates *recompile* the template on each construction of it. C# generics are compiled *once* and the same code is generated at runtime for ALL constructions if the type argument is a reference type. That's a fundamental difference; it means that C# generics must be correct for any *possible* construction, whereas C++ templates need only be correct for the finite number of *actual* constructions in the source code.
      singulars
    3. COGood point. But generic types are open types. One cannot have any instances of an open generic type. Hence its actual memory layout may remain unresolved until a generic type is actually instantiated. In fact, this is the case even today. A generic type aggregating an instance of the generic parameter type has unclear memory layout until instantiation. At the moment I am not convinced that it is impossible to come up with a set of constraints (new types of constraints will be needed) to make the discussed inheritance work.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload