Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

explain difference between classes and structs - basics/classes #360

Closed
wilzbach opened this issue Jun 24, 2016 · 2 comments
Closed

explain difference between classes and structs - basics/classes #360

wilzbach opened this issue Jun 24, 2016 · 2 comments

Comments

@wilzbach
Copy link
Member

why and when we should pick classes over struct

(reported by @claudiug)

@wilzbach
Copy link
Member Author

use of struct is "D-ish", because they don't require GC allocation.

Classes are great if you have one instance a couple of time and/or over the lifetime of your application.

@wilzbach wilzbach changed the title on http://tour.dlang.io/tour/en/basics/classes explain difference between classes and structs - basics/classes Jun 24, 2016
@wilzbach
Copy link
Member Author

This issue was moved to dlang-tour/english#37

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant