© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
1 reply
Gladiator

❔ Generally, how do you implement a readonly struct?

Hi. Generally, how do you implement a readonly struct? I mean define readonly fields or getter?
What is the difference? What about defensive copy?
Suppose that struct type contains primitive value types like int, float and also other struct types
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

readonly struct and readonly struct instance members (optimization?)
C#CC# / help
4y ago
Readonly struct property vs member variable
C#CC# / help
3y ago
`readonly` struct, `in` modifier and defensive copies
C#CC# / help
13mo ago
How do you implement paging on API requests?
C#CC# / help
16mo ago