Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6060269
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:48:23+00:00 2026-05-23T08:48:23+00:00

I was thinking about this. classes are obviously passed around by ptr. I suspect

  • 0

I was thinking about this. classes are obviously passed around by ptr. I suspect structs are passed around by copying it but i don’t know for sure. (it seems like a waste for an int array to have every element a ptr. and passing ptrs for ints)

But thinking about it, List<MyStruct> can not know the size of my struct. What happens when i do this? Are there multiple copies of “List`1” and every time i use it with a storage size it does not have it creates a new implementation? (adjusting for the new offsets of T and such).

That could make sense since the source would be in the CIL inside of a DLL. But i am completely guessing, how is it done? Perhaps a reference or page # to the ECMA standards?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T08:48:23+00:00Added an answer on May 23, 2026 at 8:48 am

    Generics use the concept of open and closed generic types: A parametrized generic class definition (i.e. List<T>) is an open generic type of which the runtime generates a closed generic type for each different use you have in your code, i.e. a different type is created for List<int> and for List<MyStruct> – for each closed generic type the size and type of T is known at run-time.

    Clarification from MSDN:

    When a generic type or method is
    compiled into Microsoft intermediate
    language (MSIL), it contains metadata
    that identifies it as having type
    parameters. How the MSIL for a generic
    type is used differs based on whether
    the supplied type parameter is a value
    type or reference type.

    When a generic type is first
    constructed with a value type as a
    parameter, the runtime creates a
    specialized generic type with the
    supplied parameter or parameters
    substituted in the appropriate
    locations in the MSIL. Specialized
    generic types are created one time for
    each unique value type that is used as
    a parameter.

    Generics work somewhat differently for
    reference types. The first time a
    generic type is constructed with any
    reference type, the runtime creates a
    specialized generic type with object
    references substituted for the
    parameters in the MSIL. Then, every
    time that a constructed type is
    instantiated with a reference type as
    its parameter, regardless of what type
    it is, the runtime reuses the
    previously created specialized version
    of the generic type. This is possible
    because all references are the same
    size.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Maybe I'm just thinking about this too hard, but I'm having a problem figuring
I'm thinking about how to do this, but I have several different shapes of
While thinking about this question and conversing with the participants, the idea came up
I've been thinking about this object oriented design question for a while now and
I've been thinking about this problem for a while and have yet to come
A discussion about Singletons in PHP has me thinking about this issue more and
Can I specify interfaces when I declare a member? After thinking about this question
I am thinking about something like this: public static <T extends Comparable<T>> T minOf(T...ts){
This recent question about sorting randomly using C# got me thinking about the way
I'm thinking about making a networked game. I'm a little new to this, and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.